cmd-control-client-lib 3.0.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.
- package/.arcconfig +4 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +65 -0
- package/.husky/pre-commit +5 -0
- package/README.md +35 -0
- package/dist/@types/enum-boolean-digitized.d.ts +4 -0
- package/dist/@types/enum-boolean-stringified-extended.d.ts +6 -0
- package/dist/@types/enum-boolean-stringified.d.ts +4 -0
- package/dist/@types/enum-channel-flags.d.ts +14 -0
- package/dist/@types/enum-currency.d.ts +5 -0
- package/dist/@types/enum-status-type.d.ts +15 -0
- package/dist/@types/icurrency-description.d.ts +5 -0
- package/dist/@types/iemoji.d.ts +4 -0
- package/dist/@types/index.d.ts +9 -0
- package/dist/@types/json-stringified.d.ts +8 -0
- package/dist/cmd-connection.d.ts +71 -0
- package/dist/cmd-control-client-lib.js +2 -0
- package/dist/cmd-control-client-lib.js.map +1 -0
- package/dist/cmd-control-lib.d.ts +5 -0
- package/dist/cmd-protocol.d.ts +35 -0
- package/dist/cmd-session.d.ts +15 -0
- package/dist/logger.d.ts +28 -0
- package/dist/protocol/b2b/b2bcontact.d.ts +58 -0
- package/dist/protocol/b2b/b2buserinfo.d.ts +106 -0
- package/dist/protocol/backend.d.ts +48 -0
- package/dist/protocol/channel.d.ts +341 -0
- package/dist/protocol/channelinfo.d.ts +98 -0
- package/dist/protocol/chatstate.d.ts +42 -0
- package/dist/protocol/command/action.d.ts +116 -0
- package/dist/protocol/command/baseparams.d.ts +40 -0
- package/dist/protocol/command/icommand.d.ts +61 -0
- package/dist/protocol/command/resultcode.d.ts +44 -0
- package/dist/protocol/connection.d.ts +16 -0
- package/dist/protocol/contactnote.d.ts +62 -0
- package/dist/protocol/gifts.d.ts +19 -0
- package/dist/protocol/init.d.ts +64 -0
- package/dist/protocol/live/devicestatus.d.ts +30 -0
- package/dist/protocol/live/live-commands.d.ts +386 -0
- package/dist/protocol/live/login.d.ts +14 -0
- package/dist/protocol/live/onlinesummary.d.ts +21 -0
- package/dist/protocol/live/products-config.d.ts +19 -0
- package/dist/protocol/live/streamstate.d.ts +25 -0
- package/dist/protocol/live/supdate.d.ts +34 -0
- package/dist/protocol/live/usersettings.d.ts +40 -0
- package/dist/protocol/lobby.d.ts +37 -0
- package/dist/protocol/login.d.ts +57 -0
- package/dist/protocol/logout.d.ts +22 -0
- package/dist/protocol/mediaoffer.d.ts +48 -0
- package/dist/protocol/mediapurchase.d.ts +49 -0
- package/dist/protocol/mediaupload.d.ts +86 -0
- package/dist/protocol/message.d.ts +184 -0
- package/dist/protocol/messenger/expo.d.ts +19 -0
- package/dist/protocol/noop.d.ts +14 -0
- package/dist/protocol/onlinestate.d.ts +74 -0
- package/dist/protocol/sessionstate.d.ts +74 -0
- package/dist/protocol/systemmessagekey.d.ts +157 -0
- package/dist/protocol/toy.d.ts +60 -0
- package/dist/protocol/unused.d.ts +26 -0
- package/dist/protocol/update-state.d.ts +11 -0
- package/dist/version.d.ts +1 -0
- package/package.json +88 -0
- package/test/.eslintrc.js +12 -0
- package/test/json-stringified.spec.ts +11 -0
- package/test/result.spec.ts +18 -0
- package/test/session-state.spec.ts +23 -0
- package/workspace.code-workspace +13 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { EnumBooleanStringified, JSONString } from "../../@types";
|
|
2
|
+
import { EnumProductId, usrKeyType } from "../channel";
|
|
3
|
+
import { ACTION } from "../command/action";
|
|
4
|
+
import { baseParamsType } from "../command/baseparams";
|
|
5
|
+
import { ICOMMAND, IKeyMaybeValue, IKeyValue, IRESPONSE, RESULT } from "../command/icommand";
|
|
6
|
+
/**
|
|
7
|
+
* user information and abilities
|
|
8
|
+
*/
|
|
9
|
+
interface IUserInfo extends IKeyValue {
|
|
10
|
+
/** product id readonly*/
|
|
11
|
+
productId?: EnumProductId;
|
|
12
|
+
/** user Login/Name to show */
|
|
13
|
+
ualias?: string;
|
|
14
|
+
/** user language, 2-symbol code lower case. "de", "en" */
|
|
15
|
+
language?: string;
|
|
16
|
+
/** avatar url */
|
|
17
|
+
imgSrc?: string;
|
|
18
|
+
/** avatar url sourceSet, ignored in SET-Commands */
|
|
19
|
+
imgSrcSet?: string;
|
|
20
|
+
/** any json encoded string for client software */
|
|
21
|
+
payload?: JSONString<unknown>;
|
|
22
|
+
/** age verification status */
|
|
23
|
+
avs?: EnumBooleanStringified;
|
|
24
|
+
/** abilities */
|
|
25
|
+
canSendMessage?: EnumBooleanStringified;
|
|
26
|
+
canReceiveMessage?: EnumBooleanStringified;
|
|
27
|
+
canSendImage?: EnumBooleanStringified;
|
|
28
|
+
canReceiveImage?: EnumBooleanStringified;
|
|
29
|
+
canSendAudio?: EnumBooleanStringified;
|
|
30
|
+
canReceiveAudio?: EnumBooleanStringified;
|
|
31
|
+
canSendVideo?: EnumBooleanStringified;
|
|
32
|
+
canReceiveVideo?: EnumBooleanStringified;
|
|
33
|
+
canOfferMedia?: EnumBooleanStringified;
|
|
34
|
+
canPurchaseMedia?: EnumBooleanStringified;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* product "VOne" extra information and abilities
|
|
38
|
+
*/
|
|
39
|
+
export interface IUserInfoVOne extends IUserInfo {
|
|
40
|
+
isVIP?: EnumBooleanStringified;
|
|
41
|
+
canCall0900?: EnumBooleanStringified;
|
|
42
|
+
canSingleSession?: EnumBooleanStringified;
|
|
43
|
+
canBuyShopContent: EnumBooleanStringified;
|
|
44
|
+
canBeDiscounted: EnumBooleanStringified;
|
|
45
|
+
canSendGifts: EnumBooleanStringified;
|
|
46
|
+
canControlToy: EnumBooleanStringified;
|
|
47
|
+
canBeBan: EnumBooleanStringified;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* B2B basic user information
|
|
51
|
+
*/
|
|
52
|
+
export declare type IB2BUserInfo = IUserInfo;
|
|
53
|
+
/**
|
|
54
|
+
* B2B Vone user information
|
|
55
|
+
*/
|
|
56
|
+
export declare type IB2BUserInfoVOne = IUserInfoVOne;
|
|
57
|
+
/**
|
|
58
|
+
* user information transport object
|
|
59
|
+
*/
|
|
60
|
+
export declare class CMDC_USERINFO implements ICOMMAND {
|
|
61
|
+
action: ACTION;
|
|
62
|
+
params: {
|
|
63
|
+
usrId: string;
|
|
64
|
+
usrKey: string;
|
|
65
|
+
} & (IB2BUserInfo | IB2BUserInfoVOne);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* B2B only
|
|
69
|
+
* Create/Update user information in messenger system
|
|
70
|
+
*/
|
|
71
|
+
export declare class CMDP_SETUSERINFO implements ICOMMAND {
|
|
72
|
+
action: ACTION;
|
|
73
|
+
params: baseParamsType & usrKeyType & (IUserInfo | IUserInfoVOne);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Response for CMDP_SETUSERINFO
|
|
77
|
+
*/
|
|
78
|
+
export declare class CMDP_SETUSERINFO_RESPONSE extends CMDP_SETUSERINFO implements IRESPONSE {
|
|
79
|
+
result: RESULT;
|
|
80
|
+
/** unused */
|
|
81
|
+
values: IKeyMaybeValue;
|
|
82
|
+
/** unused */
|
|
83
|
+
commands: ICOMMAND[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* B2B only
|
|
87
|
+
* Get user information in messenger system
|
|
88
|
+
*/
|
|
89
|
+
export declare class CMDP_GETUSERINFO implements ICOMMAND {
|
|
90
|
+
action: ACTION;
|
|
91
|
+
params: baseParamsType & {
|
|
92
|
+
/** userKey */
|
|
93
|
+
usrKey: string;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Response CMDP_GETUSERINFO
|
|
98
|
+
*/
|
|
99
|
+
export declare class CMDP_GETUSERINFO_RESPONSE extends CMDP_GETUSERINFO implements IRESPONSE {
|
|
100
|
+
result: RESULT;
|
|
101
|
+
/** unused */
|
|
102
|
+
values: IKeyMaybeValue;
|
|
103
|
+
/** user info */
|
|
104
|
+
commands: CMDC_USERINFO[];
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { JSONString } from "../@types";
|
|
2
|
+
import { IMayHaveChannelId, usrKeyType } from "./channel";
|
|
3
|
+
import { ACTION } from "./command/action";
|
|
4
|
+
import { baseParamsType } from "./command/baseparams";
|
|
5
|
+
import { ICOMMAND, IKeyMaybeValue, IRESPONSE, RESULT } from "./command/icommand";
|
|
6
|
+
export interface IBackEndPayload {
|
|
7
|
+
type: any;
|
|
8
|
+
data: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* payload for transport to backend and from backend to client
|
|
12
|
+
*/
|
|
13
|
+
export interface IBACKENDPAYLOAD {
|
|
14
|
+
payload?: unknown;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* common command for take a backend action
|
|
18
|
+
*/
|
|
19
|
+
export declare class CMDP_QUERYBACKEND implements ICOMMAND, IBACKENDPAYLOAD {
|
|
20
|
+
action: ACTION;
|
|
21
|
+
params: baseParamsType;
|
|
22
|
+
/** if jwt-session, any json-payload for transport to backend */
|
|
23
|
+
payload?: JSONString<any>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* response CMDP_QUERYBACKEND
|
|
27
|
+
*/
|
|
28
|
+
export declare class CMDP_QUERYBACKEND_RESPONSE extends CMDP_QUERYBACKEND implements IRESPONSE, IBACKENDPAYLOAD {
|
|
29
|
+
result: RESULT;
|
|
30
|
+
commands: ICOMMAND[];
|
|
31
|
+
values: IKeyMaybeValue;
|
|
32
|
+
/** if jwt-session, any json-payload for transport to to client */
|
|
33
|
+
payload?: JSONString<any>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* the update commando from backend over B2B-connection to client for channel
|
|
37
|
+
*/
|
|
38
|
+
export declare class CMDC_BACKENDPAYLOAD implements ICOMMAND, IBACKENDPAYLOAD {
|
|
39
|
+
action: ACTION;
|
|
40
|
+
params: IMayHaveChannelId & usrKeyType & IKeyMaybeValue;
|
|
41
|
+
payload?: IBackEndPayload;
|
|
42
|
+
}
|
|
43
|
+
/** the b2b command for publish of CMDC_BACKENDPAYLOAD */
|
|
44
|
+
export declare class CMDP_BACKENDPAYLOAD implements ICOMMAND, IBACKENDPAYLOAD {
|
|
45
|
+
action: ACTION;
|
|
46
|
+
params: IMayHaveChannelId & usrKeyType & IKeyMaybeValue;
|
|
47
|
+
payload?: IBackEndPayload;
|
|
48
|
+
}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { ComaSeparatedValues } from "./sessionstate";
|
|
2
|
+
import { chatIdType } from "./chatstate";
|
|
3
|
+
import { EnumChannelFlags, EnumBooleanStringified, EnumBooleanStringifiedExtended } from "../@types";
|
|
4
|
+
import { IBACKENDPAYLOAD } from "./backend";
|
|
5
|
+
import { ACTION } from "./command/action";
|
|
6
|
+
import { baseParamsType } from "./command/baseparams";
|
|
7
|
+
import { ICOMMAND, IKeyMaybeValue, IKeyValue, IRESPONSE, RESULT, StringBasedType } from "./command/icommand";
|
|
8
|
+
import { CMDC_CMSG } from "./message";
|
|
9
|
+
import { IB2BUserInfo, IB2BUserInfoVOne } from "./b2b/b2buserinfo";
|
|
10
|
+
/**
|
|
11
|
+
* channelId has Format "usrId.usrKey-partnerId.partnerKey"
|
|
12
|
+
* userPoolId - business id in messenger system, number\{10,0\}
|
|
13
|
+
* usrKey - key of your customer in your sytem, string(36 bytes), "." and "-" are not allowed
|
|
14
|
+
* partnerId - userPoolId of your partner in messenger system, number\{10,0\}
|
|
15
|
+
* partnerKey - key of partner customer, string(36 bytes), "." and "-" are not allowed
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Type that definitely has `channelId` field
|
|
19
|
+
*/
|
|
20
|
+
export declare type channelIdType = {
|
|
21
|
+
channelId: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Type that may or may not have `channelId` field
|
|
25
|
+
*/
|
|
26
|
+
export interface IMayHaveChannelId {
|
|
27
|
+
channelId?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare type usrKeyType = {
|
|
30
|
+
/** key of your customer. obligatory param for b2b session */
|
|
31
|
+
usrKey?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare type partnerIdKeyType = {
|
|
34
|
+
/** id of your business partner in messenger system */
|
|
35
|
+
partnerId: string;
|
|
36
|
+
/** key of partners customer */
|
|
37
|
+
partnerKey: string;
|
|
38
|
+
};
|
|
39
|
+
/** mind one of both, please */
|
|
40
|
+
export declare type channelIdOrChatId = channelIdType | chatIdType;
|
|
41
|
+
/**
|
|
42
|
+
* channel
|
|
43
|
+
*/
|
|
44
|
+
export declare class ChannelType implements IKeyValue {
|
|
45
|
+
[key: string]: StringBasedType;
|
|
46
|
+
/** channel id */
|
|
47
|
+
channelId: string;
|
|
48
|
+
/** your business usrId in messenger system */
|
|
49
|
+
usrId: string;
|
|
50
|
+
/** the key of your customer */
|
|
51
|
+
usrKey: string;
|
|
52
|
+
/** id of your business partner in messenger system */
|
|
53
|
+
partnerId: string;
|
|
54
|
+
/** key of partner customer */
|
|
55
|
+
partnerKey: string;
|
|
56
|
+
/** time of last incoming message */
|
|
57
|
+
lastTimeIn: string;
|
|
58
|
+
/** time of last outgoing message */
|
|
59
|
+
lastTimeOut: string;
|
|
60
|
+
/** number of unseen messages */
|
|
61
|
+
unseen: string;
|
|
62
|
+
/** update spam serial */
|
|
63
|
+
serial: string;
|
|
64
|
+
/** @see EnumChannelFlags */
|
|
65
|
+
flags?: ComaSeparatedValues<EnumChannelFlags> | EnumChannelFlags;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* the command for delivery channel info
|
|
69
|
+
*/
|
|
70
|
+
export declare class CMDC_CHANNEL implements ICOMMAND {
|
|
71
|
+
action: ACTION;
|
|
72
|
+
params: ChannelType;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* create new channel. the channel must be created before send of message
|
|
76
|
+
*/
|
|
77
|
+
export declare class CMDP_NEWCHANNEL implements ICOMMAND {
|
|
78
|
+
action: ACTION;
|
|
79
|
+
params: baseParamsType & usrKeyType & partnerIdKeyType & (IB2BUserInfo | IB2BUserInfoVOne);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* response for CMDP_NEWCHANNEL
|
|
83
|
+
*/
|
|
84
|
+
export declare class CMDP_NEWCHANNEL_RESPONSE extends CMDP_NEWCHANNEL implements IRESPONSE {
|
|
85
|
+
result: RESULT;
|
|
86
|
+
/** the created channel */
|
|
87
|
+
commands: CMDC_CHANNEL[];
|
|
88
|
+
/** deprecated. the created channel, values is ChannelType */
|
|
89
|
+
values: ChannelType;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get the ChannelInfo. this command works with channelId and will be reflected to backend.
|
|
93
|
+
*/
|
|
94
|
+
export declare class CMDP_GETCHANNEL implements ICOMMAND, IBACKENDPAYLOAD {
|
|
95
|
+
action: ACTION;
|
|
96
|
+
params: baseParamsType & channelIdType;
|
|
97
|
+
payload?: unknown;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* response for CMDP_GETCHANNEL
|
|
101
|
+
*/
|
|
102
|
+
export declare class CMDP_GETCHANNEL_RESPONSE extends CMDP_GETCHANNEL implements IRESPONSE, IBACKENDPAYLOAD {
|
|
103
|
+
result: RESULT;
|
|
104
|
+
/** the channel info */
|
|
105
|
+
commands: CMDC_CHANNEL[];
|
|
106
|
+
/** unused, empty */
|
|
107
|
+
values: IKeyMaybeValue;
|
|
108
|
+
/** the backend info to the channel */
|
|
109
|
+
payload?: unknown;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 8320 only.
|
|
113
|
+
*/
|
|
114
|
+
export declare class CMDP_SGETCHANNEL extends CMDP_GETCHANNEL {
|
|
115
|
+
action: ACTION;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 8320 only
|
|
119
|
+
*/
|
|
120
|
+
export declare class CMDP_SGETCHANNEL_RESPONSE extends CMDP_SGETCHANNEL {
|
|
121
|
+
action: ACTION;
|
|
122
|
+
}
|
|
123
|
+
export declare enum EnumSortOrder {
|
|
124
|
+
ASC = "ASC",
|
|
125
|
+
DESC = "DESC"
|
|
126
|
+
}
|
|
127
|
+
export declare enum EnumChannelFilterValues {
|
|
128
|
+
ANY = "any",
|
|
129
|
+
ONLY = "only",
|
|
130
|
+
EXCLUDE = "exclude"
|
|
131
|
+
}
|
|
132
|
+
export declare enum EnumProductId {
|
|
133
|
+
Default = "1",
|
|
134
|
+
PAGES = "2",
|
|
135
|
+
PARTNER = "3",
|
|
136
|
+
TV = "4"
|
|
137
|
+
}
|
|
138
|
+
export declare type getChannelsParamsType = {
|
|
139
|
+
/** from serial, default = 0 */
|
|
140
|
+
serial?: string;
|
|
141
|
+
/** limit, default is 1000 */
|
|
142
|
+
limit?: string;
|
|
143
|
+
/** get CMDC_CONTACTNOTE in commands, default 0, deprecated */
|
|
144
|
+
contactNote?: EnumBooleanStringifiedExtended;
|
|
145
|
+
/** get CMDC_CONTACTINFO in commands, default 0, allowed for b2b session only */
|
|
146
|
+
contactInfo?: EnumBooleanStringifiedExtended;
|
|
147
|
+
/** get CMDC_CHANNELINFO in commands, default 0 */
|
|
148
|
+
channelInfo?: EnumBooleanStringifiedExtended;
|
|
149
|
+
/** get CMDC_ONLINESTATE in commands */
|
|
150
|
+
onlineState?: EnumBooleanStringifiedExtended;
|
|
151
|
+
/** search for contact-name, default empty */
|
|
152
|
+
contactSearch?: string;
|
|
153
|
+
sort: EnumSortOrder;
|
|
154
|
+
/** filter channels without incoming messages, default any */
|
|
155
|
+
filterEmptyIn?: EnumChannelFilterValues;
|
|
156
|
+
/** filter channels without outgoing messages, default any */
|
|
157
|
+
filterEmptyOut?: EnumChannelFilterValues;
|
|
158
|
+
/** filter archived channels, default any */
|
|
159
|
+
filterArchived?: EnumChannelFilterValues;
|
|
160
|
+
/** 8320 only , default any */
|
|
161
|
+
filterAdvertised?: EnumChannelFilterValues;
|
|
162
|
+
/** filter by favorite flag, default any */
|
|
163
|
+
filterRegularCustomer?: EnumChannelFilterValues;
|
|
164
|
+
/** filter by unseen, default any */
|
|
165
|
+
filterUnseen?: EnumChannelFilterValues;
|
|
166
|
+
/** filter by unanswered, default any */
|
|
167
|
+
filterUnAnswered?: EnumChannelFilterValues;
|
|
168
|
+
/** filter by pinned, default any */
|
|
169
|
+
filterPinned?: EnumChannelFilterValues;
|
|
170
|
+
/** filter by muted, default any */
|
|
171
|
+
filterMuted?: EnumChannelFilterValues;
|
|
172
|
+
/** filter by VIP status, default any */
|
|
173
|
+
filterVIP?: EnumChannelFilterValues;
|
|
174
|
+
/** filter by product id, default empty*/
|
|
175
|
+
filterProductId?: EnumProductId;
|
|
176
|
+
/** filter by banned */
|
|
177
|
+
filterBanned?: EnumChannelFilterValues;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Query for ChannelList
|
|
181
|
+
*/
|
|
182
|
+
export declare class CMDP_GETCHANNELS implements ICOMMAND {
|
|
183
|
+
action: ACTION;
|
|
184
|
+
params: baseParamsType & getChannelsParamsType;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Response for CMDP_GETCHANNELS
|
|
188
|
+
*/
|
|
189
|
+
export declare class CMDP_GETCHANNELS_RESPONSE extends CMDP_GETCHANNELS implements IRESPONSE {
|
|
190
|
+
result: RESULT;
|
|
191
|
+
/** channels */
|
|
192
|
+
commands: CMDC_CHANNEL[];
|
|
193
|
+
/** unused */
|
|
194
|
+
values: IKeyMaybeValue;
|
|
195
|
+
}
|
|
196
|
+
/** synonym, 8320 only */
|
|
197
|
+
export declare class CMDP_SGETCHANNELS extends CMDP_GETCHANNELS {
|
|
198
|
+
action: ACTION;
|
|
199
|
+
}
|
|
200
|
+
/** synonym, 8320 only */
|
|
201
|
+
export declare class CMDP_SGETCHANNELS_RESPONSE extends CMDP_GETCHANNELS_RESPONSE {
|
|
202
|
+
action: ACTION;
|
|
203
|
+
}
|
|
204
|
+
/** searchAfter must be used together */
|
|
205
|
+
export declare type IMayHaveSearchAfter = {
|
|
206
|
+
searchAfterTime?: string;
|
|
207
|
+
searchAfterId?: string;
|
|
208
|
+
};
|
|
209
|
+
export declare type getHistoryParamsType = IMayHaveChannelId & IMayHaveSearchAfter & {
|
|
210
|
+
/** number of messages, max & default is 100 */
|
|
211
|
+
limit?: string;
|
|
212
|
+
/** sort by sent, default is DESC */
|
|
213
|
+
sort: EnumSortOrder;
|
|
214
|
+
keys?: EnumBooleanStringifiedExtended;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Get messages history for channel
|
|
218
|
+
* Multichannel command
|
|
219
|
+
*/
|
|
220
|
+
export declare class CMDP_GETHISTORY implements ICOMMAND {
|
|
221
|
+
action: ACTION;
|
|
222
|
+
params: baseParamsType & getHistoryParamsType;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Response for CMDP_GETHISTORY
|
|
226
|
+
*/
|
|
227
|
+
export declare class CMDP_GETHISTORY_RESPONSE extends CMDP_GETHISTORY implements IRESPONSE {
|
|
228
|
+
result: RESULT;
|
|
229
|
+
/** found messages */
|
|
230
|
+
commands: CMDC_CMSG[];
|
|
231
|
+
/** unused */
|
|
232
|
+
values: IKeyMaybeValue;
|
|
233
|
+
}
|
|
234
|
+
export declare type channelSeenParamsType = channelIdType & {
|
|
235
|
+
/** last seen messageId, by default all messages marked as seen */
|
|
236
|
+
messageId?: string;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Mark messages as seen
|
|
240
|
+
*/
|
|
241
|
+
export declare class CMDP_CHANNELSEEN implements ICOMMAND {
|
|
242
|
+
action: ACTION;
|
|
243
|
+
params: baseParamsType & channelSeenParamsType;
|
|
244
|
+
}
|
|
245
|
+
/** alias, 8320 only */
|
|
246
|
+
export declare class CMDP_SCHANNELSEEN extends CMDP_CHANNELSEEN {
|
|
247
|
+
action: ACTION;
|
|
248
|
+
}
|
|
249
|
+
/** alias, 8320 only */
|
|
250
|
+
export declare class CMDP_CHANNELSEEN_RESPONSE extends CMDP_SCHANNELSEEN implements IRESPONSE {
|
|
251
|
+
result: RESULT;
|
|
252
|
+
/** unused */
|
|
253
|
+
commands: ICOMMAND[];
|
|
254
|
+
/** unused */
|
|
255
|
+
values: IKeyMaybeValue;
|
|
256
|
+
}
|
|
257
|
+
/** alias, 8320 only */
|
|
258
|
+
export declare class CMDP_SCHANNELSEEN_RESPONSE extends CMDP_CHANNELSEEN_RESPONSE {
|
|
259
|
+
action: ACTION;
|
|
260
|
+
}
|
|
261
|
+
export declare enum EnumUpdateChannelPropertyName {
|
|
262
|
+
ARCHIVED = "archived",
|
|
263
|
+
REGULAR_CUSTOMER = "regularCustomer",
|
|
264
|
+
UNANSWERED = "unanswered",
|
|
265
|
+
PINNED = "pinned",
|
|
266
|
+
MUTED = "muted",
|
|
267
|
+
BANNED = "banned"
|
|
268
|
+
}
|
|
269
|
+
export declare class updateChannelParamsType implements IKeyMaybeValue {
|
|
270
|
+
[key: string]: string;
|
|
271
|
+
/** flag name */
|
|
272
|
+
propertyName: EnumUpdateChannelPropertyName;
|
|
273
|
+
/** flag value */
|
|
274
|
+
propertyValue: EnumBooleanStringified;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Set Flag on Channel
|
|
278
|
+
* @deprecated use CMDP_SETCHANNELINFO
|
|
279
|
+
*/
|
|
280
|
+
export declare class CMDP_UPDATECHANNEL implements ICOMMAND, IBACKENDPAYLOAD {
|
|
281
|
+
action: ACTION;
|
|
282
|
+
params: baseParamsType & updateChannelParamsType;
|
|
283
|
+
payload?: unknown;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Response for CMDP_UPDATECHANNEL
|
|
287
|
+
*/
|
|
288
|
+
export declare class CMDP_UPDATECHANNEL_RESPONSE extends CMDP_UPDATECHANNEL implements IRESPONSE, IBACKENDPAYLOAD {
|
|
289
|
+
result: RESULT;
|
|
290
|
+
/** unused */
|
|
291
|
+
commands: ICOMMAND[];
|
|
292
|
+
/** unused */
|
|
293
|
+
values: IKeyMaybeValue;
|
|
294
|
+
payload?: unknown;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Query the summary info about all channels
|
|
298
|
+
*/
|
|
299
|
+
export declare class CMDP_CHANNELSSUMMARY implements ICOMMAND {
|
|
300
|
+
action: ACTION;
|
|
301
|
+
params: baseParamsType & usrKeyType;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Response for CMDP_CHANNELSSUMMARY
|
|
305
|
+
*/
|
|
306
|
+
export declare class CMDP_CHANNELSSUMMARY_RESPONSE extends CMDP_CHANNELSSUMMARY implements IRESPONSE {
|
|
307
|
+
result: RESULT;
|
|
308
|
+
/** unused */
|
|
309
|
+
commands: ICOMMAND[];
|
|
310
|
+
/** the summary info */
|
|
311
|
+
values: {
|
|
312
|
+
/** your business id */
|
|
313
|
+
usrId: string;
|
|
314
|
+
/** usrKey of your user */
|
|
315
|
+
usrKey: string;
|
|
316
|
+
/** number of channel */
|
|
317
|
+
channels: string;
|
|
318
|
+
/** number of unseen messages */
|
|
319
|
+
unseen: string;
|
|
320
|
+
/** number of unseen messages */
|
|
321
|
+
unseenWithoutArchived: string;
|
|
322
|
+
/** number of unanswered channels */
|
|
323
|
+
unanswered: string;
|
|
324
|
+
/** last time of incoming message */
|
|
325
|
+
lastTimeIn: string;
|
|
326
|
+
/** last time of outgoing message */
|
|
327
|
+
lastTimeOut: string;
|
|
328
|
+
/** number of archived channels */
|
|
329
|
+
archived: string;
|
|
330
|
+
/** number of advertised channels */
|
|
331
|
+
advertised: string;
|
|
332
|
+
/** number of regular channels */
|
|
333
|
+
regular: string;
|
|
334
|
+
/** number of pinned channels */
|
|
335
|
+
pinned: string;
|
|
336
|
+
/** number of muted channels */
|
|
337
|
+
muted: string;
|
|
338
|
+
/** number of vip channels */
|
|
339
|
+
vip: string;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { EnumBooleanStringified, JSONString } from "../@types";
|
|
2
|
+
import { IBACKENDPAYLOAD } from "./backend";
|
|
3
|
+
import { ACTION } from "./command/action";
|
|
4
|
+
import { baseParamsType } from "./command/baseparams";
|
|
5
|
+
import { ICOMMAND, IKeyMaybeValue, IKeyValue, IRESPONSE, RESULT } from "./command/icommand";
|
|
6
|
+
import { channelIdType, EnumProductId } from "./channel";
|
|
7
|
+
import { IB2BUserInfo, IB2BUserInfoVOne } from "./b2b/b2buserinfo";
|
|
8
|
+
/**
|
|
9
|
+
* product code
|
|
10
|
+
*/
|
|
11
|
+
export interface IProduct {
|
|
12
|
+
productId: EnumProductId;
|
|
13
|
+
}
|
|
14
|
+
export interface IChannelInfoBackEndPayload {
|
|
15
|
+
freeChatDuration: number;
|
|
16
|
+
freeMessagesCount: number;
|
|
17
|
+
messagePrice: number;
|
|
18
|
+
videoChatPrice: number;
|
|
19
|
+
voyeurChatPrice: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* channel information and abilities
|
|
23
|
+
*/
|
|
24
|
+
export interface IChanelInfo extends IKeyMaybeValue {
|
|
25
|
+
canBeArchived?: EnumBooleanStringified;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* User channel information and abilities
|
|
29
|
+
*/
|
|
30
|
+
export interface IChanelInfoV extends IKeyMaybeValue {
|
|
31
|
+
/** the VOne channel(user) was advertised by user, readonly*/
|
|
32
|
+
advertised?: EnumBooleanStringified;
|
|
33
|
+
/** json-encoded string. discount information about video chat discount, readonly */
|
|
34
|
+
discount?: JSONString<any>;
|
|
35
|
+
/** the user follew me (mirrored regularCustomer), readonly */
|
|
36
|
+
followMe: EnumBooleanStringified;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* channel note
|
|
40
|
+
*/
|
|
41
|
+
export default interface IChannelNote extends IKeyValue {
|
|
42
|
+
firstName?: string;
|
|
43
|
+
lastName?: string;
|
|
44
|
+
age?: string;
|
|
45
|
+
city?: string;
|
|
46
|
+
regularCustomer?: string;
|
|
47
|
+
notes?: string;
|
|
48
|
+
note?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ChannelInfo extends channelIdType, Partial<IProduct>, IChanelInfo, IChanelInfoV, Partial<IB2BUserInfoVOne>, IChannelNote {
|
|
51
|
+
}
|
|
52
|
+
export declare type ChannelInfoType = channelIdType & IProduct & IChanelInfo & IChanelInfoV & (IB2BUserInfo | IB2BUserInfoVOne) & IChannelNote;
|
|
53
|
+
/**
|
|
54
|
+
* transport command for channel information
|
|
55
|
+
*/
|
|
56
|
+
export declare class CMDC_CHANNELINFO implements ICOMMAND {
|
|
57
|
+
action: ACTION;
|
|
58
|
+
params: ChannelInfoType;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* get channel information
|
|
62
|
+
*/
|
|
63
|
+
export declare class CMDP_GETCHANNELINFO implements ICOMMAND {
|
|
64
|
+
action: ACTION;
|
|
65
|
+
params: baseParamsType & channelIdType;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Response for CMDP_CHANNELINFO
|
|
69
|
+
*/
|
|
70
|
+
export declare class CMDP_GETCHANNELINFO_RESPONSE extends CMDP_GETCHANNELINFO implements IRESPONSE, IBACKENDPAYLOAD {
|
|
71
|
+
result: RESULT;
|
|
72
|
+
/** ContactInfo */
|
|
73
|
+
commands: CMDC_CHANNELINFO[];
|
|
74
|
+
/** unused */
|
|
75
|
+
values: IKeyMaybeValue;
|
|
76
|
+
/** the backend info for the channel */
|
|
77
|
+
payload?: IChannelInfoBackEndPayload;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* set channel note.
|
|
81
|
+
*/
|
|
82
|
+
export declare class CMDP_SETCHANNELINFO implements ICOMMAND, IBACKENDPAYLOAD {
|
|
83
|
+
action: ACTION;
|
|
84
|
+
params: baseParamsType & channelIdType & IChanelInfoV & IChannelNote;
|
|
85
|
+
/** the backend info for the channel */
|
|
86
|
+
payload?: unknown;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Response for CMDP_SETCHANNELINFO
|
|
90
|
+
*/
|
|
91
|
+
export declare class CMDP_SETCHANNELINFO_RESPONSE extends CMDP_SETCHANNELINFO implements IRESPONSE {
|
|
92
|
+
result: RESULT;
|
|
93
|
+
commands: ICOMMAND[];
|
|
94
|
+
/** unused */
|
|
95
|
+
values: IKeyMaybeValue;
|
|
96
|
+
/** the backend info for the channel */
|
|
97
|
+
payload?: unknown;
|
|
98
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { EnumBooleanDigitized } from "../@types";
|
|
2
|
+
/**
|
|
3
|
+
* Type that definitely has `channelId` field
|
|
4
|
+
*/
|
|
5
|
+
export declare type chatIdType = {
|
|
6
|
+
chatID: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* chat state
|
|
10
|
+
*/
|
|
11
|
+
export declare type ChatState = {
|
|
12
|
+
/** single ability */
|
|
13
|
+
canSingle?: EnumBooleanDigitized;
|
|
14
|
+
/** single status */
|
|
15
|
+
isSingle?: EnumBooleanDigitized;
|
|
16
|
+
/** audio ability */
|
|
17
|
+
hasAudio?: EnumBooleanDigitized;
|
|
18
|
+
/** audio state */
|
|
19
|
+
audioMuted?: EnumBooleanDigitized;
|
|
20
|
+
/** videotime limit */
|
|
21
|
+
videolimit?: string;
|
|
22
|
+
/** videotime limit left */
|
|
23
|
+
videolimit_left?: string;
|
|
24
|
+
/** texttime limit */
|
|
25
|
+
textlimit?: string;
|
|
26
|
+
/** timelimit */
|
|
27
|
+
timelimit?: string;
|
|
28
|
+
/** preview video time limit */
|
|
29
|
+
previewlimit?: string;
|
|
30
|
+
/** HLS is allowed */
|
|
31
|
+
useHLSJS?: EnumBooleanDigitized;
|
|
32
|
+
/** TIP-function ability */
|
|
33
|
+
canTip?: EnumBooleanDigitized;
|
|
34
|
+
/** Preview ability */
|
|
35
|
+
canPreview?: EnumBooleanDigitized;
|
|
36
|
+
/** voyuer into single chat state */
|
|
37
|
+
voyeur2single?: EnumBooleanDigitized;
|
|
38
|
+
/** charge ability */
|
|
39
|
+
canCharge?: EnumBooleanDigitized;
|
|
40
|
+
/** the chat is lobby mass show */
|
|
41
|
+
isLobby?: EnumBooleanDigitized;
|
|
42
|
+
};
|