cogfy-messenger 0.1.9 → 0.1.10

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.
@@ -1,6 +1,6 @@
1
1
  import { BaseClient } from '../base-client';
2
2
  import { SendMessageCommand, SendMessageResult } from './types/send-message';
3
- import { GetConversationResult, GetMessagesResult, ListConversationsParams, ListConversationsResult, ListMessagesParams, SendInteractiveOrderDetailsConversationMessageCommand, SendInteractiveOrderDetailsConversationMessageResult } from './types';
3
+ import { GetConversationResult, GetMessagesResult, ListConversationsParams, ListConversationsResult, ListMessagesParams } from './types';
4
4
  export declare class ConversationsClient extends BaseClient {
5
5
  /**
6
6
  * Calls the GET /conversations/:id endpoint
@@ -20,13 +20,6 @@ export declare class ConversationsClient extends BaseClient {
20
20
  * @returns A list of all messages in the specified conversation
21
21
  */
22
22
  getMessages(params: ListMessagesParams): Promise<GetMessagesResult>;
23
- /**
24
- * Calls the POST /conversations/:id/messages/interactive/order-details endpoint
25
- * @param id The ID of the conversation to send a message to
26
- * @param payload The message payload to send
27
- * @returns The response from the API
28
- */
29
- sendInteractiveOrderDetailsMessage(id: string, payload: SendInteractiveOrderDetailsConversationMessageCommand): Promise<SendInteractiveOrderDetailsConversationMessageResult>;
30
23
  /**
31
24
  * Calls the POST /conversations/:id/messages endpoint
32
25
  * @param id The ID of the conversation to send a message to
@@ -48,17 +48,6 @@ class ConversationsClient extends base_client_1.BaseClient {
48
48
  return axiosResponse.data;
49
49
  });
50
50
  }
51
- /**
52
- * Calls the POST /conversations/:id/messages/interactive/order-details endpoint
53
- * @param id The ID of the conversation to send a message to
54
- * @param payload The message payload to send
55
- * @returns The response from the API
56
- */
57
- sendInteractiveOrderDetailsMessage(id, payload) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- return (yield this.axios.post(`/conversations/${id}/messages/interactive/order-details`, payload)).data;
60
- });
61
- }
62
51
  /**
63
52
  * Calls the POST /conversations/:id/messages endpoint
64
53
  * @param id The ID of the conversation to send a message to
@@ -1,5 +1,4 @@
1
1
  export * from './get-conversation';
2
2
  export * from './get-messages';
3
3
  export * from './list-conversations';
4
- export * from './send-interactive-order-details-message';
5
4
  export * from './send-message';
@@ -17,5 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-conversation"), exports);
18
18
  __exportStar(require("./get-messages"), exports);
19
19
  __exportStar(require("./list-conversations"), exports);
20
- __exportStar(require("./send-interactive-order-details-message"), exports);
21
20
  __exportStar(require("./send-message"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogfy-messenger",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && tsc",
@@ -1,81 +0,0 @@
1
- export type SendInteractiveOrderDetailsConversationMessageCommand = {
2
- content: InteractiveOrderDetailsContent;
3
- };
4
- export type SendInteractiveOrderDetailsConversationMessageResult = {
5
- id: string;
6
- };
7
- type Amount = {
8
- value: number;
9
- offset: number;
10
- description?: string;
11
- };
12
- type PaymentSettingsTypePixDynamicCode = {
13
- type: 'pix_dynamic_code';
14
- pix_dynamic_code: {
15
- code: string;
16
- merchant_name: string;
17
- key: string;
18
- key_type: string;
19
- };
20
- };
21
- type PaymentSettingsTypePaymentLink = {
22
- type: 'payment_link';
23
- payment_link: {
24
- uri: string;
25
- };
26
- };
27
- type PaymentSettingsTypeBoleto = {
28
- type: 'boleto';
29
- boleto: {
30
- digitable_line: string;
31
- };
32
- };
33
- type InteractiveOrderDetailsContent = {
34
- type: 'order_details';
35
- body: {
36
- text: string;
37
- };
38
- action: {
39
- name: string;
40
- parameters: {
41
- reference_id: string;
42
- type: string;
43
- payment_type: string;
44
- payment_settings?: Array<PaymentSettingsTypePixDynamicCode | PaymentSettingsTypePaymentLink | PaymentSettingsTypeBoleto>;
45
- currency: string;
46
- total_amount: Amount;
47
- order: {
48
- status: string;
49
- catalog_id?: string;
50
- shipping?: Amount;
51
- expiration?: {
52
- description: string;
53
- timestamp: string;
54
- };
55
- tax: Amount;
56
- discount?: Amount & {
57
- discount_program_name?: string;
58
- };
59
- items: {
60
- retailer_id: string;
61
- name: string;
62
- amount: Amount;
63
- quantity: number;
64
- sale_amount?: Amount;
65
- }[];
66
- subtotal: Amount;
67
- };
68
- };
69
- };
70
- header?: {
71
- type: 'image';
72
- image: {
73
- link: string;
74
- provider?: string;
75
- };
76
- };
77
- footer?: {
78
- text: string;
79
- };
80
- };
81
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });