@voltade/envoy-sdk 1.0.1 → 1.0.3
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.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/resources/index.d.ts +3 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +3 -2
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/webhooks/index.d.ts +9 -0
- package/dist/resources/webhooks/index.d.ts.map +1 -0
- package/dist/resources/webhooks/index.js +14 -0
- package/dist/resources/webhooks/index.js.map +1 -0
- package/dist/resources/webhooks/types.d.ts +2376 -0
- package/dist/resources/webhooks/types.d.ts.map +1 -0
- package/dist/resources/webhooks/types.js +151 -0
- package/dist/resources/webhooks/types.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
* const result = await client.conversations.escalateToHuman(123);
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
export { EnvoyClient, type EnvoyClientConfig } from
|
|
26
|
-
export type { Agent, Article, Assignee, Contact, ContactInbox, Conversation, ConversationMeta, ConversationStatus, ContentType, CreateMessageParams, EscalationResponse, EscalationType, Message, MessageType, MessagesResponse, MessagesResponseMeta, Priority, SearchParams, SearchResponse, Team, } from
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
25
|
+
export { EnvoyClient, type EnvoyClientConfig } from "./client.js";
|
|
26
|
+
export type { Agent, Article, Assignee, Contact, ContactInbox, Conversation, ConversationMeta, ConversationStatus, ContentType, CreateMessageParams, EscalationResponse, EscalationType, Message, MessageType, MessagesResponse, MessagesResponseMeta, Priority, SearchParams, SearchResponse, Team, } from "./resources/index.js";
|
|
27
|
+
export { webhookEvent } from "./resources/webhooks/index.js";
|
|
28
|
+
export { Conversations, Inboxes } from "./resources/index.js";
|
|
29
|
+
export { AgentSchema, ArticleSchema, AssigneeSchema, ContactInboxSchema, ContactSchema, ConversationMetaSchema, ConversationSchema, ConversationStatusSchema, ContentTypeSchema, CreateMessageParamsSchema, EscalationResponseSchema, EscalationTypeSchema, MessageSchema, MessagesResponseMetaSchema, MessagesResponseSchema, MessageTypeSchema, PrioritySchema, SearchParamsSchema, SearchResponseSchema, TeamSchema, } from "./resources/index.js";
|
|
30
|
+
export { HttpClient } from "./http-client.js";
|
|
31
|
+
export { AuthenticationError, BadRequestError, EnvoyError, NetworkError, NotFoundError, RateLimitError, ServerError, ValidationError, } from "./errors.js";
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGlE,YAAY,EACV,KAAK,EACL,OAAO,EACP,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,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f,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,WAAW,EACX,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23,12 +23,13 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
// Main client export
|
|
26
|
-
export { EnvoyClient } from
|
|
27
|
-
export {
|
|
26
|
+
export { EnvoyClient } from "./client.js";
|
|
27
|
+
export { webhookEvent } from "./resources/webhooks/index.js";
|
|
28
|
+
export { Conversations, Inboxes } from "./resources/index.js";
|
|
28
29
|
// Zod schema exports
|
|
29
|
-
export { AgentSchema, ArticleSchema, AssigneeSchema, ContactInboxSchema, ContactSchema, ConversationMetaSchema, ConversationSchema, ConversationStatusSchema, ContentTypeSchema, CreateMessageParamsSchema, EscalationResponseSchema, EscalationTypeSchema, MessageSchema, MessagesResponseMetaSchema, MessagesResponseSchema, MessageTypeSchema, PrioritySchema, SearchParamsSchema, SearchResponseSchema, TeamSchema, } from
|
|
30
|
+
export { AgentSchema, ArticleSchema, AssigneeSchema, ContactInboxSchema, ContactSchema, ConversationMetaSchema, ConversationSchema, ConversationStatusSchema, ContentTypeSchema, CreateMessageParamsSchema, EscalationResponseSchema, EscalationTypeSchema, MessageSchema, MessagesResponseMetaSchema, MessagesResponseSchema, MessageTypeSchema, PrioritySchema, SearchParamsSchema, SearchResponseSchema, TeamSchema, } from "./resources/index.js";
|
|
30
31
|
// Utility exports
|
|
31
|
-
export { HttpClient } from
|
|
32
|
+
export { HttpClient } from "./http-client.js";
|
|
32
33
|
// Error exports
|
|
33
|
-
export { AuthenticationError, BadRequestError, EnvoyError, NetworkError, NotFoundError, RateLimitError, ServerError, ValidationError, } from
|
|
34
|
+
export { AuthenticationError, BadRequestError, EnvoyError, NetworkError, NotFoundError, RateLimitError, ServerError, ValidationError, } from "./errors.js";
|
|
34
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,qBAAqB;AACrB,OAAO,EAAE,WAAW,EAA0B,MAAM,aAAa,CAAC;AAyBlE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE9D,qBAAqB;AACrB,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAE9B,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,gBAAgB;AAChB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,WAAW,EACX,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,qBAAqB;AACrB,OAAO,EAAE,WAAW,EAA0B,MAAM,aAAa,CAAC;AAyBlE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE9D,qBAAqB;AACrB,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAE9B,kBAAkB;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,gBAAgB;AAChB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,WAAW,EACX,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Resources module
|
|
3
3
|
* Exports all resource classes and their types
|
|
4
4
|
*/
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
5
|
+
export * from "./conversations/index.js";
|
|
6
|
+
export * from "./inboxes/index.js";
|
|
7
|
+
export * from "./webhooks/index.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
package/dist/resources/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Resources module
|
|
3
3
|
* Exports all resource classes and their types
|
|
4
4
|
*/
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
5
|
+
export * from "./conversations/index.js";
|
|
6
|
+
export * from "./inboxes/index.js";
|
|
7
|
+
export * from "./webhooks/index.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MessageCreatedEvent } from "./types.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export declare const webhookEvent: {
|
|
4
|
+
/** Throws ZodError if invalid */
|
|
5
|
+
parse: (body: unknown) => MessageCreatedEvent;
|
|
6
|
+
/** Returns null if invalid */
|
|
7
|
+
safeParse: (body: unknown) => MessageCreatedEvent | null;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,cAAc,YAAY,CAAC;AAE3B,eAAO,MAAM,YAAY;IACvB,iCAAiC;kBACnB,OAAO,KAAG,mBAAmB;IAG3C,8BAA8B;sBACZ,OAAO,KAAG,mBAAmB,GAAG,IAAI;CAIvD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MessageCreatedEventSchema, } from "./types.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export const webhookEvent = {
|
|
4
|
+
/** Throws ZodError if invalid */
|
|
5
|
+
parse: (body) => {
|
|
6
|
+
return MessageCreatedEventSchema.parse(body);
|
|
7
|
+
},
|
|
8
|
+
/** Returns null if invalid */
|
|
9
|
+
safeParse: (body) => {
|
|
10
|
+
const result = MessageCreatedEventSchema.safeParse(body);
|
|
11
|
+
return result.success ? result.data : null;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAE1B,MAAM,YAAY,CAAC;AAEpB,cAAc,YAAY,CAAC;AAE3B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iCAAiC;IACjC,KAAK,EAAE,CAAC,IAAa,EAAuB,EAAE;QAC5C,OAAO,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IACD,8BAA8B;IAC9B,SAAS,EAAE,CAAC,IAAa,EAA8B,EAAE;QACvD,MAAM,MAAM,GAAG,yBAAyB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;CACF,CAAC"}
|