@open-wa/wa-automate-types-only 4.38.1 → 4.40.1

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.
@@ -19,7 +19,7 @@ import { Listener } from 'eventemitter2';
19
19
  import PriorityQueue from 'p-queue/dist/priority-queue';
20
20
  import { NextFunction, Request, Response } from 'express';
21
21
  import { Call } from './model/call';
22
- import { Button, LocationButtonBody, Section } from './model/button';
22
+ import { AdvancedButton, Button, LocationButtonBody, Section } from './model/button';
23
23
  import { JsonObject } from 'type-fest';
24
24
  import { ReactionEvent } from './model/reactions';
25
25
  export declare enum namespace {
@@ -515,6 +515,21 @@ export declare class Client {
515
515
  * @param {string} footer The footer of the buttons message
516
516
  */
517
517
  sendButtons(to: ChatId, body: string | LocationButtonBody, buttons: Button[], title?: string, footer?: string): Promise<boolean | MessageId>;
518
+ /**
519
+ * {@license:insiders@}
520
+ *
521
+ * Send advanced buttons with media body. This is an insiders feature for MD accounts.
522
+ *
523
+ * Body can be location, image, video or document. Buttons can be quick reply, url or call buttons.
524
+ *
525
+ * @param {ChatId} to chat id
526
+ * @param {string | LocationButtonBody} body The body of the buttons message
527
+ * @param {AdvancedButton[]} buttons Array of buttons - limit is 3!
528
+ * @param {string} title The title/header of the buttons message
529
+ * @param {string} footer The footer of the buttons message
530
+ * @param {string} filename Required if body is a file!!
531
+ */
532
+ sendAdvancedButtons(to: ChatId, body: string | LocationButtonBody, buttons: AdvancedButton[], text: string, footer: string, filename: string): Promise<boolean | MessageId>;
518
533
  /**
519
534
  * Send a banner image
520
535
  *
@@ -527,20 +542,6 @@ export declare class Client {
527
542
  /**
528
543
  * {@license:insiders@}
529
544
  *
530
- * :::documentation-page{title="Welcome"}
531
- *
532
- * Please install :inline-code[unified]!
533
- *
534
- * ::copyright-notice{year="2020"}
535
- *
536
- * :::
537
- * ::license-required[insiders]
538
- *
539
- * ::span{year="2020"}
540
- *
541
- * :span{year="2020"}
542
- *
543
- * <span theme="badge contrast license">Insiders</span>
544
545
  * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
545
546
  *
546
547
  * Send a list message. This will not work when being sent from business accounts!
@@ -2,6 +2,12 @@ export interface Button {
2
2
  id: string;
3
3
  text: string;
4
4
  }
5
+ export interface AdvancedButton {
6
+ id?: string;
7
+ text: string;
8
+ url?: string;
9
+ number?: string;
10
+ }
5
11
  export interface Row {
6
12
  title: string;
7
13
  description: string;
@@ -34,6 +34,16 @@ export declare enum DIRECTORY_STRATEGY {
34
34
  */
35
35
  DATE_CHAT = "DATE_CHAT"
36
36
  }
37
+ declare type SessionId = string;
38
+ declare type LicenseKey = string;
39
+ declare type HostAccountNumber = `${number}`;
40
+ declare type HostAccountNumberOrSessionID = HostAccountNumber | SessionId;
41
+ declare type LicenseKeyConfigObject = {
42
+ [key: HostAccountNumberOrSessionID]: LicenseKey;
43
+ };
44
+ declare type LicenseKeyConfigFunctionReturn = LicenseKeyConfigObject | LicenseKey;
45
+ declare type LicenseKeyConfigFunction = (sessionId?: SessionId, number?: HostAccountNumber) => LicenseKeyConfigFunctionReturn | Promise<LicenseKeyConfigFunctionReturn>;
46
+ declare type LicenseKeyConfig = LicenseKeyConfigFunction | LicenseKeyConfigObject | LicenseKey;
37
47
  /**
38
48
  * The available languages for the host security notification
39
49
  */
@@ -98,7 +108,8 @@ export declare enum LicenseType {
98
108
  TEXT_STORY = "Text Story License Key",
99
109
  IMAGE_STORY = "Image Story License Key",
100
110
  VIDEO_STORY = "Video Story License Key",
101
- PREMIUM = "Premium License Key"
111
+ PREMIUM = "Premium License Key",
112
+ NONE = "NONE"
102
113
  }
103
114
  export interface SessionData {
104
115
  WABrowserId?: string;
@@ -264,7 +275,7 @@ export interface ConfigObject {
264
275
  * 1. You can change the number assigned to that License Key at any time, just message me the new number on the private discord channel.
265
276
  * 2. In order to cancel your License Key, simply stop your membership.
266
277
  */
267
- licenseKey?: string | string[];
278
+ licenseKey?: LicenseKey;
268
279
  /**
269
280
  * You may set a custom user agent. However, due to recent developments, this is not really neccessary any more.
270
281
  */
@@ -770,3 +781,7 @@ export interface ConfigObject {
770
781
  /**@internal */
771
782
  [x: string]: any;
772
783
  }
784
+ export declare type AdvancedConfig = ConfigObject & {
785
+ licenseKey: LicenseKeyConfig;
786
+ };
787
+ export {};
@@ -19,7 +19,7 @@ export declare const cliOptionNames: import("type-fest").Simplify<import("type-f
19
19
  export declare const meowFlags: () => AnyFlags;
20
20
  export declare const helptext: string;
21
21
  export declare const envArgs: () => JsonObject;
22
- export declare const configFile: (config: string) => JsonObject;
22
+ export declare const configFile: (config?: string) => JsonObject;
23
23
  export declare const cli: () => {
24
24
  createConfig: ConfigObject;
25
25
  cliConfig: Merge<ConfigObject, {
@@ -1,5 +1,5 @@
1
1
  import { Client } from '../api/Client';
2
- import { ConfigObject } from '../api/model/index';
2
+ import { AdvancedConfig, ConfigObject } from '../api/model/index';
3
3
  export declare const pkg: any, configWithCases: any, timeout: (ms: number) => Promise<unknown>;
4
4
  export declare let screenshot: any;
5
5
  /**
@@ -17,6 +17,6 @@ export declare let screenshot: any;
17
17
  * ...
18
18
  * })....
19
19
  * ```
20
- * @param config ConfigObject] The extended custom configuration
20
+ * @param config AdvancedConfig The extended custom configuration
21
21
  */
22
- export declare function create(config?: ConfigObject): Promise<Client>;
22
+ export declare function create(config?: AdvancedConfig | ConfigObject): Promise<Client>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate-types-only",
3
- "version": "4.38.1",
3
+ "version": "4.40.1",
4
4
  "description": "Types generated from the @open-wa/wa-automate package",
5
5
  "scripts": {
6
6
  "build": "tsc",