@open-wa/wa-automate 4.76.0 → 5.0.0-alpha.2
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/README.md +14 -165
- package/dist/cli-runtime-B7_3MM0c.cjs +798 -0
- package/dist/cli-runtime-B7_3MM0c.cjs.map +1 -0
- package/dist/cli-runtime-CmpYxFCk.d.cts +31 -0
- package/dist/cli-runtime-CmpYxFCk.d.cts.map +1 -0
- package/dist/cli.cjs +17 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +2 -0
- package/dist/index.cjs +224 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +81 -0
- package/dist/index.d.cts.map +1 -0
- package/package.json +34 -177
- package/CNAME +0 -1
- package/_tsconfig.docs.json +0 -140
- package/bin/config-schema.json +0 -1
- package/bin/oas-type-schemas.json +0 -1
- package/bin/server.js +0 -45
- package/build/build-config-json-for-bin.ts +0 -56
- package/build/generate-oas-types.ts +0 -31
- package/dist/api/Client.d.ts +0 -2255
- package/dist/api/Client.js +0 -4358
- package/dist/api/functions/exposed.enum.d.ts +0 -7
- package/dist/api/functions/exposed.enum.js +0 -11
- package/dist/api/model/aliases.d.ts +0 -110
- package/dist/api/model/aliases.js +0 -3
- package/dist/api/model/button.d.ts +0 -24
- package/dist/api/model/button.js +0 -2
- package/dist/api/model/call.d.ts +0 -51
- package/dist/api/model/call.js +0 -18
- package/dist/api/model/chat.d.ts +0 -221
- package/dist/api/model/chat.js +0 -52
- package/dist/api/model/config.d.ts +0 -836
- package/dist/api/model/config.js +0 -111
- package/dist/api/model/contact.d.ts +0 -143
- package/dist/api/model/contact.js +0 -2
- package/dist/api/model/errors.d.ts +0 -90
- package/dist/api/model/errors.js +0 -117
- package/dist/api/model/events.d.ts +0 -120
- package/dist/api/model/events.js +0 -127
- package/dist/api/model/group-metadata.d.ts +0 -124
- package/dist/api/model/group-metadata.js +0 -25
- package/dist/api/model/id.d.ts +0 -5
- package/dist/api/model/id.js +0 -2
- package/dist/api/model/index.d.ts +0 -110
- package/dist/api/model/index.js +0 -128
- package/dist/api/model/label.d.ts +0 -24
- package/dist/api/model/label.js +0 -2
- package/dist/api/model/media.d.ts +0 -93
- package/dist/api/model/media.js +0 -12
- package/dist/api/model/message.d.ts +0 -422
- package/dist/api/model/message.js +0 -40
- package/dist/api/model/product.d.ts +0 -141
- package/dist/api/model/product.js +0 -2
- package/dist/api/model/reactions.d.ts +0 -76
- package/dist/api/model/reactions.js +0 -2
- package/dist/api/model/sessionInfo.d.ts +0 -77
- package/dist/api/model/sessionInfo.js +0 -2
- package/dist/build/build-postman.d.ts +0 -1
- package/dist/build/build-postman.js +0 -262
- package/dist/cli/cli-options.d.ts +0 -9
- package/dist/cli/cli-options.js +0 -289
- package/dist/cli/collections.d.ts +0 -2
- package/dist/cli/collections.js +0 -251
- package/dist/cli/file-utils.d.ts +0 -1
- package/dist/cli/file-utils.js +0 -71
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +0 -231
- package/dist/cli/integrations/chatwoot.d.ts +0 -49
- package/dist/cli/integrations/chatwoot.js +0 -672
- package/dist/cli/integrations/cloudflare.d.ts +0 -6
- package/dist/cli/integrations/cloudflare.js +0 -76
- package/dist/cli/logo.d.ts +0 -1
- package/dist/cli/logo.js +0 -49
- package/dist/cli/server.d.ts +0 -24
- package/dist/cli/server.js +0 -540
- package/dist/cli/setup.d.ts +0 -30
- package/dist/cli/setup.js +0 -308
- package/dist/config/puppeteer.config.d.ts +0 -11
- package/dist/config/puppeteer.config.js +0 -65
- package/dist/controllers/auth.d.ts +0 -36
- package/dist/controllers/auth.js +0 -322
- package/dist/controllers/browser.d.ts +0 -17
- package/dist/controllers/browser.js +0 -603
- package/dist/controllers/events.d.ts +0 -82
- package/dist/controllers/events.js +0 -173
- package/dist/controllers/init_patch.d.ts +0 -13
- package/dist/controllers/init_patch.js +0 -42
- package/dist/controllers/initializer.d.ts +0 -22
- package/dist/controllers/initializer.js +0 -511
- package/dist/controllers/launch_checks.d.ts +0 -8
- package/dist/controllers/launch_checks.js +0 -130
- package/dist/controllers/patch_manager.d.ts +0 -37
- package/dist/controllers/patch_manager.js +0 -231
- package/dist/controllers/popup/index.d.ts +0 -3
- package/dist/controllers/popup/index.html +0 -168
- package/dist/controllers/popup/index.js +0 -148
- package/dist/controllers/script_preloader.d.ts +0 -17
- package/dist/controllers/script_preloader.js +0 -88
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -36
- package/dist/lib/README.md +0 -5
- package/dist/lib/base64.js +0 -1
- package/dist/lib/hash.js +0 -1
- package/dist/lib/jsSha.min.js +0 -1
- package/dist/lib/launch.js +0 -1
- package/dist/lib/qr.min.js +0 -1
- package/dist/lib/wapi.js +0 -2163
- package/dist/logging/custom_transport.d.ts +0 -9
- package/dist/logging/custom_transport.js +0 -35
- package/dist/logging/logging.d.ts +0 -50
- package/dist/logging/logging.js +0 -196
- package/dist/structures/Collector.d.ts +0 -202
- package/dist/structures/Collector.js +0 -391
- package/dist/structures/Dialog.d.ts +0 -55
- package/dist/structures/Dialog.js +0 -21
- package/dist/structures/MessageCollector.d.ts +0 -78
- package/dist/structures/MessageCollector.js +0 -145
- package/dist/structures/preProcessors.d.ts +0 -58
- package/dist/structures/preProcessors.js +0 -181
- package/dist/utils/pid_utils.d.ts +0 -1
- package/dist/utils/pid_utils.js +0 -26
- package/dist/utils/tools.d.ts +0 -152
- package/dist/utils/tools.js +0 -494
- package/tos.md +0 -77
package/dist/api/model/events.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SimpleListener = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* An enum of all the "simple listeners". A simple listener is a listener that just takes one parameter which is the callback function to handle the event.
|
|
6
|
-
*/
|
|
7
|
-
var SimpleListener;
|
|
8
|
-
(function (SimpleListener) {
|
|
9
|
-
/**
|
|
10
|
-
* Represents [[onMessage]]
|
|
11
|
-
*/
|
|
12
|
-
SimpleListener["Message"] = "onMessage";
|
|
13
|
-
/**
|
|
14
|
-
* Represents [[onAnyMessage]]
|
|
15
|
-
*/
|
|
16
|
-
SimpleListener["AnyMessage"] = "onAnyMessage";
|
|
17
|
-
/**
|
|
18
|
-
* Represents [[onMessageDeleted]]
|
|
19
|
-
*/
|
|
20
|
-
SimpleListener["MessageDeleted"] = "onMessageDeleted";
|
|
21
|
-
/**
|
|
22
|
-
* Represents [[onAck]]
|
|
23
|
-
*/
|
|
24
|
-
SimpleListener["Ack"] = "onAck";
|
|
25
|
-
/**
|
|
26
|
-
* Represents [[onAddedToGroup]]
|
|
27
|
-
*/
|
|
28
|
-
SimpleListener["AddedToGroup"] = "onAddedToGroup";
|
|
29
|
-
/**
|
|
30
|
-
* Represents [[onChatDeleted]]
|
|
31
|
-
*/
|
|
32
|
-
SimpleListener["ChatDeleted"] = "onChatDeleted";
|
|
33
|
-
/**
|
|
34
|
-
* Represents [[onBattery]]
|
|
35
|
-
*/
|
|
36
|
-
SimpleListener["Battery"] = "onBattery";
|
|
37
|
-
/**
|
|
38
|
-
* Represents [[onChatOpened]]
|
|
39
|
-
*/
|
|
40
|
-
SimpleListener["ChatOpened"] = "onChatOpened";
|
|
41
|
-
/**
|
|
42
|
-
* Represents [[onIncomingCall]]
|
|
43
|
-
*/
|
|
44
|
-
SimpleListener["IncomingCall"] = "onIncomingCall";
|
|
45
|
-
/**
|
|
46
|
-
* Represents [[onIncomingCall]]
|
|
47
|
-
*/
|
|
48
|
-
SimpleListener["CallState"] = "onCallState";
|
|
49
|
-
/**
|
|
50
|
-
* Represents [[onGlobalParticipantsChanged]]
|
|
51
|
-
*/
|
|
52
|
-
SimpleListener["GlobalParticipantsChanged"] = "onGlobalParticipantsChanged";
|
|
53
|
-
/**
|
|
54
|
-
* Represents [[onGroupApprovalRequest]]
|
|
55
|
-
*/
|
|
56
|
-
SimpleListener["GroupApprovalRequest"] = "onGroupApprovalRequest";
|
|
57
|
-
/**
|
|
58
|
-
* Represents [[onChatState]]
|
|
59
|
-
*/
|
|
60
|
-
SimpleListener["ChatState"] = "onChatState";
|
|
61
|
-
/**
|
|
62
|
-
* Represents [[onLogout]]
|
|
63
|
-
*/
|
|
64
|
-
SimpleListener["Logout"] = "onLogout";
|
|
65
|
-
// Next two require extra params so not available to use via webhook register
|
|
66
|
-
// LiveLocation = 'onLiveLocation',
|
|
67
|
-
// ParticipantsChanged = 'onParticipantsChanged',
|
|
68
|
-
/**
|
|
69
|
-
* Represents [[onPlugged]]
|
|
70
|
-
*/
|
|
71
|
-
SimpleListener["Plugged"] = "onPlugged";
|
|
72
|
-
/**
|
|
73
|
-
* Represents [[onStateChanged]]
|
|
74
|
-
*/
|
|
75
|
-
SimpleListener["StateChanged"] = "onStateChanged";
|
|
76
|
-
/**
|
|
77
|
-
* Represents [[onButton]]
|
|
78
|
-
*/
|
|
79
|
-
SimpleListener["Button"] = "onButton";
|
|
80
|
-
/**
|
|
81
|
-
* Represents [[onButton]]
|
|
82
|
-
*/
|
|
83
|
-
SimpleListener["PollVote"] = "onPollVote";
|
|
84
|
-
/**
|
|
85
|
-
* Represents [[onBroadcast]]
|
|
86
|
-
*/
|
|
87
|
-
SimpleListener["Broadcast"] = "onBroadcast";
|
|
88
|
-
/**
|
|
89
|
-
* Represents [[onLabel]]
|
|
90
|
-
*/
|
|
91
|
-
SimpleListener["Label"] = "onLabel";
|
|
92
|
-
/**
|
|
93
|
-
* Requires licence
|
|
94
|
-
* Represents [[onStory]]
|
|
95
|
-
*/
|
|
96
|
-
SimpleListener["Story"] = "onStory";
|
|
97
|
-
/**
|
|
98
|
-
* Requires licence
|
|
99
|
-
* Represents [[onRemovedFromGroup]]
|
|
100
|
-
*/
|
|
101
|
-
SimpleListener["RemovedFromGroup"] = "onRemovedFromGroup";
|
|
102
|
-
/**
|
|
103
|
-
* Requires licence
|
|
104
|
-
* Represents [[onContactAdded]]
|
|
105
|
-
*/
|
|
106
|
-
SimpleListener["ContactAdded"] = "onContactAdded";
|
|
107
|
-
/**
|
|
108
|
-
* Requires licence
|
|
109
|
-
* Represents [[onContactAdded]]
|
|
110
|
-
*/
|
|
111
|
-
SimpleListener["Order"] = "onOrder";
|
|
112
|
-
/**
|
|
113
|
-
* Requires licence
|
|
114
|
-
* Represents [[onNewProduct]]
|
|
115
|
-
*/
|
|
116
|
-
SimpleListener["NewProduct"] = "onNewProduct";
|
|
117
|
-
/**
|
|
118
|
-
* Requires licence
|
|
119
|
-
* Represents [[onReaction]]
|
|
120
|
-
*/
|
|
121
|
-
SimpleListener["Reaction"] = "onReaction";
|
|
122
|
-
/**
|
|
123
|
-
* Requires licence
|
|
124
|
-
* Represents [[onGroupChange]]
|
|
125
|
-
*/
|
|
126
|
-
SimpleListener["GroupChange"] = "onGroupChange";
|
|
127
|
-
})(SimpleListener = exports.SimpleListener || (exports.SimpleListener = {}));
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { ChatId, ContactId, GroupChatId, NonSerializedId, DataURL, GroupId, MessageId } from './aliases';
|
|
2
|
-
import { Contact } from './contact';
|
|
3
|
-
export interface Participant {
|
|
4
|
-
contact: Contact;
|
|
5
|
-
id: NonSerializedId;
|
|
6
|
-
isAdmin: boolean;
|
|
7
|
-
isSuperAdmin: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface GroupMetadata {
|
|
10
|
-
/**
|
|
11
|
-
* The chat id of the group [[GroupChatId]]
|
|
12
|
-
*/
|
|
13
|
-
id: GroupChatId;
|
|
14
|
-
/**
|
|
15
|
-
* The timestamp of when the group was created
|
|
16
|
-
*/
|
|
17
|
-
creation: number;
|
|
18
|
-
/**
|
|
19
|
-
* The id of the owner of the group [[ContactId]]
|
|
20
|
-
*/
|
|
21
|
-
owner: NonSerializedId;
|
|
22
|
-
/**
|
|
23
|
-
* An array of participants in the group
|
|
24
|
-
*/
|
|
25
|
-
participants: Participant[];
|
|
26
|
-
/**
|
|
27
|
-
* Unknown.
|
|
28
|
-
*/
|
|
29
|
-
pendingParticipants: Participant[];
|
|
30
|
-
/**
|
|
31
|
-
* The description of the group
|
|
32
|
-
*/
|
|
33
|
-
desc?: string;
|
|
34
|
-
/**
|
|
35
|
-
* The account that set the description last.
|
|
36
|
-
*/
|
|
37
|
-
descOwner?: ContactId;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
trusted?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Not sure what this represents
|
|
44
|
-
*/
|
|
45
|
-
suspended?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Not sure what this represents
|
|
48
|
-
*/
|
|
49
|
-
support?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Is this group a parent group (a.k.a community)
|
|
52
|
-
*/
|
|
53
|
-
isParentGroup?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* The type of group
|
|
56
|
-
*/
|
|
57
|
-
groupType: 'DEAFULT' | 'SUBGROUP' | 'COMMUNITY';
|
|
58
|
-
/**
|
|
59
|
-
* Communities have a default group chat
|
|
60
|
-
*/
|
|
61
|
-
defaultSubgroup: boolean;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
isParentGroupClosed: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* List of Group IDs that the host account has joined as part of this community
|
|
68
|
-
*/
|
|
69
|
-
joinedSubgroups: GroupId[];
|
|
70
|
-
}
|
|
71
|
-
export declare enum groupChangeEvent {
|
|
72
|
-
remove = "remove",
|
|
73
|
-
add = "add"
|
|
74
|
-
}
|
|
75
|
-
export interface ParticipantChangedEventModel {
|
|
76
|
-
by: ContactId;
|
|
77
|
-
action: groupChangeEvent;
|
|
78
|
-
who: ContactId[];
|
|
79
|
-
chat: ChatId;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Group notification types
|
|
83
|
-
* @readonly
|
|
84
|
-
* @enum {string}
|
|
85
|
-
*/
|
|
86
|
-
export declare enum GroupNotificationTypes {
|
|
87
|
-
ADD = "add",
|
|
88
|
-
INVITE = "invite",
|
|
89
|
-
REMOVE = "remove",
|
|
90
|
-
LEAVE = "leave",
|
|
91
|
-
SUBJECT = "subject",
|
|
92
|
-
DESCRIPTION = "description",
|
|
93
|
-
PICTURE = "picture",
|
|
94
|
-
ANNOUNCE = "announce",
|
|
95
|
-
RESTRICT = "restrict"
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Used when creating a new community with.
|
|
99
|
-
*/
|
|
100
|
-
export interface NewCommunityGroup {
|
|
101
|
-
subject: string;
|
|
102
|
-
icon?: DataURL;
|
|
103
|
-
ephemeralDuration?: number;
|
|
104
|
-
}
|
|
105
|
-
export interface GenericGroupChangeEvent {
|
|
106
|
-
/**
|
|
107
|
-
* The contact who triggered this event. (E.g the contact who changed the group picture)
|
|
108
|
-
*/
|
|
109
|
-
author: Contact;
|
|
110
|
-
/**
|
|
111
|
-
* Some more information about the event
|
|
112
|
-
*/
|
|
113
|
-
body: string;
|
|
114
|
-
groupMetadata: GroupMetadata;
|
|
115
|
-
/**
|
|
116
|
-
* Base 64 encoded image
|
|
117
|
-
*/
|
|
118
|
-
groupPic: string;
|
|
119
|
-
id: MessageId;
|
|
120
|
-
/**
|
|
121
|
-
* Type of the event
|
|
122
|
-
*/
|
|
123
|
-
type: 'picutre' | 'create' | 'delete' | 'subject' | 'revoke_invite' | 'description' | 'restrict' | 'announce' | 'no_frequently_forwarded' | 'announce_msg_bounce' | 'add' | 'remove' | 'demote' | 'promote' | 'invite' | 'leave' | 'modify' | 'v4_add_invite_sent' | 'v4_add_invite_join' | 'growth_locked' | 'growth_unlocked' | 'linked_group_join';
|
|
124
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GroupNotificationTypes = exports.groupChangeEvent = void 0;
|
|
4
|
-
var groupChangeEvent;
|
|
5
|
-
(function (groupChangeEvent) {
|
|
6
|
-
groupChangeEvent["remove"] = "remove";
|
|
7
|
-
groupChangeEvent["add"] = "add";
|
|
8
|
-
})(groupChangeEvent = exports.groupChangeEvent || (exports.groupChangeEvent = {}));
|
|
9
|
-
/**
|
|
10
|
-
* Group notification types
|
|
11
|
-
* @readonly
|
|
12
|
-
* @enum {string}
|
|
13
|
-
*/
|
|
14
|
-
var GroupNotificationTypes;
|
|
15
|
-
(function (GroupNotificationTypes) {
|
|
16
|
-
GroupNotificationTypes["ADD"] = "add";
|
|
17
|
-
GroupNotificationTypes["INVITE"] = "invite";
|
|
18
|
-
GroupNotificationTypes["REMOVE"] = "remove";
|
|
19
|
-
GroupNotificationTypes["LEAVE"] = "leave";
|
|
20
|
-
GroupNotificationTypes["SUBJECT"] = "subject";
|
|
21
|
-
GroupNotificationTypes["DESCRIPTION"] = "description";
|
|
22
|
-
GroupNotificationTypes["PICTURE"] = "picture";
|
|
23
|
-
GroupNotificationTypes["ANNOUNCE"] = "announce";
|
|
24
|
-
GroupNotificationTypes["RESTRICT"] = "restrict";
|
|
25
|
-
})(GroupNotificationTypes = exports.GroupNotificationTypes || (exports.GroupNotificationTypes = {}));
|
package/dist/api/model/id.d.ts
DELETED
package/dist/api/model/id.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
export * from './chat';
|
|
2
|
-
export * from './call';
|
|
3
|
-
export * from './contact';
|
|
4
|
-
export * from './message';
|
|
5
|
-
export * from './errors';
|
|
6
|
-
export * from './events';
|
|
7
|
-
export * from './product';
|
|
8
|
-
export * from './reactions';
|
|
9
|
-
/**
|
|
10
|
-
* Client status
|
|
11
|
-
* @readonly
|
|
12
|
-
* @enum {number}
|
|
13
|
-
*/
|
|
14
|
-
export declare enum Status {
|
|
15
|
-
INITIALIZING = 0,
|
|
16
|
-
AUTHENTICATING = 1,
|
|
17
|
-
READY = 3
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Events that can be emitted by the client
|
|
21
|
-
* @readonly
|
|
22
|
-
* @enum {string}
|
|
23
|
-
*/
|
|
24
|
-
export declare enum Events {
|
|
25
|
-
AUTHENTICATED = "authenticated",
|
|
26
|
-
AUTHENTICATION_FAILURE = "auth_failure",
|
|
27
|
-
READY = "ready",
|
|
28
|
-
MESSAGE_RECEIVED = "message",
|
|
29
|
-
MESSAGE_CREATE = "message_create",
|
|
30
|
-
MESSAGE_REVOKED_EVERYONE = "message_revoke_everyone",
|
|
31
|
-
MESSAGE_REVOKED_ME = "message_revoke_me",
|
|
32
|
-
MESSAGE_ACK = "message_ack",
|
|
33
|
-
GROUP_JOIN = "group_join",
|
|
34
|
-
GROUP_LEAVE = "group_leave",
|
|
35
|
-
GROUP_UPDATE = "group_update",
|
|
36
|
-
QR_RECEIVED = "qr",
|
|
37
|
-
DISCONNECTED = "disconnected",
|
|
38
|
-
STATE_CHANGED = "change_state"
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* The state of the WA Web session. You can listen to session state changes using [[onStateChanged]]. Just to be clear, some of these states aren't understood completely.
|
|
42
|
-
* @readonly
|
|
43
|
-
* @enum {string}
|
|
44
|
-
*/
|
|
45
|
-
export declare enum STATE {
|
|
46
|
-
/**
|
|
47
|
-
* Another WA web session has been opened for this account somewhere else.
|
|
48
|
-
*/
|
|
49
|
-
CONFLICT = "CONFLICT",
|
|
50
|
-
/**
|
|
51
|
-
* The session is successfully connected and ready to send and receive messages.
|
|
52
|
-
*/
|
|
53
|
-
CONNECTED = "CONNECTED",
|
|
54
|
-
/**
|
|
55
|
-
* WA web updates every fortnight (or so). This state would be emitted then.
|
|
56
|
-
*/
|
|
57
|
-
DEPRECATED_VERSION = "DEPRECATED_VERSION",
|
|
58
|
-
/**
|
|
59
|
-
* This probably shows up when reloading an already authenticated session.
|
|
60
|
-
*/
|
|
61
|
-
OPENING = "OPENING",
|
|
62
|
-
/**
|
|
63
|
-
* This probably shows up immediately after the QR code is scanned
|
|
64
|
-
*/
|
|
65
|
-
PAIRING = "PAIRING",
|
|
66
|
-
/**
|
|
67
|
-
* This state probably represented a block on the proxy address your app is using.
|
|
68
|
-
*/
|
|
69
|
-
PROXYBLOCK = "PROXYBLOCK",
|
|
70
|
-
/**
|
|
71
|
-
* This usually shows up when the session has been blocked by WA due to some issue with the browser/user agent. This is a different version of a Terms of Service Block from what we know. It may also show up when the host account is banned.
|
|
72
|
-
*/
|
|
73
|
-
SMB_TOS_BLOCK = "SMB_TOS_BLOCK",
|
|
74
|
-
/**
|
|
75
|
-
* The trigger for this state is as of yet unknown
|
|
76
|
-
*/
|
|
77
|
-
TIMEOUT = "TIMEOUT",
|
|
78
|
-
/**
|
|
79
|
-
* This usually shows up when the session has been blocked by WA due to some issue with the browser/user agent. It literally stands for Terms of Service Block. It may also show up when the host account is banned.
|
|
80
|
-
*/
|
|
81
|
-
TOS_BLOCK = "TOS_BLOCK",
|
|
82
|
-
/**
|
|
83
|
-
* The same (probably replacement) for CONFLICT
|
|
84
|
-
*/
|
|
85
|
-
UNLAUNCHED = "UNLAUNCHED",
|
|
86
|
-
/**
|
|
87
|
-
* When `UNPAIRED` the page is waiting for a QR Code scan. If your state becomes `UNPAIRED` then the session is most likely signed out by the host account.
|
|
88
|
-
*/
|
|
89
|
-
UNPAIRED = "UNPAIRED",
|
|
90
|
-
/**
|
|
91
|
-
* This state is fired when the QR code has not been scanned for a long time (about 1 minute). On the page it will show "Click to reload QR code"
|
|
92
|
-
*/
|
|
93
|
-
UNPAIRED_IDLE = "UNPAIRED_IDLE",
|
|
94
|
-
/**
|
|
95
|
-
* This is fired when the QR code is scanned
|
|
96
|
-
*/
|
|
97
|
-
SYNCING = "SYNCING",
|
|
98
|
-
/**
|
|
99
|
-
* This is fired when the connection between web and the host account primary device is disconnected. This is fired frequently to save battery.
|
|
100
|
-
*/
|
|
101
|
-
DISCONNECTED = "DISCONNECTED"
|
|
102
|
-
}
|
|
103
|
-
export type EasyApiResponse = {
|
|
104
|
-
success: boolean;
|
|
105
|
-
response: any;
|
|
106
|
-
};
|
|
107
|
-
export * from './config';
|
|
108
|
-
export * from './media';
|
|
109
|
-
export * from './aliases';
|
|
110
|
-
export * from './label';
|
package/dist/api/model/index.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.STATE = exports.Events = exports.Status = void 0;
|
|
18
|
-
__exportStar(require("./chat"), exports);
|
|
19
|
-
__exportStar(require("./call"), exports);
|
|
20
|
-
__exportStar(require("./contact"), exports);
|
|
21
|
-
__exportStar(require("./message"), exports);
|
|
22
|
-
__exportStar(require("./errors"), exports);
|
|
23
|
-
__exportStar(require("./events"), exports);
|
|
24
|
-
__exportStar(require("./product"), exports);
|
|
25
|
-
__exportStar(require("./reactions"), exports);
|
|
26
|
-
/**
|
|
27
|
-
* Client status
|
|
28
|
-
* @readonly
|
|
29
|
-
* @enum {number}
|
|
30
|
-
*/
|
|
31
|
-
var Status;
|
|
32
|
-
(function (Status) {
|
|
33
|
-
Status[Status["INITIALIZING"] = 0] = "INITIALIZING";
|
|
34
|
-
Status[Status["AUTHENTICATING"] = 1] = "AUTHENTICATING";
|
|
35
|
-
Status[Status["READY"] = 3] = "READY";
|
|
36
|
-
})(Status = exports.Status || (exports.Status = {}));
|
|
37
|
-
;
|
|
38
|
-
/**
|
|
39
|
-
* Events that can be emitted by the client
|
|
40
|
-
* @readonly
|
|
41
|
-
* @enum {string}
|
|
42
|
-
*/
|
|
43
|
-
var Events;
|
|
44
|
-
(function (Events) {
|
|
45
|
-
Events["AUTHENTICATED"] = "authenticated";
|
|
46
|
-
Events["AUTHENTICATION_FAILURE"] = "auth_failure";
|
|
47
|
-
Events["READY"] = "ready";
|
|
48
|
-
Events["MESSAGE_RECEIVED"] = "message";
|
|
49
|
-
Events["MESSAGE_CREATE"] = "message_create";
|
|
50
|
-
Events["MESSAGE_REVOKED_EVERYONE"] = "message_revoke_everyone";
|
|
51
|
-
Events["MESSAGE_REVOKED_ME"] = "message_revoke_me";
|
|
52
|
-
Events["MESSAGE_ACK"] = "message_ack";
|
|
53
|
-
Events["GROUP_JOIN"] = "group_join";
|
|
54
|
-
Events["GROUP_LEAVE"] = "group_leave";
|
|
55
|
-
Events["GROUP_UPDATE"] = "group_update";
|
|
56
|
-
Events["QR_RECEIVED"] = "qr";
|
|
57
|
-
Events["DISCONNECTED"] = "disconnected";
|
|
58
|
-
Events["STATE_CHANGED"] = "change_state";
|
|
59
|
-
})(Events = exports.Events || (exports.Events = {}));
|
|
60
|
-
;
|
|
61
|
-
/**
|
|
62
|
-
* The state of the WA Web session. You can listen to session state changes using [[onStateChanged]]. Just to be clear, some of these states aren't understood completely.
|
|
63
|
-
* @readonly
|
|
64
|
-
* @enum {string}
|
|
65
|
-
*/
|
|
66
|
-
var STATE;
|
|
67
|
-
(function (STATE) {
|
|
68
|
-
/**
|
|
69
|
-
* Another WA web session has been opened for this account somewhere else.
|
|
70
|
-
*/
|
|
71
|
-
STATE["CONFLICT"] = "CONFLICT";
|
|
72
|
-
/**
|
|
73
|
-
* The session is successfully connected and ready to send and receive messages.
|
|
74
|
-
*/
|
|
75
|
-
STATE["CONNECTED"] = "CONNECTED";
|
|
76
|
-
/**
|
|
77
|
-
* WA web updates every fortnight (or so). This state would be emitted then.
|
|
78
|
-
*/
|
|
79
|
-
STATE["DEPRECATED_VERSION"] = "DEPRECATED_VERSION";
|
|
80
|
-
/**
|
|
81
|
-
* This probably shows up when reloading an already authenticated session.
|
|
82
|
-
*/
|
|
83
|
-
STATE["OPENING"] = "OPENING";
|
|
84
|
-
/**
|
|
85
|
-
* This probably shows up immediately after the QR code is scanned
|
|
86
|
-
*/
|
|
87
|
-
STATE["PAIRING"] = "PAIRING";
|
|
88
|
-
/**
|
|
89
|
-
* This state probably represented a block on the proxy address your app is using.
|
|
90
|
-
*/
|
|
91
|
-
STATE["PROXYBLOCK"] = "PROXYBLOCK";
|
|
92
|
-
/**
|
|
93
|
-
* This usually shows up when the session has been blocked by WA due to some issue with the browser/user agent. This is a different version of a Terms of Service Block from what we know. It may also show up when the host account is banned.
|
|
94
|
-
*/
|
|
95
|
-
STATE["SMB_TOS_BLOCK"] = "SMB_TOS_BLOCK";
|
|
96
|
-
/**
|
|
97
|
-
* The trigger for this state is as of yet unknown
|
|
98
|
-
*/
|
|
99
|
-
STATE["TIMEOUT"] = "TIMEOUT";
|
|
100
|
-
/**
|
|
101
|
-
* This usually shows up when the session has been blocked by WA due to some issue with the browser/user agent. It literally stands for Terms of Service Block. It may also show up when the host account is banned.
|
|
102
|
-
*/
|
|
103
|
-
STATE["TOS_BLOCK"] = "TOS_BLOCK";
|
|
104
|
-
/**
|
|
105
|
-
* The same (probably replacement) for CONFLICT
|
|
106
|
-
*/
|
|
107
|
-
STATE["UNLAUNCHED"] = "UNLAUNCHED";
|
|
108
|
-
/**
|
|
109
|
-
* When `UNPAIRED` the page is waiting for a QR Code scan. If your state becomes `UNPAIRED` then the session is most likely signed out by the host account.
|
|
110
|
-
*/
|
|
111
|
-
STATE["UNPAIRED"] = "UNPAIRED";
|
|
112
|
-
/**
|
|
113
|
-
* This state is fired when the QR code has not been scanned for a long time (about 1 minute). On the page it will show "Click to reload QR code"
|
|
114
|
-
*/
|
|
115
|
-
STATE["UNPAIRED_IDLE"] = "UNPAIRED_IDLE";
|
|
116
|
-
/**
|
|
117
|
-
* This is fired when the QR code is scanned
|
|
118
|
-
*/
|
|
119
|
-
STATE["SYNCING"] = "SYNCING";
|
|
120
|
-
/**
|
|
121
|
-
* This is fired when the connection between web and the host account primary device is disconnected. This is fired frequently to save battery.
|
|
122
|
-
*/
|
|
123
|
-
STATE["DISCONNECTED"] = "DISCONNECTED";
|
|
124
|
-
})(STATE = exports.STATE || (exports.STATE = {}));
|
|
125
|
-
__exportStar(require("./config"), exports);
|
|
126
|
-
__exportStar(require("./media"), exports);
|
|
127
|
-
__exportStar(require("./aliases"), exports);
|
|
128
|
-
__exportStar(require("./label"), exports);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ContactId, ChatId, MessageId } from "./aliases";
|
|
2
|
-
export interface Label {
|
|
3
|
-
/**
|
|
4
|
-
* The internal ID of the label. Usually a number represented as a string e.g "1"
|
|
5
|
-
*/
|
|
6
|
-
id: string;
|
|
7
|
-
/**
|
|
8
|
-
* The text contents of the label
|
|
9
|
-
*/
|
|
10
|
-
name: string;
|
|
11
|
-
/**
|
|
12
|
-
* The items that are tagged with this label
|
|
13
|
-
*/
|
|
14
|
-
items: {
|
|
15
|
-
/**
|
|
16
|
-
* Labels can be applied to chats, contacts or individual messages. This represents the type of object the label is attached to.
|
|
17
|
-
*/
|
|
18
|
-
type: "Chat" | "Contact" | "Message";
|
|
19
|
-
/**
|
|
20
|
-
* The ID of the object that the label is atteched to.
|
|
21
|
-
*/
|
|
22
|
-
id: ContactId | ChatId | MessageId;
|
|
23
|
-
}[];
|
|
24
|
-
}
|
package/dist/api/model/label.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
export type StickerMetadata = {
|
|
2
|
-
/**
|
|
3
|
-
* The author of the sticker
|
|
4
|
-
* @default ``
|
|
5
|
-
*/
|
|
6
|
-
author: string;
|
|
7
|
-
/**
|
|
8
|
-
* The pack of the sticker
|
|
9
|
-
* @default ``
|
|
10
|
-
*/
|
|
11
|
-
pack: string;
|
|
12
|
-
/**
|
|
13
|
-
* ALPHA FEATURE - NO GUARANTEES IT WILL WORK AS EXPECTED:
|
|
14
|
-
*
|
|
15
|
-
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
|
16
|
-
*
|
|
17
|
-
* Attempt to remove the background of the sticker. Only valid for paid licenses.
|
|
18
|
-
*
|
|
19
|
-
* options:
|
|
20
|
-
*
|
|
21
|
-
* `true` - remove background after resizing
|
|
22
|
-
*
|
|
23
|
-
* `HQ` - remove background before resizing (i.e on original photo)
|
|
24
|
-
* @default `false`
|
|
25
|
-
*/
|
|
26
|
-
removebg?: boolean | 'HQ';
|
|
27
|
-
/**
|
|
28
|
-
* Setting this to `true` will skip the resizing/square-cropping of the sticker. It will instead 'letterbox' the image with a transparent background.
|
|
29
|
-
*/
|
|
30
|
-
keepScale?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Applies a circular mask to the sticker. Works on images only for now.
|
|
33
|
-
*/
|
|
34
|
-
circle?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Your Discord ID to get onto the sticker leaderboard!
|
|
37
|
-
*/
|
|
38
|
-
discord?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Crop position
|
|
41
|
-
*
|
|
42
|
-
* Learn more: https://sharp.pixelplumbing.com/api-resize
|
|
43
|
-
*
|
|
44
|
-
* @default `attention`
|
|
45
|
-
*/
|
|
46
|
-
cropPosition?: 'top' | 'right top' | 'right' | 'right bottom' | 'bottom' | 'left bottom' | 'left' | 'left top' | 'north' | 'northeast' | 'east' | 'southeast' | 'south' | 'southwest' | 'west' | 'northwest' | 'center' | 'centre' | 'entropy' | 'attention';
|
|
47
|
-
/**
|
|
48
|
-
* The corner radius of the sticker when `stickerMetadata.circle` is set to true.
|
|
49
|
-
* @default `100`
|
|
50
|
-
* @minimum `1`
|
|
51
|
-
* @maximum `100`
|
|
52
|
-
* @multipleOf `1`
|
|
53
|
-
*/
|
|
54
|
-
cornerRadius?: number;
|
|
55
|
-
};
|
|
56
|
-
export type Mp4StickerConversionProcessOptions = {
|
|
57
|
-
/**
|
|
58
|
-
* Desired Frames per second of the sticker output
|
|
59
|
-
* @default `10`
|
|
60
|
-
*/
|
|
61
|
-
fps?: number;
|
|
62
|
-
/**
|
|
63
|
-
* The video start time of the sticker
|
|
64
|
-
* @default `00:00:00.0`
|
|
65
|
-
*/
|
|
66
|
-
startTime?: string;
|
|
67
|
-
/**
|
|
68
|
-
* The video end time of the sticker. By default, stickers are made from the first 5 seconds of the video
|
|
69
|
-
* @default `00:00:05.0`
|
|
70
|
-
*/
|
|
71
|
-
endTime?: string;
|
|
72
|
-
/**
|
|
73
|
-
* The amount of times the video loops in the sticker. To save processing time, leave this as 0
|
|
74
|
-
* default `0`
|
|
75
|
-
*/
|
|
76
|
-
loop?: number;
|
|
77
|
-
/**
|
|
78
|
-
* Centres and crops the video.
|
|
79
|
-
* default `true`
|
|
80
|
-
*/
|
|
81
|
-
crop?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Prints ffmpeg logs in the terminal
|
|
84
|
-
* @default `false`
|
|
85
|
-
*/
|
|
86
|
-
log?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* A number representing the WxH of the output sticker (default `512x512`). Lowering this number is a great way to process longer duration stickers. The max value is `512`.
|
|
89
|
-
* default `512`
|
|
90
|
-
*/
|
|
91
|
-
square?: number;
|
|
92
|
-
};
|
|
93
|
-
export declare const defaultProcessOptions: Mp4StickerConversionProcessOptions;
|
package/dist/api/model/media.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultProcessOptions = void 0;
|
|
4
|
-
exports.defaultProcessOptions = {
|
|
5
|
-
fps: 10,
|
|
6
|
-
startTime: `00:00:00.0`,
|
|
7
|
-
endTime: `00:00:05.0`,
|
|
8
|
-
loop: 0,
|
|
9
|
-
crop: true,
|
|
10
|
-
log: false,
|
|
11
|
-
square: 512
|
|
12
|
-
};
|