@communi/chat-api-client-typescript 1.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/LICENSE +20 -0
- package/README.md +3 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +26 -0
- package/src/api-version.d.ts +7 -0
- package/src/api-version.js +1 -0
- package/src/axios.d.ts +28 -0
- package/src/axios.js +1 -0
- package/src/client.d.ts +54 -0
- package/src/client.js +1 -0
- package/src/config/config.d.ts +9 -0
- package/src/config/config.js +1 -0
- package/src/config/index.d.ts +1 -0
- package/src/config/index.js +1 -0
- package/src/demo.d.ts +1 -0
- package/src/demo.js +1 -0
- package/src/index.d.ts +18 -0
- package/src/index.js +1 -0
- package/src/jwt.d.ts +27 -0
- package/src/jwt.js +1 -0
- package/src/message/index.d.ts +2 -0
- package/src/message/index.js +1 -0
- package/src/message/message.d.ts +43 -0
- package/src/message/message.js +1 -0
- package/src/message/types.d.ts +221 -0
- package/src/message/types.js +1 -0
- package/src/notification/index.d.ts +2 -0
- package/src/notification/index.js +1 -0
- package/src/notification/notification.d.ts +17 -0
- package/src/notification/notification.js +1 -0
- package/src/notification/types.d.ts +13 -0
- package/src/notification/types.js +1 -0
- package/src/preview-link/index.d.ts +2 -0
- package/src/preview-link/index.js +1 -0
- package/src/preview-link/preview-link.d.ts +11 -0
- package/src/preview-link/preview-link.js +1 -0
- package/src/preview-link/types.d.ts +9 -0
- package/src/preview-link/types.js +1 -0
- package/src/search/index.d.ts +2 -0
- package/src/search/index.js +1 -0
- package/src/search/search.d.ts +20 -0
- package/src/search/search.js +1 -0
- package/src/search/types.d.ts +31 -0
- package/src/search/types.js +1 -0
- package/src/session/index.d.ts +2 -0
- package/src/session/index.js +1 -0
- package/src/session/session.d.ts +19 -0
- package/src/session/session.js +1 -0
- package/src/session/types.d.ts +15 -0
- package/src/session/types.js +1 -0
- package/src/sticker/index.d.ts +2 -0
- package/src/sticker/index.js +1 -0
- package/src/sticker/sticker.d.ts +13 -0
- package/src/sticker/sticker.js +1 -0
- package/src/sticker/types.d.ts +18 -0
- package/src/sticker/types.js +1 -0
- package/src/super-groups/index.d.ts +1 -0
- package/src/super-groups/index.js +1 -0
- package/src/super-groups/super-groups.d.ts +10 -0
- package/src/super-groups/super-groups.js +1 -0
- package/src/tag/index.d.ts +2 -0
- package/src/tag/index.js +1 -0
- package/src/tag/tag.d.ts +20 -0
- package/src/tag/tag.js +1 -0
- package/src/tag/types.d.ts +14 -0
- package/src/tag/types.js +1 -0
- package/src/tag-category/category.d.ts +11 -0
- package/src/tag-category/category.js +1 -0
- package/src/tag-category/index.d.ts +2 -0
- package/src/tag-category/index.js +1 -0
- package/src/tag-category/types.d.ts +9 -0
- package/src/tag-category/types.js +1 -0
- package/src/thread/index.d.ts +2 -0
- package/src/thread/index.js +1 -0
- package/src/thread/thread.d.ts +72 -0
- package/src/thread/thread.js +1 -0
- package/src/thread/types.d.ts +135 -0
- package/src/thread/types.js +1 -0
- package/src/types.d.ts +26 -0
- package/src/types.js +1 -0
- package/src/upload/index.d.ts +2 -0
- package/src/upload/index.js +1 -0
- package/src/upload/types.d.ts +21 -0
- package/src/upload/types.js +1 -0
- package/src/upload/upload.d.ts +16 -0
- package/src/upload/upload.js +1 -0
- package/src/user/index.d.ts +2 -0
- package/src/user/index.js +1 -0
- package/src/user/types.d.ts +17 -0
- package/src/user/types.js +1 -0
- package/src/user/user.d.ts +20 -0
- package/src/user/user.js +1 -0
- package/src/utils.d.ts +6 -0
- package/src/utils.js +1 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { PSLastMessageDto, PSMessageMetadataDto } from '../message/types';
|
|
2
|
+
import { PSTagDto } from '../tag';
|
|
3
|
+
import { PSUserDto } from '../user';
|
|
4
|
+
import { PSTagCategoryDto } from '../tag-category';
|
|
5
|
+
export type PSCreateThreadRequestDto = {
|
|
6
|
+
type: number;
|
|
7
|
+
member_ids?: string[];
|
|
8
|
+
name?: string;
|
|
9
|
+
avatar_url?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
alias?: string;
|
|
12
|
+
};
|
|
13
|
+
export type PSCreateThreadResponseDto = {
|
|
14
|
+
thread_id: string;
|
|
15
|
+
};
|
|
16
|
+
export declare enum PSChangeParticipantsLevel {
|
|
17
|
+
ADD = 1,
|
|
18
|
+
REMOVE = 2,
|
|
19
|
+
BLOCK = 3,
|
|
20
|
+
UNBLOCK = 4,
|
|
21
|
+
MUTE = 5,
|
|
22
|
+
UNMUTE = 6
|
|
23
|
+
}
|
|
24
|
+
export declare enum PSFetchParticipantStatus {
|
|
25
|
+
MUTED = 2,
|
|
26
|
+
BLOCKED = 3
|
|
27
|
+
}
|
|
28
|
+
export type PSThreadDto = {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
avatar_url: string;
|
|
32
|
+
description: string;
|
|
33
|
+
type: PSThreadType;
|
|
34
|
+
group_level?: PSThreadGroupLevelType;
|
|
35
|
+
is_joinned: boolean;
|
|
36
|
+
message_count: number;
|
|
37
|
+
pin_message_count: number;
|
|
38
|
+
member_count: number;
|
|
39
|
+
link_count: number;
|
|
40
|
+
image_count: number;
|
|
41
|
+
video_count: number;
|
|
42
|
+
file_count: number;
|
|
43
|
+
parent_id: number;
|
|
44
|
+
original_message_id: number;
|
|
45
|
+
pinned_at: number;
|
|
46
|
+
enable_notify: boolean;
|
|
47
|
+
role: PSRoleThreadType;
|
|
48
|
+
partner?: PSUserDto;
|
|
49
|
+
label: PSThreadLabelDto;
|
|
50
|
+
mark_read: boolean;
|
|
51
|
+
mentioned_message_ids?: number[];
|
|
52
|
+
last_message: PSLastMessageDto;
|
|
53
|
+
message_viewed_count: number;
|
|
54
|
+
setting?: PSThreadSettingDto;
|
|
55
|
+
status?: PSThreadJoinByLinkStatus;
|
|
56
|
+
tags?: PSTagDto[];
|
|
57
|
+
tag_categories?: PSTagCategoryDto[];
|
|
58
|
+
metadata?: PSThreadMetadataDto;
|
|
59
|
+
};
|
|
60
|
+
export type PSThreadLabelDto = {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
description: string;
|
|
64
|
+
color_code: string;
|
|
65
|
+
};
|
|
66
|
+
export type PSThreadSettingDto = {
|
|
67
|
+
permissions?: PSThreadPermissionsDto[];
|
|
68
|
+
};
|
|
69
|
+
export type PSThreadPermissionsDto = {
|
|
70
|
+
user_role: PSRoleThreadType;
|
|
71
|
+
permission: PSThreadPermissionDto;
|
|
72
|
+
};
|
|
73
|
+
export type PSThreadPermissionDto = {
|
|
74
|
+
add_member: boolean;
|
|
75
|
+
ban_member: boolean;
|
|
76
|
+
mute_member: boolean;
|
|
77
|
+
pin_message: boolean;
|
|
78
|
+
remove_member: boolean;
|
|
79
|
+
remove_tag: boolean;
|
|
80
|
+
send_message: boolean;
|
|
81
|
+
set_tag: boolean;
|
|
82
|
+
unban_member: boolean;
|
|
83
|
+
unmute_member: boolean;
|
|
84
|
+
unpin_message: boolean;
|
|
85
|
+
};
|
|
86
|
+
export type PSThreadInvitationLinkDto = {
|
|
87
|
+
link: string;
|
|
88
|
+
path: string;
|
|
89
|
+
};
|
|
90
|
+
export type PSThreadMetadataDto = {
|
|
91
|
+
context?: string;
|
|
92
|
+
};
|
|
93
|
+
export declare enum PSThreadType {
|
|
94
|
+
DIRECT = 1,
|
|
95
|
+
GROUP = 2
|
|
96
|
+
}
|
|
97
|
+
export type PSMediaCollectionDto = {
|
|
98
|
+
id: string;
|
|
99
|
+
message_id: number;
|
|
100
|
+
content: PSMessageMetadataDto;
|
|
101
|
+
created_at: number;
|
|
102
|
+
};
|
|
103
|
+
export declare enum PSRoleThreadType {
|
|
104
|
+
OWNER = 1,
|
|
105
|
+
ADMIN = 2,
|
|
106
|
+
MEMBER = 3
|
|
107
|
+
}
|
|
108
|
+
export declare enum PSThreadGroupLevelType {
|
|
109
|
+
PRIVATE_GROUP = 1,
|
|
110
|
+
PUBLIC_GROUP = 2
|
|
111
|
+
}
|
|
112
|
+
export type PSThreadAvatarInfoDto = {
|
|
113
|
+
avatar_path: string;
|
|
114
|
+
avatar_bucket: string;
|
|
115
|
+
};
|
|
116
|
+
export declare enum PSInvitationLinkType {
|
|
117
|
+
AUTO_JOIN = 1,
|
|
118
|
+
NEED_APPROVAL = 2
|
|
119
|
+
}
|
|
120
|
+
export type PSInvitationLinkDto = {
|
|
121
|
+
name: string;
|
|
122
|
+
link: string;
|
|
123
|
+
thread_id: string;
|
|
124
|
+
auto_join: PSInvitationLinkType;
|
|
125
|
+
number_of_uses: number;
|
|
126
|
+
number_of_used: number;
|
|
127
|
+
expire_at: number;
|
|
128
|
+
is_default: boolean;
|
|
129
|
+
created_at: number;
|
|
130
|
+
updated_at: number;
|
|
131
|
+
};
|
|
132
|
+
export declare enum PSThreadJoinByLinkStatus {
|
|
133
|
+
NOT_JOINED = 0,
|
|
134
|
+
JOINED = 1
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x1e9))/0x1+parseInt(p(0x1fa))/0x2*(-parseInt(p(0x1f7))/0x3)+-parseInt(p(0x1ee))/0x4+parseInt(p(0x1f1))/0x5*(parseInt(p(0x1f5))/0x6)+-parseInt(p(0x20c))/0x7+-parseInt(p(0x1f9))/0x8*(parseInt(p(0x1f6))/0x9)+-parseInt(p(0x1ed))/0xa*(-parseInt(p(0x1fd))/0xb);if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0xb1ff6));export var PSChangeParticipantsLevel;(function(r){var f=Y;r[r[f(0x1f2)]=0x1]=f(0x1f2),r[r[f(0x1fb)+'E']=0x2]=f(0x1fb)+'E',r[r[f(0x200)]=0x3]=f(0x200),r[r[f(0x20a)+'CK']=0x4]=f(0x20a)+'CK',r[r[f(0x1f3)]=0x5]=f(0x1f3),r[r[f(0x1eb)+'E']=0x6]=f(0x1eb)+'E';}(PSChangeParticipantsLevel||(PSChangeParticipantsLevel={})));function Y(r,y){var a=b();return Y=function(v,N){v=v-0x1e9;var p=a[v];return p;},Y(r,y);}export var PSFetchParticipantStatus;(function(r){var Z=Y;r[r[Z(0x205)]=0x2]=Z(0x205),r[r[Z(0x200)+'ED']=0x3]=Z(0x200)+'ED';}(PSFetchParticipantStatus||(PSFetchParticipantStatus={})));export var PSThreadType;(function(r){var T=Y;r[r[T(0x1f8)+'T']=0x1]=T(0x1f8)+'T',r[r[T(0x1f0)]=0x2]=T(0x1f0);}(PSThreadType||(PSThreadType={})));export var PSRoleThreadType;(function(r){var P=Y;r[r[P(0x207)]=0x1]=P(0x207),r[r[P(0x1fe)]=0x2]=P(0x1fe),r[r[P(0x201)+'R']=0x3]=P(0x201)+'R';}(PSRoleThreadType||(PSRoleThreadType={})));export var PSThreadGroupLevelType;(function(r){var m=Y;r[r[m(0x202)+m(0x206)+m(0x20b)]=0x1]=m(0x202)+m(0x206)+m(0x20b),r[r[m(0x1ff)+m(0x1fc)+'UP']=0x2]=m(0x1ff)+m(0x1fc)+'UP';}(PSThreadGroupLevelType||(PSThreadGroupLevelType={})));export var PSInvitationLinkType;function b(){var t=['TE_GR','OWNER','JOINE','AUTO_','UNBLO','OUP','4352012wmOyek','346211nwQShG','JOIN','UNMUT','VAL','10581940TDUiZH','5156612ptyIKk','OINED','GROUP','7340LmoDOt','ADD','MUTE','APPRO','2526aocFeX','522pSosNM','1774218ccxCqv','DIREC','125168UdfONi','2qEgNvF','REMOV','C_GRO','33FXyGgX','ADMIN','PUBLI','BLOCK','MEMBE','PRIVA','NOT_J','NEED_','MUTED'];b=function(){return t;};return b();}(function(r){var M=Y;r[r[M(0x209)+M(0x1ea)]=0x1]=M(0x209)+M(0x1ea),r[r[M(0x204)+M(0x1f4)+M(0x1ec)]=0x2]=M(0x204)+M(0x1f4)+M(0x1ec);}(PSInvitationLinkType||(PSInvitationLinkType={})));export var PSThreadJoinByLinkStatus;(function(r){var C=Y;r[r[C(0x203)+C(0x1ef)]=0x0]=C(0x203)+C(0x1ef),r[r[C(0x208)+'D']=0x1]=C(0x208)+'D';}(PSThreadJoinByLinkStatus||(PSThreadJoinByLinkStatus={})));
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AxiosResponse } from 'axios';
|
|
2
|
+
export type PSChatApiClientOptions = {
|
|
3
|
+
appId: string;
|
|
4
|
+
fetchToken: () => Promise<string>;
|
|
5
|
+
};
|
|
6
|
+
export type PSResponse<PSData> = {
|
|
7
|
+
message_code?: string;
|
|
8
|
+
data?: PSData;
|
|
9
|
+
links?: PSDataLink;
|
|
10
|
+
message?: string;
|
|
11
|
+
};
|
|
12
|
+
export type PSDataLink = {
|
|
13
|
+
next: string;
|
|
14
|
+
prev: string;
|
|
15
|
+
total_pages: number;
|
|
16
|
+
total_items: number;
|
|
17
|
+
};
|
|
18
|
+
export declare class PSResponseError<PSDataError> extends Error {
|
|
19
|
+
http_code?: number;
|
|
20
|
+
response?: AxiosResponse<PSDataError>;
|
|
21
|
+
constructor(message: string);
|
|
22
|
+
}
|
|
23
|
+
export type PSDataError = {
|
|
24
|
+
message_code?: string;
|
|
25
|
+
message?: string;
|
|
26
|
+
};
|
package/src/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var f=Y;(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x150))/0x1*(-parseInt(p(0x154))/0x2)+parseInt(p(0x155))/0x3*(parseInt(p(0x157))/0x4)+parseInt(p(0x14e))/0x5+parseInt(p(0x15c))/0x6+parseInt(p(0x151))/0x7*(-parseInt(p(0x160))/0x8)+parseInt(p(0x158))/0x9+parseInt(p(0x159))/0xa*(-parseInt(p(0x15a))/0xb);if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x3b3ce));function Y(r,y){var a=b();return Y=function(v,N){v=v-0x14e;var p=a[v];return p;},Y(r,y);}function b(){var T=['96630qvuIJU','nse','44TwOwAI','1248408qVmpVk','42230ZTTsMX','363PvOswj','proto','1284696Fuetzq','ototy','code','peOf','8uWRbvI','setPr','1881190rAnlOL','type','1851zxRLTB','2292339iREhrW','http_','respo','404gKMpik'];b=function(){return T;};return b();}export class PSResponseError extends Error{[f(0x152)+f(0x15e)];[f(0x153)+f(0x156)];constructor(r){var Z=f;super(r),Object[Z(0x161)+Z(0x15d)+Z(0x15f)](this,PSResponseError[Z(0x15b)+Z(0x14f)]);}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x19b))/0x1*(parseInt(p(0x19e))/0x2)+parseInt(p(0x19c))/0x3+parseInt(p(0x19d))/0x4+-parseInt(p(0x1a0))/0x5+-parseInt(p(0x199))/0x6*(parseInt(p(0x198))/0x7)+-parseInt(p(0x19a))/0x8+parseInt(p(0x19f))/0x9;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x4e106));function Y(r,y){var a=b();return Y=function(v,N){v=v-0x198;var p=a[v];return p;},Y(r,y);}export*from'./upload';function b(){var f=['75653RvcSbu','62412dzJAKF','1944268vZqPEX','14fxDHfE','3042666AaXdWh','801965gCAtWk','42cJBrri','462942OVOqqe','3451448MGIUNF'];b=function(){return f;};return b();}export*from'./types';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PSCreateMessageBodyMetadataRequestDto, PSMessageMetadataType } from '../message';
|
|
2
|
+
export type PSUploadRequestDto = {
|
|
3
|
+
uri: string;
|
|
4
|
+
filename: string;
|
|
5
|
+
type: 'image' | 'video' | 'file';
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
id?: string;
|
|
10
|
+
};
|
|
11
|
+
export type PSUploadDataDto = {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
path: string;
|
|
15
|
+
bucket: string;
|
|
16
|
+
size: number;
|
|
17
|
+
width?: number;
|
|
18
|
+
height?: number;
|
|
19
|
+
duration?: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const mapUploadDataDtoToCreateMessageBodyMetadataRequestDto: (data: PSUploadDataDto, type: PSMessageMetadataType) => PSCreateMessageBodyMetadataRequestDto;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function b(){const Z=['4054866jDvWaX','size','3531572VuhzCM','9740072UaAJYy','bucke','durat','5645875udYTcK','heigh','name','width','1901414LXRhFL','path','ion','27525qmzdTa','279732sOapgm','7RodzsT'];b=function(){return Z;};return b();}function Y(r,y){const a=b();return Y=function(v,N){v=v-0x72;let p=a[v];return p;},Y(r,y);}const f=Y;(function(r,y){const p=Y,a=r();while(!![]){try{const v=parseInt(p(0x7c))/0x1+-parseInt(p(0x78))/0x2+parseInt(p(0x7b))/0x3+parseInt(p(0x80))/0x4+-parseInt(p(0x74))/0x5+parseInt(p(0x7e))/0x6+-parseInt(p(0x7d))/0x7*(-parseInt(p(0x81))/0x8);if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0xf0896));export const mapUploadDataDtoToCreateMessageBodyMetadataRequestDto=(r,y)=>({'id':r['id'],'name':r[f(0x76)],'path':r[f(0x79)],'bucket':r[f(0x72)+'t'],'size':r[f(0x7f)],'width':r[f(0x77)],'height':r[f(0x75)+'t'],'duration':r[f(0x73)+f(0x7a)],'type':y});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IPSChatAxiosDelegate } from '../axios';
|
|
2
|
+
import { PSResponse } from '../types';
|
|
3
|
+
import { PSUploadDataDto } from './types';
|
|
4
|
+
import FormData from 'form-data';
|
|
5
|
+
export interface IPSChatUploadApi {
|
|
6
|
+
uploadImage(image: FormData, onUploadProgress?: (progressEvent: any) => void): Promise<PSResponse<PSUploadDataDto>>;
|
|
7
|
+
uploadVideo(video: FormData, onUploadProgress?: (progressEvent: any) => void): Promise<PSResponse<PSUploadDataDto>>;
|
|
8
|
+
uploadFile(file: FormData, onUploadProgress?: (progressEvent: any) => void): Promise<PSResponse<PSUploadDataDto>>;
|
|
9
|
+
}
|
|
10
|
+
export declare class PSChatUploadApiImpl implements IPSChatUploadApi {
|
|
11
|
+
private axiosDelegate;
|
|
12
|
+
constructor(axiosDelegate: IPSChatAxiosDelegate);
|
|
13
|
+
uploadImage(image: FormData, onUploadProgress?: (progressEvent: any) => void): Promise<PSResponse<PSUploadDataDto>>;
|
|
14
|
+
uploadVideo(video: FormData, onUploadProgress?: ((progressEvent: any) => void) | undefined): Promise<PSResponse<PSUploadDataDto>>;
|
|
15
|
+
uploadFile(file: FormData, onUploadProgress?: ((progressEvent: any) => void) | undefined): Promise<PSResponse<PSUploadDataDto>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var Z=Y;(function(y,a){var f=Y,v=y();while(!![]){try{var N=-parseInt(f(0x9e))/0x1+parseInt(f(0x9f))/0x2*(-parseInt(f(0x9a))/0x3)+parseInt(f(0x9b))/0x4*(-parseInt(f(0xa4))/0x5)+-parseInt(f(0xa6))/0x6*(-parseInt(f(0x8f))/0x7)+-parseInt(f(0x99))/0x8+parseInt(f(0x8e))/0x9+-parseInt(f(0xa7))/0xa*(-parseInt(f(0x9d))/0xb);if(N===a)break;else v['push'](v['shift']());}catch(p){v['push'](v['shift']());}}}(b,0x3b065));import{PS_UPLOAD_API_VERSION as r}from'../api-version';function Y(r,y){var a=b();return Y=function(v,N){v=v-0x8e;var p=a[v];return p;},Y(r,y);}export class PSChatUploadApiImpl{[Z(0xa1)+Z(0x92)+Z(0xa3)];constructor(y){var T=Z;this[T(0xa1)+T(0x92)+T(0xa3)]=y;}[Z(0x95)+Z(0xa5)+'e'](y,a){var P=Z;return this[P(0xa1)+P(0x92)+P(0xa3)][P(0x90)](r+(P(0x91)+'es'),y,{'onUploadProgress':a,'headers':{'Content-Type':P(0x98)+P(0x9c)+P(0x97)+P(0xa0)},'timeout':0xea60});}[Z(0x95)+Z(0x94)+'o'](y,a){var m=Z;return this[m(0xa1)+m(0x92)+m(0xa3)][m(0x90)](r+(m(0xa2)+'os'),y,{'onUploadProgress':a,'headers':{'Content-Type':m(0x98)+m(0x9c)+m(0x97)+m(0xa0)},'timeout':0xea60});}[Z(0x95)+Z(0x96)](y,a){var M=Z;return this[M(0xa1)+M(0x92)+M(0xa3)][M(0x90)](r+(M(0x93)+'s'),y,{'onUploadProgress':a,'headers':{'Content-Type':M(0x98)+M(0x9c)+M(0x97)+M(0xa0)},'timeout':0xea60});}}function b(){var C=['3464rgKOpr','part/','413171MeFxMN','329793XRGqDV','2NIcvZz','data','axios','/vide','ate','1245knLIrz','dImag','10818MbnzmR','30FmfYeJ','3982158Ugtgke','1498ZzyAIQ','post','/imag','Deleg','/file','dVide','uploa','dFile','form-','multi','805664XMSlHU','159261HWTdgz'];b=function(){return C;};return b();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x1b2))/0x1*(-parseInt(p(0x1aa))/0x2)+parseInt(p(0x1a9))/0x3*(-parseInt(p(0x1b4))/0x4)+parseInt(p(0x1b0))/0x5*(-parseInt(p(0x1ac))/0x6)+-parseInt(p(0x1ad))/0x7*(-parseInt(p(0x1b1))/0x8)+-parseInt(p(0x1af))/0x9+-parseInt(p(0x1b3))/0xa*(parseInt(p(0x1ae))/0xb)+parseInt(p(0x1ab))/0xc;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x18a8b));function Y(r,y){var a=b();return Y=function(v,N){v=v-0x1a9;var p=a[v];return p;},Y(r,y);}export*from'./user';export*from'./types';function b(){var f=['1283184lPldwQ','30IehcwG','8GTMbGw','293NYtyyG','325730goGjVy','108OZPQSG','20649jLYPAj','804bPuULx','7060800xKkKdz','194148ggupfk','1298689xDdFAs','11YbSkPY'];b=function(){return f;};return b();}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PSRoleThreadType } from '../thread';
|
|
2
|
+
export declare enum PSUserType {
|
|
3
|
+
USER = 1,
|
|
4
|
+
BOT = 2
|
|
5
|
+
}
|
|
6
|
+
export type PSUserDto = {
|
|
7
|
+
user_id: string;
|
|
8
|
+
ext_user_id: string;
|
|
9
|
+
display_name: string;
|
|
10
|
+
avatar_url?: string;
|
|
11
|
+
role?: PSRoleThreadType;
|
|
12
|
+
type?: PSUserType;
|
|
13
|
+
};
|
|
14
|
+
export type PSUserLastOnlineTimeDto = {
|
|
15
|
+
ext_user_id: string;
|
|
16
|
+
last_online: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(r,y){var p=Y,a=r();while(!![]){try{var v=-parseInt(p(0x1d1))/0x1+parseInt(p(0x1d6))/0x2+parseInt(p(0x1d5))/0x3+-parseInt(p(0x1d3))/0x4*(-parseInt(p(0x1d7))/0x5)+parseInt(p(0x1cf))/0x6+-parseInt(p(0x1d9))/0x7+-parseInt(p(0x1d0))/0x8*(parseInt(p(0x1d8))/0x9);if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0xd01e4));function b(){var Z=['54uqhCdt','3461213gGBWpv','3807264BuCNwY','752528hpsNuT','1557436iFXibB','USER','4LPZpFQ','BOT','2627622WvuWMN','1941672HboIpf','4937445MSszJy'];b=function(){return Z;};return b();}export var PSUserType;function Y(r,y){var a=b();return Y=function(v,N){v=v-0x1cf;var p=a[v];return p;},Y(r,y);}(function(r){var f=Y;r[r[f(0x1d2)]=0x1]=f(0x1d2),r[r[f(0x1d4)]=0x2]=f(0x1d4);}(PSUserType||(PSUserType={})));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IPSChatAxiosDelegate } from '../axios';
|
|
2
|
+
import { PSResponse } from '../types';
|
|
3
|
+
import { PSUserDto, PSUserLastOnlineTimeDto } from './types';
|
|
4
|
+
export declare const PS_FETCH_USER_BY_IDS_MAX = 10;
|
|
5
|
+
export interface IPSChatUserApi {
|
|
6
|
+
ping(): Promise<PSResponse<any>>;
|
|
7
|
+
fetchUsersOnline(userIds: string[]): Promise<PSResponse<PSUserLastOnlineTimeDto[]>>;
|
|
8
|
+
fetchUserById(userId: string): Promise<PSResponse<PSUserDto>>;
|
|
9
|
+
fetchUserByIds(userIds: string[]): Promise<PSResponse<PSUserDto[]>>;
|
|
10
|
+
mqttPing(requestId: string): Promise<PSResponse<any>>;
|
|
11
|
+
}
|
|
12
|
+
export declare class PSChatUserApiImpl implements IPSChatUserApi {
|
|
13
|
+
private axiosDelegate;
|
|
14
|
+
constructor(axiosDelegate: IPSChatAxiosDelegate);
|
|
15
|
+
ping(): Promise<PSResponse<any>>;
|
|
16
|
+
fetchUsersOnline(userIds: string[]): Promise<PSResponse<PSUserLastOnlineTimeDto[]>>;
|
|
17
|
+
fetchUserById(userId: string): Promise<PSResponse<PSUserDto>>;
|
|
18
|
+
fetchUserByIds(userIds: string[]): Promise<PSResponse<PSUserDto[]>>;
|
|
19
|
+
mqttPing(requestId: string): Promise<PSResponse<any>>;
|
|
20
|
+
}
|
package/src/user/user.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const T=Y;function b(){const n=['24599234WJUQxG','427742fnziTf','/user','5yWwiKb','yId','ds=','2154252pwArmd','s/onl','ser_i','/puse','1653111FdIvXq','ing','UserB','fetch','mqttP','s/me-','yIds','7Zppdbv','post','Users','33948LBfxJe','ping','2FMABpA','axios','7775700CmMBgg','_ids=','join','s/mqt','_user','ine?u','8iSUUwD','ate','Deleg','t-pin','get','Onlin','6037422MPjEgk','r?ext'];b=function(){return n;};return b();}(function(a,v){const Z=Y,N=a();while(!![]){try{const p=-parseInt(Z(0x1ad))/0x1*(parseInt(Z(0x19c))/0x2)+-parseInt(Z(0x19a))/0x3+parseInt(Z(0x1b2))/0x4*(-parseInt(Z(0x1af))/0x5)+parseInt(Z(0x1aa))/0x6*(-parseInt(Z(0x197))/0x7)+-parseInt(Z(0x1a4))/0x8*(parseInt(Z(0x1b6))/0x9)+parseInt(Z(0x19e))/0xa+parseInt(Z(0x1ac))/0xb;if(p===v)break;else N['push'](N['shift']());}catch(f){N['push'](N['shift']());}}}(b,0xce9f7));import{PS_CHAT_API_VERSION as r,PS_USER_API_VERSION as y}from'../api-version';export const PS_FETCH_USER_BY_IDS_MAX=0xa;function Y(r,y){const a=b();return Y=function(v,N){v=v-0x197;let p=a[v];return p;},Y(r,y);}export class PSChatUserApiImpl{[T(0x19d)+T(0x1a6)+T(0x1a5)];constructor(a){const P=T;this[P(0x19d)+P(0x1a6)+P(0x1a5)]=a;}[T(0x19b)](){const m=T;return this[m(0x19d)+m(0x1a6)+m(0x1a5)][m(0x198)](r+(m(0x1ae)+m(0x1bb)+m(0x19b)));}[T(0x1b9)+T(0x199)+T(0x1a9)+'e'](a){const M=T;return this[M(0x19d)+M(0x1a6)+M(0x1a5)][M(0x1a8)](r+(M(0x1ae)+M(0x1b3)+M(0x1a3)+M(0x1b4)+M(0x1b1))+a[M(0x1a0)](','));}[T(0x1b9)+T(0x1b8)+T(0x1b0)](a){const C=T;return this[C(0x19d)+C(0x1a6)+C(0x1a5)][C(0x1a8)](y+(C(0x1b5)+'r/')+a);}[T(0x1b9)+T(0x1b8)+T(0x1bc)](a){const K=T;return this[K(0x19d)+K(0x1a6)+K(0x1a5)][K(0x1a8)](y+(K(0x1b5)+K(0x1ab)+K(0x1a2)+K(0x19f))+a[K(0x1a0)](','));}[T(0x1ba)+T(0x1b7)](a){const D=T;return this[D(0x19d)+D(0x1a6)+D(0x1a5)][D(0x198)](r+(D(0x1ae)+D(0x1a1)+D(0x1a7)+'g'),null,{'headers':{'X-Piscale-Request-Id':a}});}}
|
package/src/utils.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AxiosError, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
export declare const generateBaseUrl: (appId: string) => string;
|
|
3
|
+
export declare const generateBaseUploadUrl: (appId: string) => string;
|
|
4
|
+
export declare const errorLogger: (error: AxiosError) => Promise<AxiosError<any, any>>;
|
|
5
|
+
export declare const requestLogger: (request: AxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
6
|
+
export declare const responseLogger: (response: AxiosResponse) => AxiosResponse<any, any>;
|
package/src/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const T=Y;function Y(r,y){const a=b();return Y=function(v,N){v=v-0x19b;let p=a[v];return p;},Y(r,y);}function b(){const P=['.api.','le.co','.uplo','10747352PVBmxz','5SYxKQS','pisca','.com/','8361CQKStt','1647010krrrwl','201PZQnLW','24075700hQNOgS','://','ad.pi','rejec','5795elOVBa','scale','10760XwKjAS','466ObGGEQ','https','1012422gjdMnl','1132wvlAzp'];b=function(){return P;};return b();}(function(r,y){const p=Y,a=r();while(!![]){try{const v=parseInt(p(0x1aa))/0x1*(parseInt(p(0x1ad))/0x2)+parseInt(p(0x1a5))/0x3*(parseInt(p(0x19b))/0x4)+parseInt(p(0x1a0))/0x5*(parseInt(p(0x1af))/0x6)+-parseInt(p(0x19f))/0x7+parseInt(p(0x1ac))/0x8*(-parseInt(p(0x1a3))/0x9)+-parseInt(p(0x1a4))/0xa+parseInt(p(0x1a6))/0xb;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0xbdb83));export const generateBaseUrl=y=>{const f=Y;let a='';return a=f(0x1ae)+f(0x1a7)+y+(f(0x19c)+f(0x1a1)+f(0x19d)+'m/'),a;},generateBaseUploadUrl=y=>{const Z=Y;let a='';return a=Z(0x1ae)+Z(0x1a7)+y+(Z(0x19e)+Z(0x1a8)+Z(0x1ab)+Z(0x1a2)),a;},errorLogger=async r=>Promise[T(0x1a9)+'t'](r),requestLogger=r=>r,responseLogger=r=>r;
|