sim-node-lib 0.4.63 → 0.4.64

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,19 +1,9 @@
1
- declare type CardHeader = {
2
- title: string;
3
- subtitle?: string;
4
- imageUrl?: string;
5
- imageStyle?: string;
6
- };
7
- declare type Button = {
8
- text: string;
9
- actionUrl: string;
10
- };
11
1
  declare class GoogleChatMessageBuilder {
12
2
  private message;
13
3
  withText(text: string): GoogleChatMessageBuilder;
14
- withCardHeader(header: CardHeader): GoogleChatMessageBuilder;
4
+ withCardHeader(title: string, subtitle: string, image: string): GoogleChatMessageBuilder;
15
5
  withTextParagraph(text: string): GoogleChatMessageBuilder;
16
- withButton(button: Button): GoogleChatMessageBuilder;
6
+ withButton(text: string, actionURL: string): GoogleChatMessageBuilder;
17
7
  stringfy(): string;
18
8
  }
19
9
  export default GoogleChatMessageBuilder;
@@ -8,16 +8,16 @@ class GoogleChatMessageBuilder {
8
8
  this.message.text = text;
9
9
  return this;
10
10
  }
11
- withCardHeader(header) {
11
+ withCardHeader(title, subtitle, image) {
12
12
  if (!this.message.cardsV2) {
13
13
  this.message.cardsV2 = [];
14
14
  }
15
15
  const card = {
16
16
  header: {
17
- title: header.title,
18
- subtitle: header.subtitle,
19
- imageUrl: header.imageUrl,
20
- imageStyle: header.imageStyle || 'IMAGE',
17
+ title: title,
18
+ subtitle: subtitle,
19
+ imageUrl: image,
20
+ imageType: 'CIRCLE',
21
21
  },
22
22
  sections: [],
23
23
  };
@@ -35,15 +35,15 @@ class GoogleChatMessageBuilder {
35
35
  this.message.cardsV2[this.message.cardsV2.length - 1].sections.push(section);
36
36
  return this;
37
37
  }
38
- withButton(button) {
38
+ withButton(text, actionURL) {
39
39
  const buttonWidget = {
40
40
  buttons: [
41
41
  {
42
42
  textButton: {
43
- text: button.text,
43
+ text: text,
44
44
  onClick: {
45
45
  openLink: {
46
- url: button.actionUrl,
46
+ url: actionURL,
47
47
  },
48
48
  },
49
49
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim-node-lib",
3
- "version": "0.4.63",
3
+ "version": "0.4.64",
4
4
  "description": "Library from SIMLabs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",