sim-node-lib 0.4.64 → 0.4.66

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.
@@ -3,7 +3,7 @@ declare class GoogleChatMessageBuilder {
3
3
  withText(text: string): GoogleChatMessageBuilder;
4
4
  withCardHeader(title: string, subtitle: string, image: string): GoogleChatMessageBuilder;
5
5
  withTextParagraph(text: string): GoogleChatMessageBuilder;
6
- withButton(text: string, actionURL: string): GoogleChatMessageBuilder;
6
+ addButton(text: string, actionURL: string): GoogleChatMessageBuilder;
7
7
  stringfy(): string;
8
8
  }
9
9
  export default GoogleChatMessageBuilder;
@@ -13,13 +13,15 @@ class GoogleChatMessageBuilder {
13
13
  this.message.cardsV2 = [];
14
14
  }
15
15
  const card = {
16
- header: {
17
- title: title,
18
- subtitle: subtitle,
19
- imageUrl: image,
20
- imageType: 'CIRCLE',
16
+ card: {
17
+ header: {
18
+ title: title,
19
+ subtitle: subtitle,
20
+ imageUrl: image,
21
+ imageType: 'CIRCLE',
22
+ },
23
+ sections: [],
21
24
  },
22
- sections: [],
23
25
  };
24
26
  this.message.cardsV2.push(card);
25
27
  return this;
@@ -32,14 +34,14 @@ class GoogleChatMessageBuilder {
32
34
  if (!this.message.cardsV2 || this.message.cardsV2.length === 0) {
33
35
  throw new Error('Nenhum card criado. Adicione um card antes de adicionar uma seção.');
34
36
  }
35
- this.message.cardsV2[this.message.cardsV2.length - 1].sections.push(section);
37
+ this.message.cardsV2[this.message.cardsV2.length - 1].card.sections.push(section);
36
38
  return this;
37
39
  }
38
- withButton(text, actionURL) {
40
+ addButton(text, actionURL) {
39
41
  const buttonWidget = {
40
- buttons: [
41
- {
42
- textButton: {
42
+ buttonWidget: {
43
+ buttons: [
44
+ {
43
45
  text: text,
44
46
  onClick: {
45
47
  openLink: {
@@ -47,8 +49,8 @@ class GoogleChatMessageBuilder {
47
49
  },
48
50
  },
49
51
  },
50
- },
51
- ],
52
+ ],
53
+ },
52
54
  };
53
55
  const section = {
54
56
  widgets: [buttonWidget],
@@ -56,7 +58,7 @@ class GoogleChatMessageBuilder {
56
58
  if (!this.message.cardsV2 || this.message.cardsV2.length === 0) {
57
59
  throw new Error('Nenhum card criado. Adicione um card antes de adicionar um botão.');
58
60
  }
59
- this.message.cardsV2[this.message.cardsV2.length - 1].sections.push(section);
61
+ this.message.cardsV2[this.message.cardsV2.length - 1].card.sections.push(section);
60
62
  return this;
61
63
  }
62
64
  stringfy() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim-node-lib",
3
- "version": "0.4.64",
3
+ "version": "0.4.66",
4
4
  "description": "Library from SIMLabs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",