@livechat/developer-studio-api 3.1.1 → 3.1.2
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 +1181 -189
- package/dist/index.d.ts +1181 -189
- package/dist/index.js +204 -71
- package/dist/index.mjs +198 -68
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -6049,25 +6049,23 @@ function initPlatformBillingClient(baseUrl, token) {
|
|
|
6049
6049
|
import { z as z4 } from "zod";
|
|
6050
6050
|
|
|
6051
6051
|
// src/apis/platform/adapter/integrations/shopify/_contracts/dtos/events.ts
|
|
6052
|
-
var
|
|
6053
|
-
|
|
6054
|
-
return
|
|
6055
|
-
})(
|
|
6052
|
+
var ShopifyEventNames = /* @__PURE__ */ ((ShopifyEventNames2) => {
|
|
6053
|
+
ShopifyEventNames2["OrderCreated"] = "order_created";
|
|
6054
|
+
return ShopifyEventNames2;
|
|
6055
|
+
})(ShopifyEventNames || {});
|
|
6056
6056
|
|
|
6057
6057
|
// src/apis/platform/adapter/integrations/shopify/_contracts/requests/events.ts
|
|
6058
6058
|
import { z } from "zod";
|
|
6059
6059
|
var shopifyEventsZods = {
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6060
|
+
provider: z.literal("shopify"),
|
|
6061
|
+
eventName: z.nativeEnum(ShopifyEventNames),
|
|
6062
|
+
events: {
|
|
6063
|
+
orderCreated: z.object({
|
|
6064
|
+
name: z.literal("order_created" /* OrderCreated */)
|
|
6065
|
+
})
|
|
6065
6066
|
},
|
|
6066
|
-
get
|
|
6067
|
-
return z.
|
|
6068
|
-
provider: z.literal("shopify"),
|
|
6069
|
-
event: this.event
|
|
6070
|
-
});
|
|
6067
|
+
get event() {
|
|
6068
|
+
return z.discriminatedUnion("name", [this.events.orderCreated]);
|
|
6071
6069
|
},
|
|
6072
6070
|
get source() {
|
|
6073
6071
|
return z.object({
|
|
@@ -6076,14 +6074,32 @@ var shopifyEventsZods = {
|
|
|
6076
6074
|
});
|
|
6077
6075
|
},
|
|
6078
6076
|
get subscribe() {
|
|
6079
|
-
return this.source.and(
|
|
6077
|
+
return this.source.and(
|
|
6080
6078
|
z.object({
|
|
6079
|
+
event: this.event,
|
|
6081
6080
|
callback: z.string()
|
|
6082
6081
|
})
|
|
6083
6082
|
);
|
|
6084
6083
|
},
|
|
6084
|
+
get subscribeContent() {
|
|
6085
|
+
return z.object({
|
|
6086
|
+
provider: this.provider,
|
|
6087
|
+
event: this.event,
|
|
6088
|
+
callback: z.string()
|
|
6089
|
+
});
|
|
6090
|
+
},
|
|
6085
6091
|
get unsubscribe() {
|
|
6086
|
-
return this.source.and(
|
|
6092
|
+
return this.source.and(
|
|
6093
|
+
z.object({
|
|
6094
|
+
event: this.eventName
|
|
6095
|
+
})
|
|
6096
|
+
);
|
|
6097
|
+
},
|
|
6098
|
+
get unsubscribeContent() {
|
|
6099
|
+
return z.object({
|
|
6100
|
+
provider: this.provider,
|
|
6101
|
+
event: this.eventName
|
|
6102
|
+
});
|
|
6087
6103
|
}
|
|
6088
6104
|
};
|
|
6089
6105
|
|
|
@@ -6091,27 +6107,29 @@ var shopifyEventsZods = {
|
|
|
6091
6107
|
import { z as z2 } from "zod";
|
|
6092
6108
|
|
|
6093
6109
|
// src/apis/platform/adapter/integrations/mailchimp/_contracts/dtos/events.ts
|
|
6094
|
-
var
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
return
|
|
6098
|
-
})(
|
|
6110
|
+
var MailchimpEventNames = /* @__PURE__ */ ((MailchimpEventNames2) => {
|
|
6111
|
+
MailchimpEventNames2["Subscribed"] = "subscribed";
|
|
6112
|
+
MailchimpEventNames2["Unsubscribed"] = "unsubscribed";
|
|
6113
|
+
return MailchimpEventNames2;
|
|
6114
|
+
})(MailchimpEventNames || {});
|
|
6099
6115
|
|
|
6100
6116
|
// src/apis/platform/adapter/integrations/mailchimp/_contracts/requests/events.ts
|
|
6101
6117
|
var mailchimpEventsZods = {
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
})
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6118
|
+
provider: z2.literal("mailchimp"),
|
|
6119
|
+
eventName: z2.nativeEnum(MailchimpEventNames),
|
|
6120
|
+
events: {
|
|
6121
|
+
subscribed: z2.object({
|
|
6122
|
+
name: z2.literal("subscribed" /* Subscribed */)
|
|
6123
|
+
}),
|
|
6124
|
+
unsubscribed: z2.object({
|
|
6125
|
+
name: z2.literal("unsubscribed" /* Unsubscribed */)
|
|
6126
|
+
})
|
|
6127
|
+
},
|
|
6128
|
+
get event() {
|
|
6129
|
+
return z2.discriminatedUnion("name", [
|
|
6130
|
+
this.events.subscribed,
|
|
6131
|
+
this.events.unsubscribed
|
|
6132
|
+
]);
|
|
6115
6133
|
},
|
|
6116
6134
|
get source() {
|
|
6117
6135
|
return z2.object({
|
|
@@ -6120,39 +6138,100 @@ var mailchimpEventsZods = {
|
|
|
6120
6138
|
});
|
|
6121
6139
|
},
|
|
6122
6140
|
get subscribe() {
|
|
6123
|
-
return this.source.and(
|
|
6141
|
+
return this.source.and(
|
|
6124
6142
|
z2.object({
|
|
6143
|
+
event: this.event,
|
|
6144
|
+
listId: z2.string(),
|
|
6125
6145
|
callback: z2.string()
|
|
6126
6146
|
})
|
|
6127
6147
|
);
|
|
6128
6148
|
},
|
|
6149
|
+
get subscribeContent() {
|
|
6150
|
+
return z2.object({
|
|
6151
|
+
provider: this.provider,
|
|
6152
|
+
event: this.event,
|
|
6153
|
+
callback: z2.string(),
|
|
6154
|
+
listId: z2.string()
|
|
6155
|
+
});
|
|
6156
|
+
},
|
|
6129
6157
|
get unsubscribe() {
|
|
6130
|
-
return this.source.and(
|
|
6158
|
+
return this.source.and(
|
|
6159
|
+
z2.object({
|
|
6160
|
+
event: this.eventName,
|
|
6161
|
+
listId: z2.string()
|
|
6162
|
+
})
|
|
6163
|
+
);
|
|
6164
|
+
},
|
|
6165
|
+
get unsubscribeContent() {
|
|
6166
|
+
return z2.object({
|
|
6167
|
+
provider: this.provider,
|
|
6168
|
+
event: this.eventName,
|
|
6169
|
+
listId: z2.string()
|
|
6170
|
+
});
|
|
6131
6171
|
}
|
|
6132
6172
|
};
|
|
6133
6173
|
|
|
6134
6174
|
// src/apis/platform/adapter/integrations/text/_contracts/dtos/events.ts
|
|
6135
|
-
var
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6175
|
+
var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
|
|
6176
|
+
TextLivechatEventNames2["ChatStarted"] = "chat_started";
|
|
6177
|
+
TextLivechatEventNames2["ChatEnded"] = "chat_ended";
|
|
6178
|
+
TextLivechatEventNames2["ChatTransferred"] = "chat_transferred";
|
|
6179
|
+
TextLivechatEventNames2["ChatRated"] = "chat_rated";
|
|
6180
|
+
TextLivechatEventNames2["ChatCommented"] = "chat_commented";
|
|
6181
|
+
TextLivechatEventNames2["ChatMessage"] = "chat_message";
|
|
6182
|
+
TextLivechatEventNames2["UserAddedToChat"] = "user_added_to_chat";
|
|
6183
|
+
TextLivechatEventNames2["UserRemovedFromChat"] = "user_removed_from_chat";
|
|
6184
|
+
return TextLivechatEventNames2;
|
|
6185
|
+
})(TextLivechatEventNames || {});
|
|
6141
6186
|
|
|
6142
6187
|
// src/apis/platform/adapter/integrations/text/_contracts/requests/events.ts
|
|
6143
6188
|
import { z as z3 } from "zod";
|
|
6144
6189
|
var textLivechatEventsZods = {
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6190
|
+
provider: z3.literal("text-livechat"),
|
|
6191
|
+
eventName: z3.nativeEnum(TextLivechatEventNames),
|
|
6192
|
+
events: {
|
|
6193
|
+
chatStarted: z3.object({
|
|
6194
|
+
name: z3.literal("chat_started" /* ChatStarted */)
|
|
6195
|
+
}),
|
|
6196
|
+
chatEnded: z3.object({
|
|
6197
|
+
name: z3.literal("chat_ended" /* ChatEnded */)
|
|
6198
|
+
}),
|
|
6199
|
+
chatTransferred: z3.object({
|
|
6200
|
+
name: z3.literal("chat_transferred" /* ChatTransferred */)
|
|
6201
|
+
}),
|
|
6202
|
+
chatRated: z3.object({
|
|
6203
|
+
name: z3.literal("chat_rated" /* ChatRated */)
|
|
6204
|
+
}),
|
|
6205
|
+
chatCommented: z3.object({
|
|
6206
|
+
name: z3.literal("chat_commented" /* ChatCommented */)
|
|
6207
|
+
}),
|
|
6208
|
+
chatMessage: z3.object({
|
|
6209
|
+
name: z3.literal("chat_message" /* ChatMessage */),
|
|
6210
|
+
params: z3.object({
|
|
6211
|
+
filter: z3.string().optional()
|
|
6212
|
+
}).optional()
|
|
6213
|
+
}),
|
|
6214
|
+
userAddedToChat: z3.object({
|
|
6215
|
+
name: z3.literal("user_added_to_chat" /* UserAddedToChat */),
|
|
6216
|
+
params: z3.object({
|
|
6217
|
+
userType: z3.enum(["agent", "customer"]).optional()
|
|
6218
|
+
}).optional()
|
|
6219
|
+
}),
|
|
6220
|
+
userRemovedFromChat: z3.object({
|
|
6221
|
+
name: z3.literal("user_removed_from_chat" /* UserRemovedFromChat */)
|
|
6222
|
+
})
|
|
6223
|
+
},
|
|
6224
|
+
get event() {
|
|
6225
|
+
return z3.discriminatedUnion("name", [
|
|
6226
|
+
this.events.chatStarted,
|
|
6227
|
+
this.events.chatEnded,
|
|
6228
|
+
this.events.chatTransferred,
|
|
6229
|
+
this.events.chatRated,
|
|
6230
|
+
this.events.chatCommented,
|
|
6231
|
+
this.events.chatMessage,
|
|
6232
|
+
this.events.userAddedToChat,
|
|
6233
|
+
this.events.userRemovedFromChat
|
|
6234
|
+
]);
|
|
6156
6235
|
},
|
|
6157
6236
|
get source() {
|
|
6158
6237
|
return z3.object({
|
|
@@ -6161,14 +6240,32 @@ var textLivechatEventsZods = {
|
|
|
6161
6240
|
});
|
|
6162
6241
|
},
|
|
6163
6242
|
get subscribe() {
|
|
6164
|
-
return this.source.and(
|
|
6243
|
+
return this.source.and(
|
|
6165
6244
|
z3.object({
|
|
6245
|
+
event: this.event,
|
|
6166
6246
|
callback: z3.string()
|
|
6167
6247
|
})
|
|
6168
6248
|
);
|
|
6169
6249
|
},
|
|
6250
|
+
get subscribeContent() {
|
|
6251
|
+
return z3.object({
|
|
6252
|
+
provider: this.provider,
|
|
6253
|
+
event: this.event,
|
|
6254
|
+
callback: z3.string()
|
|
6255
|
+
});
|
|
6256
|
+
},
|
|
6170
6257
|
get unsubscribe() {
|
|
6171
|
-
return this.source.and(
|
|
6258
|
+
return this.source.and(
|
|
6259
|
+
z3.object({
|
|
6260
|
+
event: this.eventName
|
|
6261
|
+
})
|
|
6262
|
+
);
|
|
6263
|
+
},
|
|
6264
|
+
get unsubscribeContent() {
|
|
6265
|
+
return z3.object({
|
|
6266
|
+
provider: this.provider,
|
|
6267
|
+
event: this.eventName
|
|
6268
|
+
});
|
|
6172
6269
|
}
|
|
6173
6270
|
};
|
|
6174
6271
|
|
|
@@ -6176,29 +6273,59 @@ var textLivechatEventsZods = {
|
|
|
6176
6273
|
var integrationEventsZods = {
|
|
6177
6274
|
sourceName: z4.enum(["apps", "workflows"]),
|
|
6178
6275
|
providerName: z4.enum(["text-livechat", "mailchimp", "shopify"]),
|
|
6276
|
+
get event() {
|
|
6277
|
+
return textLivechatEventsZods.event.or(shopifyEventsZods.event).or(mailchimpEventsZods.event);
|
|
6278
|
+
},
|
|
6179
6279
|
get source() {
|
|
6180
6280
|
return z4.object({
|
|
6181
6281
|
sourceName: this.sourceName,
|
|
6182
6282
|
sourceKey: z4.string()
|
|
6183
6283
|
});
|
|
6184
6284
|
},
|
|
6185
|
-
provider: z4.discriminatedUnion("provider", [
|
|
6186
|
-
textLivechatEventsZods.provider,
|
|
6187
|
-
mailchimpEventsZods.provider,
|
|
6188
|
-
shopifyEventsZods.provider
|
|
6189
|
-
]),
|
|
6190
6285
|
get subscribe() {
|
|
6191
|
-
return this.source.and(
|
|
6192
|
-
z4.
|
|
6193
|
-
|
|
6194
|
-
|
|
6286
|
+
return this.source.and(
|
|
6287
|
+
z4.discriminatedUnion("provider", [
|
|
6288
|
+
textLivechatEventsZods.subscribeContent,
|
|
6289
|
+
shopifyEventsZods.subscribeContent,
|
|
6290
|
+
mailchimpEventsZods.subscribeContent
|
|
6291
|
+
])
|
|
6195
6292
|
);
|
|
6196
6293
|
},
|
|
6197
6294
|
get unsubscribe() {
|
|
6198
|
-
return this.source.and(
|
|
6295
|
+
return this.source.and(
|
|
6296
|
+
z4.discriminatedUnion("provider", [
|
|
6297
|
+
textLivechatEventsZods.unsubscribeContent,
|
|
6298
|
+
shopifyEventsZods.unsubscribeContent,
|
|
6299
|
+
mailchimpEventsZods.unsubscribeContent
|
|
6300
|
+
])
|
|
6301
|
+
);
|
|
6199
6302
|
}
|
|
6200
6303
|
};
|
|
6201
6304
|
|
|
6305
|
+
// src/apis/products/livechat/configuration/webhooks/_contracts/dtos/webhook.ts
|
|
6306
|
+
var WebhookActions = /* @__PURE__ */ ((WebhookActions2) => {
|
|
6307
|
+
WebhookActions2["IncomingChat"] = "incoming_chat";
|
|
6308
|
+
WebhookActions2["ChatDeactivated"] = "chat_deactivated";
|
|
6309
|
+
WebhookActions2["ChatAccessUpdated"] = "chat_access_updated";
|
|
6310
|
+
WebhookActions2["ChatTransferred"] = "chat_transferred";
|
|
6311
|
+
WebhookActions2["UserAddedToChat"] = "user_added_to_chat";
|
|
6312
|
+
WebhookActions2["UserRemovedFromChat"] = "user_removed_from_chat";
|
|
6313
|
+
WebhookActions2["IncomingEvent"] = "incoming_event";
|
|
6314
|
+
WebhookActions2["IncomingCustomer"] = "incoming_customer";
|
|
6315
|
+
return WebhookActions2;
|
|
6316
|
+
})(WebhookActions || {});
|
|
6317
|
+
var WebhookEvents = /* @__PURE__ */ ((WebhookEvents2) => {
|
|
6318
|
+
WebhookEvents2["Message"] = "message";
|
|
6319
|
+
WebhookEvents2["SystemMessage"] = "system_message";
|
|
6320
|
+
WebhookEvents2["Custom"] = "custom";
|
|
6321
|
+
return WebhookEvents2;
|
|
6322
|
+
})(WebhookEvents || {});
|
|
6323
|
+
var WebhookSystemMessages = /* @__PURE__ */ ((WebhookSystemMessages2) => {
|
|
6324
|
+
WebhookSystemMessages2["ChatRated"] = "rating.chat_rated";
|
|
6325
|
+
WebhookSystemMessages2["ChatCommented"] = "rating.chat_commented";
|
|
6326
|
+
return WebhookSystemMessages2;
|
|
6327
|
+
})(WebhookSystemMessages || {});
|
|
6328
|
+
|
|
6202
6329
|
// src/apis/platform/adapter/integrations/mailchimp/api.ts
|
|
6203
6330
|
var platformAdapterMailchimpApi = {
|
|
6204
6331
|
events: {
|
|
@@ -6501,12 +6628,15 @@ export {
|
|
|
6501
6628
|
DpsApiError,
|
|
6502
6629
|
LivechatApiError,
|
|
6503
6630
|
MailchimpApiError,
|
|
6504
|
-
|
|
6631
|
+
MailchimpEventNames,
|
|
6505
6632
|
ShopifyApiError,
|
|
6506
|
-
|
|
6507
|
-
|
|
6633
|
+
ShopifyEventNames,
|
|
6634
|
+
TextLivechatEventNames,
|
|
6508
6635
|
UnauthorizeAccountsApiError,
|
|
6509
6636
|
UnauthorizeApiError,
|
|
6637
|
+
WebhookActions,
|
|
6638
|
+
WebhookEvents,
|
|
6639
|
+
WebhookSystemMessages,
|
|
6510
6640
|
WorkflowDefinitionTaskType,
|
|
6511
6641
|
allAppTemplates,
|
|
6512
6642
|
api,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livechat/developer-studio-api",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "This project is API for LiveChat Developer Studio.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"tsup": "^7.1.0",
|
|
22
22
|
"typescript": "^5.1.6",
|
|
23
23
|
"eslint-config-custom": "0.0.8",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"utils": "0.0.4",
|
|
25
|
+
"tsconfig": "0.0.1"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsup",
|