@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
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 PiScale Developer
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function Y(r,y){var a=b();return Y=function(v,N){v=v-0xe1;var p=a[v];return p;},Y(r,y);}(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0xe3))/0x1+parseInt(p(0xeb))/0x2+-parseInt(p(0xe9))/0x3*(parseInt(p(0xe4))/0x4)+parseInt(p(0xe1))/0x5*(parseInt(p(0xe6))/0x6)+parseInt(p(0xe7))/0x7+-parseInt(p(0xea))/0x8*(-parseInt(p(0xe2))/0x9)+-parseInt(p(0xe5))/0xa*(parseInt(p(0xe8))/0xb);if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0xb3b2e));export*from'./src';function b(){var f=['31604859rJjrtJ','651EPOoXH','8olmKwo','2483822xXSONw','205JCuHfo','2772747mdnXcx','707856jNWfPa','652XqTCUS','10yVFseg','22188gIuEDH','8645826eZfncE'];b=function(){return f;};return b();}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@communi/chat-api-client-typescript",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "PiScale Chat API Client Typescript",
|
|
5
|
+
"homepage": "https://github.com/piscale",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "PiScale Developer <piscale_dev@piscale.com> (https://github.com/piscale)",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"types": "index.d.ts",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"axios": "^1.5.0",
|
|
12
|
+
"axios-retry": "^3.7.0",
|
|
13
|
+
"base-64": "^1.0.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/form-data": "^2.5.0",
|
|
17
|
+
"axios-logger": "2.7.0",
|
|
18
|
+
"axios-mock-adapter": "^1.21.3",
|
|
19
|
+
"typescript": "^5.2.2"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"axios": ">= 1.5.0",
|
|
23
|
+
"axios-retry": ">= 3.7.0",
|
|
24
|
+
"base-64": ">= 1.0.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PS_CHAT_API_VERSION = "chat/v1.0";
|
|
2
|
+
export declare const PS_SEARCH_API_VERSION = "search/v1.0";
|
|
3
|
+
export declare const PS_PREVIEW_LINK_API_VERSION = "preview-link/v1.0";
|
|
4
|
+
export declare const PS_UPLOAD_API_VERSION = "upload/v1.0";
|
|
5
|
+
export declare const PS_NOTIFICATION_API_VERSION = "notification/v1.0";
|
|
6
|
+
export declare const PS_STICKER_API_VERSION = "sticker/v1.0";
|
|
7
|
+
export declare const PS_USER_API_VERSION = "user/v1.0";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const f=Y;(function(r,y){const p=Y,a=r();while(!![]){try{const v=-parseInt(p(0xae))/0x1+-parseInt(p(0xa3))/0x2*(parseInt(p(0xaf))/0x3)+-parseInt(p(0xac))/0x4+-parseInt(p(0x9d))/0x5+-parseInt(p(0xa4))/0x6*(-parseInt(p(0xa6))/0x7)+-parseInt(p(0xad))/0x8*(-parseInt(p(0xa1))/0x9)+parseInt(p(0xa9))/0xa;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x1ef20));function b(){const Z=['uploa','d/v1.','notif','690495XhFwBv','er/v1','chat/','v1.0','50616yoNHKf','h/v1.','19574wyKVKa','111522zBDBmh','user/','35uaxuWF','stick','on/v1','5532380SIzjnq','ew-li','nk/v1','909092IRedzU','344bsxxTD','229502aaiClv','51yQtbVG','previ','icati','searc'];b=function(){return Z;};return b();}function Y(r,y){const a=b();return Y=function(v,N){v=v-0x9a;let p=a[v];return p;},Y(r,y);}export const PS_CHAT_API_VERSION=f(0x9f)+f(0xa0),PS_SEARCH_API_VERSION=f(0xb2)+f(0xa2)+'0',PS_PREVIEW_LINK_API_VERSION=f(0xb0)+f(0xaa)+f(0xab)+'.0',PS_UPLOAD_API_VERSION=f(0x9a)+f(0x9b)+'0',PS_NOTIFICATION_API_VERSION=f(0x9c)+f(0xb1)+f(0xa8)+'.0',PS_STICKER_API_VERSION=f(0xa7)+f(0x9e)+'.0',PS_USER_API_VERSION=f(0xa5)+f(0xa0);
|
package/src/axios.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { PSChatApiClientOptions } from './types';
|
|
3
|
+
export interface IPSChatAxiosDelegate {
|
|
4
|
+
getJWT(): string;
|
|
5
|
+
get<T>(path: string, options?: AxiosRequestConfig): Promise<T>;
|
|
6
|
+
put<T>(path: string, data?: unknown, options?: AxiosRequestConfig): Promise<T>;
|
|
7
|
+
post<T>(path: string, data?: unknown, options?: AxiosRequestConfig): Promise<T>;
|
|
8
|
+
patch<T>(path: string, data?: unknown, options?: AxiosRequestConfig): Promise<T>;
|
|
9
|
+
delete<T>(path: string, options?: AxiosRequestConfig): Promise<T>;
|
|
10
|
+
}
|
|
11
|
+
export declare class PSChatAxiosDelegate implements IPSChatAxiosDelegate {
|
|
12
|
+
private jwt;
|
|
13
|
+
private options;
|
|
14
|
+
private axiosInstance;
|
|
15
|
+
private refreshTokenPromise?;
|
|
16
|
+
constructor(jwt: string, options: PSChatApiClientOptions, baseUrl: string);
|
|
17
|
+
getJWT(): string;
|
|
18
|
+
get<T>(path: string, options?: AxiosRequestConfig): Promise<T>;
|
|
19
|
+
put<T>(path: string, data?: unknown, options?: AxiosRequestConfig): Promise<T>;
|
|
20
|
+
post<T>(path: string, data?: unknown, options?: AxiosRequestConfig): Promise<T>;
|
|
21
|
+
patch<T>(path: string, data?: unknown, options?: AxiosRequestConfig): Promise<T>;
|
|
22
|
+
delete<T>(path: string, options?: AxiosRequestConfig): Promise<T>;
|
|
23
|
+
private earlyRefreshToken;
|
|
24
|
+
private doAxiosRequest;
|
|
25
|
+
private handleResponse;
|
|
26
|
+
private errorFromResponse;
|
|
27
|
+
private isErrorResponse;
|
|
28
|
+
}
|
package/src/axios.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function b(){const s=['catio','confi','est\x20k','ng\x20có','put','estEr','i\x20=>\x20','447008BkfyuS','baseU','get','đang\x20','ử\x20lại','\x20API\x20','workO','ken','espon','Token','heade','3MOaKyc','jwt','poten','handl','nce','rIdem','212390uuYiMS','ponse','patch','mise','ken\x20t','n/jso','creat','doAxi','post','nse','axios','quest','isErr','API\x20','985293OEFsst','shTok','respo','use','\x20bị\x204','Autho','Refre','tRequ','code','onse','ror','h\x20tok','enPro','hành\x20','Beare','data','272643SbLxCR','\x20type','early','sh\x20to','01\x20rồ','orRes','công\x20','ỗi\x20-\x20','log','error','ion','url','FromR','delet','208635ZVFHFU','appli','eResp','=>\x20th','199534vwuPdB','reque','id\x20re','1701120WVJGtP','optio','inter','osReq','refre','\x20requ','messa','statu','isNet','sent','hác\x20đ','cepto','efres','6fvdrQd','http_','getJW','ken\x20l','Insta','rizat','fetch','uest','Inval','i\x20như','ang\x20r'];b=function(){return s;};return b();}const q=Y;(function(M,C){const I=Y,t=M();while(!![]){try{const K=parseInt(I(0xcb))/0x1+-parseInt(I(0x98))/0x2*(parseInt(I(0xc5))/0x3)+parseInt(I(0xba))/0x4+-parseInt(I(0x94))/0x5+-parseInt(I(0xa8))/0x6*(-parseInt(I(0xe9))/0x7)+-parseInt(I(0x9b))/0x8+parseInt(I(0xd9))/0x9;if(K===C)break;else t['push'](t['shift']());}catch(D){t['push'](t['shift']());}}}(b,0x1cea2));import r from'axios';import{PSResponseError as y}from'./types';import v from'axios-retry';import{decodeJWT as N,isJWTExpired as Z}from'./jwt';function Y(r,y){const a=b();return Y=function(v,N){v=v-0x89;let p=a[v];return p;},Y(r,y);}import{errorLogger as T,requestLogger as P,responseLogger as m}from'./utils';const a=0x191;export class PSChatAxiosDelegate{[q(0xc6)];[q(0x9c)+'ns'];[q(0xd5)+q(0xac)+q(0xc9)];[q(0x9f)+q(0xda)+q(0xe5)+q(0xce)];constructor(M,C,K){const E=q;this[E(0xc6)]=M,this[E(0x9c)+'ns']=C,this[E(0xd5)+E(0xac)+E(0xc9)]=r[E(0xd1)+'e']({'baseURL':K,'headers':{'Content-Type':E(0x95)+E(0xb3)+E(0xd0)+'n'},'timeout':0x2710,'withCredentials':!0x1}),this[E(0xd5)+E(0xac)+E(0xc9)][E(0x9d)+E(0xa6)+'rs'][E(0x99)+'st'][E(0xdc)](async D=>(this[E(0xc6)]?this[E(0xeb)+E(0xdf)+E(0xda)+'en'](this[E(0xc6)]):this[E(0xc6)]=await this[E(0x9c)+'ns'][E(0xae)+E(0xc3)](),D[E(0xc4)+'rs'][E(0xde)+E(0xad)+E(0x90)]=E(0xe7)+'r\x20'+this[E(0xc6)],P(D)),D=>T(D)),this[E(0xd5)+E(0xac)+E(0xc9)][E(0x9d)+E(0xa6)+'rs'][E(0xdb)+E(0xd4)][E(0xdc)](D=>m(D),async D=>{const V=E,k=D[V(0xb4)+'g'];if(D[V(0xdb)+V(0xd4)]&&D[V(0xdb)+V(0xd4)][V(0xa2)+'s']===a&&!k[V(0xa4)]){k[V(0xa4)]=!0x0,this[V(0x9f)+V(0xda)+V(0xe5)+V(0xce)]?console[V(0x8e)](V(0xd8)+(k[V(0xbb)+'RL']+k[V(0x91)])+(V(0xdd)+V(0x8a)+V(0xb1)+V(0xb6)+V(0xa0)+V(0xb5)+V(0xa5)+V(0xb2)+V(0xa7)+V(0xe4)+'en')):(console[V(0x8e)](V(0xd8)+(k[V(0xbb)+'RL']+k[V(0x91)])+(V(0xdd)+V(0x8a)+V(0xb9)+V(0xbd)+V(0x9f)+V(0x89)+V(0xc1))),this[V(0x9f)+V(0xda)+V(0xe5)+V(0xce)]=this[V(0x9c)+'ns'][V(0xae)+V(0xc3)]());try{return this[V(0xc6)]=await this[V(0x9f)+V(0xda)+V(0xe5)+V(0xce)],this[V(0x9f)+V(0xda)+V(0xe5)+V(0xce)]=void 0x0,console[V(0x8e)](V(0xdf)+V(0x89)+V(0xcf)+V(0xe6)+V(0x8c)+V(0x97)+V(0xbe)+V(0xbf)+(k[V(0xbb)+'RL']+k[V(0x91)])),this[V(0xd5)+V(0xac)+V(0xc9)](k);}catch(A){console[V(0x8e)](V(0xdf)+V(0x89)+V(0xab)+V(0x8d)+A);}}return T(D);}),v(this[E(0xd5)+E(0xac)+E(0xc9)],{'retries':0x3,'retryDelay':()=>0x3e8,'retryCondition':D=>D[E(0xdb)+E(0xd4)]!==void 0x0&&D[E(0xdb)+E(0xd4)][E(0xa2)+'s']!==a&&v[E(0xa3)+E(0xc0)+E(0xca)+E(0xc7)+E(0xe0)+E(0xb8)+E(0xe3)](D)});}[q(0xaa)+'T'](){const S=q;return this[S(0xc6)];}[q(0xbc)](M,C){const g=q;return this[g(0xd2)+g(0x9e)+g(0xaf)](g(0xbc),M,null,C);}[q(0xb7)](M,C,K){const W=q;return this[W(0xd2)+W(0x9e)+W(0xaf)](W(0xb7),M,C,K);}[q(0xd3)](M,C,K){const F=q;return this[F(0xd2)+F(0x9e)+F(0xaf)](F(0xd3),M,C,K);}[q(0xcd)](M,C,K){const L=q;return this[L(0xd2)+L(0x9e)+L(0xaf)](L(0xcd),M,C,K);}[q(0x93)+'e'](M,C){const X=q;return this[X(0xd2)+X(0x9e)+X(0xaf)](X(0x93)+'e',M,null,C);}[q(0xeb)+q(0xdf)+q(0xda)+'en']=async M=>{const Q=q;if(this[Q(0x9f)+Q(0xda)+Q(0xe5)+Q(0xce)])return;const C=N(M);C&&Z(C)&&(this[Q(0x9f)+Q(0xda)+Q(0xe5)+Q(0xce)]=this[Q(0x9c)+'ns'][Q(0xae)+Q(0xc3)](),this[Q(0xc6)]=await this[Q(0x9f)+Q(0xda)+Q(0xe5)+Q(0xce)],this[Q(0x9f)+Q(0xda)+Q(0xe5)+Q(0xce)]=void 0x0);};[q(0xd2)+q(0x9e)+q(0xaf)]=async(M,C,K,D)=>{const J=q;try{let k;switch(M){case J(0xbc):k=await this[J(0xd5)+J(0xac)+J(0xc9)][J(0xbc)](C,D);break;case J(0x93)+'e':k=await this[J(0xd5)+J(0xac)+J(0xc9)][J(0x93)+'e'](C,D);break;case J(0xd3):k=await this[J(0xd5)+J(0xac)+J(0xc9)][J(0xd3)](C,K,D);break;case J(0xb7):k=await this[J(0xd5)+J(0xac)+J(0xc9)][J(0xb7)](C,K,D);break;case J(0xcd):k=await this[J(0xd5)+J(0xac)+J(0xc9)][J(0xcd)](C,K,D);break;case J(0x9c)+'ns':k=await this[J(0xd5)+J(0xac)+J(0xc9)][J(0x9c)+'ns'](C,D);break;default:throw new Error(J(0xb0)+J(0x9a)+J(0xd6)+J(0xea));}return this[J(0xc8)+J(0x96)+J(0xe2)](k);}catch(A){if(A[J(0xdb)+J(0xd4)])return this[J(0xc8)+J(0x96)+J(0xe2)](A[J(0xdb)+J(0xd4)]);throw A;}};[q(0xc8)+q(0x96)+q(0xe2)](M){const o=q,C=M[o(0xe8)];if(this[o(0xd7)+o(0x8b)+o(0xcc)](M))throw this[o(0x8f)+o(0x92)+o(0xc2)+'se'](M);return C;}[q(0x8f)+q(0x92)+q(0xc2)+'se'](M){const w=q,C=M[w(0xa2)+'s'],K=M[w(0xe8)],D=new y(K[w(0xa1)+'ge']??'');return D[w(0xa9)+w(0xe1)]=C,D[w(0xdb)+w(0xd4)]=M,D;}[q(0xd7)+q(0x8b)+q(0xcc)](M){const x=q;return!M[x(0xa2)+'s']||M[x(0xa2)+'s']<0xc8||0x12c<=M[x(0xa2)+'s'];}}
|
package/src/client.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IPSChatConfigApi } from './config';
|
|
2
|
+
import { IPSChatThreadApi } from './thread';
|
|
3
|
+
import { IPSChatTagApi } from './tag';
|
|
4
|
+
import { IPSChatMessageApi } from './message';
|
|
5
|
+
import type { PSChatApiClientOptions } from './types';
|
|
6
|
+
import { IPSChatUserApi } from './user';
|
|
7
|
+
import { IPSChatPreviewLinkApi } from './preview-link';
|
|
8
|
+
import { IPSChatSearchApi } from './search';
|
|
9
|
+
import { IPSChatUploadApi } from './upload';
|
|
10
|
+
import { IPSChatNotificationApi } from './notification';
|
|
11
|
+
import { IPSChatSuperGroupsApi } from './super-groups';
|
|
12
|
+
import { IPSChatStickerApi } from './sticker';
|
|
13
|
+
import { IPSChatSessionApi } from './session';
|
|
14
|
+
import { IPSChatTagCategoryApi } from './tag-category';
|
|
15
|
+
export interface IPSChatApiClient {
|
|
16
|
+
userId: string;
|
|
17
|
+
configApi: IPSChatConfigApi;
|
|
18
|
+
threadApi: IPSChatThreadApi;
|
|
19
|
+
messageApi: IPSChatMessageApi;
|
|
20
|
+
userApi: IPSChatUserApi;
|
|
21
|
+
previewLinkApi: IPSChatPreviewLinkApi;
|
|
22
|
+
searchApi: IPSChatSearchApi;
|
|
23
|
+
stickerApi: IPSChatStickerApi;
|
|
24
|
+
uploadApi: IPSChatUploadApi;
|
|
25
|
+
notificationApi: IPSChatNotificationApi;
|
|
26
|
+
superGroupsApi: IPSChatSuperGroupsApi;
|
|
27
|
+
tagApi: IPSChatTagApi;
|
|
28
|
+
sessionApi: IPSChatSessionApi;
|
|
29
|
+
healthCheckBaseUrl: string;
|
|
30
|
+
getJWT(): string;
|
|
31
|
+
}
|
|
32
|
+
export declare class PSChatApiClient implements IPSChatApiClient {
|
|
33
|
+
userId: string;
|
|
34
|
+
configApi: IPSChatConfigApi;
|
|
35
|
+
threadApi: IPSChatThreadApi;
|
|
36
|
+
messageApi: IPSChatMessageApi;
|
|
37
|
+
userApi: IPSChatUserApi;
|
|
38
|
+
previewLinkApi: IPSChatPreviewLinkApi;
|
|
39
|
+
searchApi: IPSChatSearchApi;
|
|
40
|
+
stickerApi: IPSChatStickerApi;
|
|
41
|
+
uploadApi: IPSChatUploadApi;
|
|
42
|
+
notificationApi: IPSChatNotificationApi;
|
|
43
|
+
superGroupsApi: IPSChatSuperGroupsApi;
|
|
44
|
+
tagApi: IPSChatTagApi;
|
|
45
|
+
sessionApi: IPSChatSessionApi;
|
|
46
|
+
tagCategoryApi: IPSChatTagCategoryApi;
|
|
47
|
+
healthCheckBaseUrl: string;
|
|
48
|
+
private axiosDelegate;
|
|
49
|
+
private axiosUploadDelegate;
|
|
50
|
+
private constructor();
|
|
51
|
+
getJWT(): string;
|
|
52
|
+
static validateOptions(options?: PSChatApiClientOptions): void;
|
|
53
|
+
static createInstance(options: PSChatApiClientOptions): Promise<IPSChatApiClient>;
|
|
54
|
+
}
|
package/src/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const U=Y;(function(X,Q){const H=Y,J=X();while(!![]){try{const z=parseInt(H(0x96))/0x1*(parseInt(H(0xd6))/0x2)+parseInt(H(0x9a))/0x3*(parseInt(H(0xd7))/0x4)+parseInt(H(0xce))/0x5+-parseInt(H(0xcd))/0x6*(-parseInt(H(0xab))/0x7)+parseInt(H(0xbd))/0x8*(-parseInt(H(0xc3))/0x9)+-parseInt(H(0xad))/0xa*(parseInt(H(0xa2))/0xb)+parseInt(H(0xa0))/0xc;if(z===Q)break;else J['push'](J['shift']());}catch(G){J['push'](J['shift']());}}}(b,0x9e738));import{PSChatConfigApiImpl as y}from'./config';import{PSChatThreadApiImpl as v}from'./thread';import{PSChatTagApiImpl as N}from'./tag';import{PSChatMessageApiImpl as Z}from'./message';import{PSChatAxiosDelegate as T}from'./axios';function b(){const i=['userI','userA','tagCa','7FTbwsa','id\x20to','133230uoRkFD','hChec','ewLin','dApi','hApi','gApi','ate','erApi','super','tions','kBase','Group','ken','creat','onApi','Deleg','45016sKRDvR','ance','previ','Token','uploa','ppId','612GYLRfG','ext_u','/user','threa','sessi','gate','ser_i','\x20miss','yApi','Uploa','2022798AoslyO','2156940UBGgai','lth-c','eInst','sApi','searc','messa','tegor','heck','5924UPaCia','8TwkWZr','ing\x20a','Inval','tagAp','getJW','geApi','kApi','99vJuNGZ','id\x20or','dDele','confi','581313SwkvAl','axios','stick','ateOp','Url','healt','9856680ivLDyt','s/hea','1023ZjTheb','fetch','valid','appId','icati','notif'];b=function(){return i;};return b();}import{decodeJWT as P}from'./jwt';import{PSChatUserApiImpl as M}from'./user';import{PSChatPreviewLinkApiImpl as t}from'./preview-link';import{PSChatSearchApiImpl as K}from'./search';import{PSChatUploadApiImpl as D}from'./upload';import{PSChatNotificationApiImpl as k}from'./notification';import{generateBaseUrl as q,generateBaseUploadUrl as E}from'./utils';import{PS_CHAT_API_VERSION as V}from'./api-version';import{PSChatSuperGroupsApiImpl as S}from'./super-groups';import{PSChatStickerApiImpl as W}from'./sticker';function Y(r,y){const a=b();return Y=function(v,N){v=v-0x92;let p=a[v];return p;},Y(r,y);}import{PSChatSessionApiImpl as F}from'./session';import{PSChatTagCategoryApiImpl as L}from'./tag-category';export class PSChatApiClient{[U(0xa8)+'d'];[U(0x99)+U(0xb2)];[U(0xc6)+U(0xb0)];[U(0xd3)+U(0x94)];[U(0xa9)+'pi'];[U(0xbf)+U(0xaf)+U(0x95)];[U(0xd2)+U(0xb1)];[U(0x9c)+U(0xb4)];[U(0xc1)+U(0xb0)];[U(0xa7)+U(0xa6)+U(0xbb)];[U(0xb5)+U(0xb8)+U(0xd1)];[U(0x92)+'i'];[U(0xc7)+U(0xbb)];[U(0xaa)+U(0xd4)+U(0xcb)];[U(0x9f)+U(0xae)+U(0xb7)+U(0x9e)];[U(0x9b)+U(0xbc)+U(0xb3)];[U(0x9b)+U(0xcc)+U(0x98)+U(0xc8)];constructor(X,Q,J){const B=U;PSChatApiClient[B(0xa4)+B(0x9d)+B(0xb6)](J),this[B(0x9f)+B(0xae)+B(0xb7)+B(0x9e)]=''+q(J[B(0xa5)])+V+(B(0xc5)+B(0xa1)+B(0xcf)+B(0xd5)),this[B(0xa8)+'d']=X,this[B(0x9b)+B(0xbc)+B(0xb3)]=new T(Q,J,q(J[B(0xa5)])),this[B(0x9b)+B(0xcc)+B(0x98)+B(0xc8)]=new T(Q,J,E(J[B(0xa5)])),this[B(0x99)+B(0xb2)]=new y(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xc6)+B(0xb0)]=new v(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xd3)+B(0x94)]=new Z(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xa9)+'pi']=new M(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xbf)+B(0xaf)+B(0x95)]=new t(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xd2)+B(0xb1)]=new K(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0x9c)+B(0xb4)]=new W(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xc1)+B(0xb0)]=new D(this[B(0x9b)+B(0xcc)+B(0x98)+B(0xc8)]),this[B(0xa7)+B(0xa6)+B(0xbb)]=new k(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xb5)+B(0xb8)+B(0xd1)]=new S(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0x92)+'i']=new N(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xc7)+B(0xbb)]=new F(this[B(0x9b)+B(0xbc)+B(0xb3)]),this[B(0xaa)+B(0xd4)+B(0xcb)]=new L(this[B(0x9b)+B(0xbc)+B(0xb3)]);}[U(0x93)+'T'](){const u=U;return this[u(0x9b)+u(0xbc)+u(0xb3)][u(0x93)+'T']();}static[U(0xa4)+U(0x9d)+U(0xb6)](X){const j=U;if(!X?.[j(0xa5)])throw new Error(j(0xd9)+j(0x97)+j(0xca)+j(0xd8)+j(0xc2));}static async[U(0xba)+U(0xd0)+U(0xbe)](X){const e=U,Q=await X[e(0xa3)+e(0xc0)](),J=P(Q);if(!J||!J[e(0xc4)+e(0xc9)+'d'])throw new Error(e(0xd9)+e(0xac)+e(0xb9));return new PSChatApiClient(J[e(0xc4)+e(0xc9)+'d'],Q,X);}}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPSChatAxiosDelegate } from '../axios';
|
|
2
|
+
export interface IPSChatConfigApi {
|
|
3
|
+
fetchConfigs(): Promise<string[]>;
|
|
4
|
+
}
|
|
5
|
+
export declare class PSChatConfigApiImpl implements IPSChatConfigApi {
|
|
6
|
+
private axiosDelegate;
|
|
7
|
+
constructor(axiosDelegate: IPSChatAxiosDelegate);
|
|
8
|
+
fetchConfigs(): Promise<string[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var f=Y;(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x77))/0x1*(parseInt(p(0x6e))/0x2)+parseInt(p(0x70))/0x3+parseInt(p(0x76))/0x4*(parseInt(p(0x78))/0x5)+parseInt(p(0x72))/0x6*(-parseInt(p(0x6d))/0x7)+parseInt(p(0x71))/0x8+-parseInt(p(0x6f))/0x9+parseInt(p(0x79))/0xa;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x80fd1));function Y(r,y){var a=b();return Y=function(v,N){v=v-0x6b;var p=a[v];return p;},Y(r,y);}export class PSChatConfigApiImpl{[f(0x7b)+f(0x7a)+f(0x6b)];constructor(r){var Z=f;this[Z(0x7b)+Z(0x7a)+Z(0x6b)]=r;}[f(0x6c)+f(0x73)+'gs'](){var T=f;return this[T(0x7b)+T(0x7a)+T(0x6b)][T(0x74)](T(0x75)+'gs');}}function b(){var P=['ate','fetch','1049545zobHLP','326GwgEDx','7334001SpbWNv','13605xcyyGd','4081376yYVjJa','36xFevJi','Confi','get','confi','151176duhWzz','1055yisafq','15ZmLWvE','14427820ueZGJR','Deleg','axios'];b=function(){return P;};return b();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function Y(r,y){var a=b();return Y=function(v,N){v=v-0x188;var p=a[v];return p;},Y(r,y);}(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x189))/0x1*(parseInt(p(0x18f))/0x2)+-parseInt(p(0x193))/0x3*(parseInt(p(0x194))/0x4)+-parseInt(p(0x190))/0x5*(parseInt(p(0x191))/0x6)+-parseInt(p(0x192))/0x7*(-parseInt(p(0x18c))/0x8)+parseInt(p(0x18b))/0x9*(-parseInt(p(0x18e))/0xa)+-parseInt(p(0x18d))/0xb*(parseInt(p(0x18a))/0xc)+parseInt(p(0x188))/0xd;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x9f574));function b(){var f=['22077ZNXjem','40CfKUUW','6327563mJjZXL','3020aXLeTE','535110tonRRi','1726960GvceXT','12ThiVok','1699271jYVcDG','522933GnbLkj','20wQiOYA','23689718slHLvw','4zjtgpX','24WlHsXu'];b=function(){return f;};return b();}export*from'./config';
|
package/src/demo.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/demo.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const m=Y;(function(a,v){const P=Y,N=a();while(!![]){try{const f=parseInt(P(0x241))/0x1+-parseInt(P(0x1a7))/0x2*(-parseInt(P(0x1cf))/0x3)+parseInt(P(0x1dd))/0x4+-parseInt(P(0x1bd))/0x5*(-parseInt(P(0x18f))/0x6)+parseInt(P(0x208))/0x7*(-parseInt(P(0x191))/0x8)+parseInt(P(0x192))/0x9*(-parseInt(P(0x166))/0xa)+-parseInt(P(0x1fe))/0xb;if(f===v)break;else N['push'](N['shift']());}catch(Z){N['push'](N['shift']());}}}(b,0xcf2f4));import{PSChatApiClient as y}from'./client';function Y(r,y){const a=b();return Y=function(v,N){v=v-0x162;let p=a[v];return p;},Y(r,y);}function b(){const k=['vbSIs','qHWGB','4c2-5','.com/','qOtlH','6XnQVxO','kResp','80qqZBlG','18Fewrze','InR5c','cl9pZ','TY5OD','geApi','37655','messa','CSldw','y5WZv','b30-1','Zw9XS','BSca3','dXNlc','dApi','K1zkk','ZiI6M','1NiIs','29iEc','sIm5i','jpg','OJeWY','14lyhFpL','kwODk','mOLRZ','E-Yr_','d32I-','miimi','8c9-c','5Aivp','yJfs3','JSUzI','JkSPk','erApi','mEhk6','lengt','kien.','HiqTN','vNAqR','Q7V1a','NvjAE','d5b-9','GciOi','224yN','5883935VAdhJn','Ap1Vq','-aLFK','m165W','6ffPv','vZJ-D','1ylw6','previ','3p6Xp','ImV4c','ezmxE','dById','nYNjR','IwMTY','yI9W9','PK_w6','8qcoX','stick','717297BlkiUX','CI6MT','clGXW','-GQw7','ntIr4','rsvvg','bMTug','vtkN6','gify','K6Ojx','VHTQJ','fdXNl','BuLB8','RNpuw','2956884UrMqsv','Nhom\x20','aa9-9','KfPqt','owHNy','-kj1-','OjE2O','arROr','9qeSQ','YB-Xu','DY3ND','ien','oyGmM','wZ-Yr','kApi','pXVCJ','psOxf','zFWvo','d4fc7','zOTMx','eThre','scale','NxCoW','9T4Ls','xLRBx','d\x20=\x20','C53Bw','NywiZ','strin','Qp5vQ','FDmpY','ance','-nuI3','13408703TFMxlO','OiJwa','be080','UF55U','7PAIf','g5Nzc','d_id','zciLC','JleHR','qTwYt','73381AZTmxM','3Nywi','ewLin','fetch','2HKVz','jEUkJ','wMTYz','RlbmF','Kien','geByI','VTPOx','Previ','A-2hd','it6vE','xlLmN','q9ZSI','CI6Ik','onse\x20','Z3e3J','age','4PBkd','e93f1','tzqNU','1Jjc6','nwmMK','Threa','dZM8-','EXA8J','pAcXq','eInst','Y1I67','6Et3j','5LZWc','HDJI_','data','tyNeN','_nEvg','i_M-Y','Y5ODk','Xh0X3','OYTIJ','ancjj','hdWQi','https','13d-4','creat','j5P9v','-oTsg','L_6J0','eyJhb','_Bxh4','Kieen','da7-4','Ty19x','Tg5MD','jY4Nz','f8bc2','115798CCiiEf','TKvvF','lbjoQ','udF9p','38dae','TA_xN','-EFp-','0gWb-','Packa','FWaCx','Jksx4','eMess','Test','hXweO','ig0vQ','ZCI6I','HEsfw','lJ1tb','BlIjo','1yoAl','NNjnb','mAoHh','OfOTW','Y4NzI','cua\x20K','l90eX','304-9','y3yM5','km5qG','eSG-q','YiLCJ','U6GYw','LHBDW','7665340fkHrtm','f4f-t','log','b6xDy','tdQcs','cXUYi','3fZKJ','qHG8N','dtkin','OTMyM','AiRNR','5NTM3','CI6Ij','TL9hh','xfQ.i','15GcP','xt0KP','A0Bf9','pYXQi','JdIv6','3iNxv','zLmWd','jISep','OdgHD','NzY3M','mY_Ep','9.eyJ','XNjYW','woNAs','6ipgy','WZIoQ','://pi','HhX8L','BoIqO','threa','RUCBn'];b=function(){return k;};return b();}const i=m(0x239)+m(0x1bb)+m(0x1b0)+m(0x1a2)+m(0x193)+m(0x218)+m(0x1ec)+m(0x180)+m(0x232)+m(0x1ff)+m(0x181)+m(0x216)+m(0x18a)+m(0x1c6)+m(0x1d0)+m(0x22e)+m(0x171)+m(0x1f8)+m(0x22f)+m(0x20f)+m(0x244)+m(0x250)+m(0x23f)+m(0x1ca)+m(0x1f0)+m(0x17e)+m(0x205)+m(0x206)+m(0x1da)+m(0x194)+m(0x172)+m(0x258)+m(0x20e)+m(0x16f)+m(0x1e7)+m(0x163)+m(0x178)+m(0x1e3)+m(0x23e)+m(0x203)+m(0x1a4)+m(0x1a1)+m(0x195)+m(0x1a8)+m(0x209)+m(0x19e)+m(0x25a)+m(0x253)+m(0x174)+m(0x20c)+m(0x1c5)+m(0x238)+m(0x19a)+m(0x1d1)+m(0x254)+m(0x1cd)+m(0x21e)+m(0x199)+m(0x1d2)+m(0x237)+m(0x1d9)+m(0x24a)+m(0x24b)+m(0x220)+m(0x246)+m(0x186)+m(0x1e9)+m(0x228)+m(0x173)+m(0x20d)+m(0x224)+m(0x1be)+m(0x23d)+m(0x1d5)+m(0x1fd)+m(0x1c0)+m(0x1cb)+m(0x23a)+m(0x247)+m(0x1d8)+m(0x1aa)+m(0x1b3)+m(0x1b1)+m(0x1ac)+m(0x1a3)+m(0x1f4)+m(0x16d)+m(0x16e)+m(0x183)+m(0x1f5)+m(0x19d)+m(0x1dc)+m(0x1e1)+m(0x25d)+m(0x25c)+m(0x202)+m(0x1d4)+m(0x162)+m(0x201)+m(0x1f7)+m(0x1af)+m(0x18e)+m(0x1a0)+m(0x1ee)+m(0x1ea)+m(0x17a)+m(0x24e)+m(0x256)+m(0x175)+m(0x18b)+m(0x251)+m(0x1c2)+m(0x19c)+m(0x248)+m(0x207)+m(0x257)+m(0x1c7)+m(0x1db)+m(0x212)+m(0x169)+m(0x21a)+m(0x170)+m(0x16b)+m(0x1bf)+m(0x217)+m(0x176)+m(0x1b8)+m(0x167)+m(0x226)+m(0x215)+m(0x1c3)+m(0x1ed)+m(0x230)+m(0x21c)+m(0x1a9)+m(0x243)+m(0x17d)+m(0x189)+m(0x184)+m(0x179)+m(0x255)+m(0x22c)+m(0x17b)+m(0x1e5)+m(0x1f3)+m(0x1e6)+m(0x1a6)+m(0x24f)+m(0x1fb)+m(0x1c1)+m(0x1bc)+m(0x164)+m(0x1fa)+m(0x214)+m(0x222)+m(0x21f)+m(0x16c)+m(0x252)+m(0x22d)+m(0x242)+m(0x1b6)+m(0x22b)+m(0x187)+m(0x1e2)+m(0x165)+m(0x177)+m(0x1b9)+m(0x1d6)+m(0x1e0)+m(0x1e4)+m(0x227)+m(0x1cc)+m(0x236)+m(0x1c9)+m(0x1d3)+m(0x1b7)+m(0x1ae)+m(0x229)+m(0x223)+m(0x16a)+m(0x231)+m(0x182)+m(0x17c)+m(0x17f)+m(0x1ab)+'LA',r=async a=>{const M=m;try{const v=await a[M(0x188)+M(0x19f)][M(0x235)+M(0x1f1)+'ad']({'type':0x2,'member_ids':['1','2'],'name':M(0x1de)+M(0x259)+M(0x1e8),'avatar_url':M(0x233)+M(0x185)+M(0x1f2)+M(0x18d)+M(0x1b5)+M(0x1a5),'description':M(0x24d),'alias':M(0x210)});console[M(0x168)](M(0x188)+M(0x1f6)+v[M(0x22a)]?.[M(0x188)+M(0x204)]);}catch(N){console[M(0x168)](N);}},d=async(a,v)=>{const C=m;try{const N=await a[C(0x188)+C(0x19f)][C(0x20b)+C(0x221)+C(0x1c8)](v);console[C(0x168)](C(0x188)+C(0x1f6)+N[C(0x22a)]?.['id']);}catch(f){console[C(0x168)](f);}},h=async(v,N,f)=>{const t=m;try{const Z=await v[t(0x188)+t(0x19f)][t(0x20b)+t(0x221)+'ds'](N,f);console[t(0x168)](t(0x188)+t(0x1f6)+Z[t(0x22a)]?.[t(0x1b4)+'h']);}catch(T){console[t(0x168)](T);}},p=async(a,v)=>{const K=m;try{const N=await a[K(0x198)+K(0x196)][K(0x235)+K(0x24c)+K(0x21b)](v,{'request_id':K(0x1ef)+K(0x1ad)+K(0x234)+K(0x25b)+K(0x18c)+K(0x200)+K(0x197)+'b','body':{'text':K(0x23b)}});}catch(f){console[K(0x168)](f);}},l=async(a,v)=>{const D=m;try{const N=await a[D(0x1c4)+D(0x20a)+D(0x1eb)][D(0x20b)+D(0x213)+D(0x20a)+'k'](v);console[D(0x168)](D(0x1c4)+D(0x20a)+D(0x190)+D(0x219)+'=\x20'+JSON[D(0x1f9)+D(0x1d7)](N));}catch(f){console[D(0x168)](f);}},o=async()=>{const n=m,a=await y[n(0x235)+n(0x225)+n(0x1fc)]({'appId':'1','fetchToken':async()=>new Promise(v=>v(i))});try{const v=await a[n(0x1ce)+n(0x1b2)][n(0x20b)+n(0x249)+n(0x211)+'d'](n(0x21d)+n(0x1ba)+n(0x23c)+n(0x1df)+n(0x19b)+n(0x245)+n(0x240)+'c');}catch(N){console[n(0x168)](N);}};o();
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './config';
|
|
2
|
+
export * from './notification';
|
|
3
|
+
export * from './message';
|
|
4
|
+
export * from './preview-link';
|
|
5
|
+
export * from './search';
|
|
6
|
+
export * from './sticker';
|
|
7
|
+
export * from './super-groups';
|
|
8
|
+
export * from './thread';
|
|
9
|
+
export * from './upload';
|
|
10
|
+
export * from './user';
|
|
11
|
+
export * from './tag';
|
|
12
|
+
export * from './axios';
|
|
13
|
+
export * from './client';
|
|
14
|
+
export * from './jwt';
|
|
15
|
+
export * from './types';
|
|
16
|
+
export * from './utils';
|
|
17
|
+
export * from './session';
|
|
18
|
+
export * from './tag-category';
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x1b5))/0x1+parseInt(p(0x1ae))/0x2+parseInt(p(0x1b0))/0x3*(parseInt(p(0x1b1))/0x4)+parseInt(p(0x1b7))/0x5*(parseInt(p(0x1af))/0x6)+parseInt(p(0x1b4))/0x7*(parseInt(p(0x1b3))/0x8)+parseInt(p(0x1b8))/0x9*(parseInt(p(0x1b2))/0xa)+-parseInt(p(0x1b6))/0xb;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0xb3b57));export*from'./config';export*from'./notification';export*from'./message';function Y(r,y){var a=b();return Y=function(v,N){v=v-0x1ae;var p=a[v];return p;},Y(r,y);}export*from'./preview-link';export*from'./search';export*from'./sticker';export*from'./super-groups';export*from'./thread';export*from'./upload';export*from'./user';export*from'./tag';export*from'./axios';export*from'./client';export*from'./jwt';export*from'./types';function b(){var f=['141VyYGwP','73316iviZQF','470qVMHoJ','8hOPZQQ','1211889fIylhG','1148830kzwyIY','48629966swBvQZ','75JUUkjp','245538YwMnrO','2455578VwjiWI','185412saKaNT'];b=function(){return f;};return b();}export*from'./utils';export*from'./session';export*from'./tag-category';
|
package/src/jwt.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type PSJwtPayload = JwtPayload & {
|
|
2
|
+
exp: number;
|
|
3
|
+
ext_user_id: string;
|
|
4
|
+
ext_tenant_id: string;
|
|
5
|
+
user_type: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const decodeJWT: (token: string) => PSJwtPayload | undefined;
|
|
8
|
+
export declare const isJWTExpired: (jwt: PSJwtPayload) => boolean;
|
|
9
|
+
export interface JwtDecodeOptions {
|
|
10
|
+
header?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface JwtHeader {
|
|
13
|
+
typ?: string;
|
|
14
|
+
alg?: string;
|
|
15
|
+
kid?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface JwtPayload {
|
|
18
|
+
iss?: string;
|
|
19
|
+
sub?: string;
|
|
20
|
+
aud?: string[] | string;
|
|
21
|
+
exp?: number;
|
|
22
|
+
nbf?: number;
|
|
23
|
+
iat?: number;
|
|
24
|
+
jti?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare class InvalidTokenError extends Error {
|
|
27
|
+
}
|
package/src/jwt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function Y(r,y){const a=b();return Y=function(v,N){v=v-0x190;let p=a[v];return p;},Y(r,y);}const m=Y;(function(y,a){const P=Y,v=y();while(!![]){try{const N=-parseInt(P(0x197))/0x1+-parseInt(P(0x196))/0x2*(-parseInt(P(0x1b6))/0x3)+-parseInt(P(0x190))/0x4+-parseInt(P(0x1b4))/0x5*(parseInt(P(0x19c))/0x6)+parseInt(P(0x1c3))/0x7+-parseInt(P(0x1a9))/0x8*(parseInt(P(0x1b3))/0x9)+-parseInt(P(0x1a4))/0xa*(-parseInt(P(0x1bd))/0xb);if(N===a)break;else v['push'](v['shift']());}catch(p){v['push'](v['shift']());}}}(b,0x3cf8c));function b(){const D=['parse','base6','on\x20fo','1558179zVqirH','435895keMhNt','repla','682071VYOClZ','name','charC','rt\x20#','inval','se64\x20','s\x20not','838849nDOqQU','ing\x20i','lengt','toStr','he\x20co','split','1176308dBcfhb','ing','proto','enErr','pecif','4\x20str','r\x20par','odeAt','618348OXqBPR','art\x20#','getTi','idTok','heade','rrect','2UQuEhL','13960sDZGRI','must\x20','be\x20a\x20','ng\x20pa','id\x20to','18RbXHwa','id\x20ba','erCas','ken\x20s','\x20of\x20t','ied:\x20','Inval','exp','60qXqTUZ','t\x20#','toUpp','atob','missi','8dNWHQq','messa','strin','type','for\x20p','id\x20js','\x20leng'];b=function(){return D;};return b();}import{decode as r}from'base-64';global[m(0x1a7)]=r;export const decodeJWT=y=>{try{return d(y,{'header':!0x1});}catch{return;}},isJWTExpired=y=>y[m(0x1a3)]-new Date()[m(0x192)+'me']()/0x3e8<0xa;export class InvalidTokenError extends Error{}InvalidTokenError[m(0x1c5)+m(0x1ac)][m(0x1b7)]=m(0x1a2)+m(0x193)+m(0x1c6)+'or';function i(y){const M=m;return decodeURIComponent(atob(y)[M(0x1b5)+'ce'](/(.)/g,(a,v)=>{const C=M;let N=v[C(0x1b8)+C(0x1ca)](0x0)[C(0x1c0)+C(0x1c4)](0x10)[C(0x1a6)+C(0x19e)+'e']();return N[C(0x1bf)+'h']<0x2&&(N='0'+N),'%'+N;}));}function s(y){const t=m;let a=y[t(0x1b5)+'ce'](/-/g,'+')[t(0x1b5)+'ce'](/_/g,'/');switch(a[t(0x1bf)+'h']%0x4){case 0x0:break;case 0x2:a+='==';break;case 0x3:a+='=';break;default:throw new Error(t(0x1b1)+t(0x1c8)+t(0x1be)+t(0x1bc)+t(0x1a0)+t(0x1c1)+t(0x195)+t(0x1af)+'th');}try{return i(a);}catch{return atob(a);}}function d(y,v){const K=m;if(typeof y!=K(0x1ab)+'g')throw new InvalidTokenError(K(0x1a2)+K(0x19b)+K(0x19f)+K(0x1c7)+K(0x1a1)+K(0x198)+K(0x199)+K(0x1ab)+'g');v||={};const N=v[K(0x194)+'r']===!0x0?0x0:0x1,p=y[K(0x1c2)]('.')[N];if(typeof p!=K(0x1ab)+'g')throw new InvalidTokenError(K(0x1a2)+K(0x19b)+K(0x19f)+K(0x1c7)+K(0x1a1)+K(0x1a8)+K(0x19a)+K(0x1b9)+(N+0x1));let f;try{f=s(p);}catch(Z){throw new InvalidTokenError(K(0x1a2)+K(0x19b)+K(0x19f)+K(0x1c7)+K(0x1a1)+K(0x1ba)+K(0x19d)+K(0x1bb)+K(0x1ad)+K(0x191)+(N+0x1)+'\x20('+Z[K(0x1aa)+'ge']+')');}try{return JSON[K(0x1b0)](f);}catch(T){throw new InvalidTokenError(K(0x1a2)+K(0x19b)+K(0x19f)+K(0x1c7)+K(0x1a1)+K(0x1ba)+K(0x1ae)+K(0x1b2)+K(0x1c9)+K(0x1a5)+(N+0x1)+'\x20('+T[K(0x1aa)+'ge']+')');}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0xcd))/0x1*(parseInt(p(0xc6))/0x2)+-parseInt(p(0xc8))/0x3*(-parseInt(p(0xc7))/0x4)+parseInt(p(0xc5))/0x5+-parseInt(p(0xcc))/0x6+-parseInt(p(0xca))/0x7+-parseInt(p(0xcb))/0x8+parseInt(p(0xc9))/0x9;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x1b358));export*from'./message';function Y(r,y){var a=b();return Y=function(v,N){v=v-0xc5;var p=a[v];return p;},Y(r,y);}function b(){var f=['487926dUtxvG','3671Tlqizq','681985tCYmgj','116wfdBDv','28156ntNrIv','48UbxFCz','427824uENgXc','1312626ZiHRzo','1033504KXvSYu'];b=function(){return f;};return b();}export*from'./types';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { IPSChatAxiosDelegate } from '../axios';
|
|
2
|
+
import { PSResponse } from '../types';
|
|
3
|
+
import { PSCreateMessageRequestDto, PSCreateMessageResponseDto, PSDeleteMessageLevel, PSForwardMessagesRequestDto, PSMessageChatBotCommandDto, PSMessageDto, PSMessageMetadataOptionDto } from './types';
|
|
4
|
+
export interface IPSChatMessageApi {
|
|
5
|
+
createMessage(threadId: string, request: PSCreateMessageRequestDto): Promise<PSResponse<PSCreateMessageResponseDto>>;
|
|
6
|
+
editMessage(threadId: string, messageId: number, request: PSCreateMessageRequestDto): Promise<PSResponse<any>>;
|
|
7
|
+
deleteMessage(threadId: string, messageId: number, level: PSDeleteMessageLevel): Promise<PSResponse<any>>;
|
|
8
|
+
fetchMessageById(threadId: string, messageId: number): Promise<PSResponse<PSMessageDto>>;
|
|
9
|
+
fetchMessages(threadId: string, messageId: number, nextLimit?: number, prevLimit?: number): Promise<PSResponse<PSMessageDto[]>>;
|
|
10
|
+
markSeenMessage(threadId: string, messageId: number): Promise<PSResponse<any>>;
|
|
11
|
+
forwardMessages(request: PSForwardMessagesRequestDto): Promise<PSResponse<any>>;
|
|
12
|
+
pinMessage(threadId: string, messageId: number, requestId: string): Promise<PSResponse<any>>;
|
|
13
|
+
unpinMessage(threadId: string, messageId: number, requestId: string): Promise<PSResponse<any>>;
|
|
14
|
+
fetchPinnedMessages(threadId: string): Promise<PSResponse<PSMessageDto[]>>;
|
|
15
|
+
react(threadId: string, messageId: number, emojiName: string): Promise<PSResponse<any>>;
|
|
16
|
+
unreact(threadId: string, messageId: number, emojiName: string): Promise<PSResponse<any>>;
|
|
17
|
+
vote(threadId: string, messageId: number, pollId: string, optionId: string): Promise<PSResponse<any>>;
|
|
18
|
+
unvote(threadId: string, messageId: number, pollId: string, optionId: string): Promise<PSResponse<any>>;
|
|
19
|
+
addOptionPoll(threadId: string, messageId: number, pollId: string, textOption: string): Promise<PSResponse<PSMessageMetadataOptionDto>>;
|
|
20
|
+
fetchUsersVoted(threadId: string, messageId: number, pollId: string, optionId: string, userId: string, limit: number): Promise<PSResponse<any>>;
|
|
21
|
+
fetchBotCommands(botId: string): Promise<PSResponse<PSMessageChatBotCommandDto[]>>;
|
|
22
|
+
}
|
|
23
|
+
export declare class PSChatMessageApiImpl implements IPSChatMessageApi {
|
|
24
|
+
private axiosDelegate;
|
|
25
|
+
constructor(axiosDelegate: IPSChatAxiosDelegate);
|
|
26
|
+
createMessage(threadId: string, request: PSCreateMessageRequestDto): Promise<PSResponse<PSCreateMessageResponseDto>>;
|
|
27
|
+
editMessage(threadId: string, messageId: number, request: PSCreateMessageRequestDto): Promise<PSResponse<any>>;
|
|
28
|
+
deleteMessage(threadId: string, messageId: number, level: PSDeleteMessageLevel): Promise<PSResponse<any>>;
|
|
29
|
+
fetchMessageById(threadId: string, messageId: number): Promise<PSResponse<PSMessageDto>>;
|
|
30
|
+
fetchMessages(threadId: string, messageId: number, nextLimit?: number, prevLimit?: number): Promise<PSResponse<PSMessageDto[]>>;
|
|
31
|
+
markSeenMessage(threadId: string, messageId: number): Promise<PSResponse<any>>;
|
|
32
|
+
forwardMessages(request: PSForwardMessagesRequestDto): Promise<PSResponse<any>>;
|
|
33
|
+
pinMessage(threadId: string, messageId: number, requestId: string): Promise<PSResponse<any>>;
|
|
34
|
+
unpinMessage(threadId: string, messageId: number, requestId: string): Promise<PSResponse<any>>;
|
|
35
|
+
fetchPinnedMessages(threadId: string): Promise<PSResponse<PSMessageDto[]>>;
|
|
36
|
+
react(threadId: string, messageId: number, emojiName: string): Promise<PSResponse<any>>;
|
|
37
|
+
unreact(threadId: string, messageId: number, emojiName: string): Promise<PSResponse<any>>;
|
|
38
|
+
vote(threadId: string, messageId: number, pollId: string, optionId: string): Promise<PSResponse<any>>;
|
|
39
|
+
unvote(threadId: string, messageId: number, pollId: string, optionId: string): Promise<PSResponse<any>>;
|
|
40
|
+
addOptionPoll(threadId: string, messageId: number, pollId: string, textOption: string): Promise<PSResponse<PSMessageMetadataOptionDto>>;
|
|
41
|
+
fetchUsersVoted(threadId: string, messageId: number, pollId: string, optionId: string, userId: string, limit: number): Promise<PSResponse<any>>;
|
|
42
|
+
fetchBotCommands(botId: string): Promise<PSResponse<PSMessageChatBotCommandDto[]>>;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function Y(r,y){const a=b();return Y=function(v,N){v=v-0x79;let p=a[v];return p;},Y(r,y);}const P=Y;(function(y,v){const T=Y,N=y();while(!![]){try{const p=-parseInt(T(0xc6))/0x1*(-parseInt(T(0x80))/0x2)+parseInt(T(0x7e))/0x3*(parseInt(T(0xb7))/0x4)+parseInt(T(0x86))/0x5*(-parseInt(T(0xc9))/0x6)+-parseInt(T(0x9e))/0x7+parseInt(T(0x85))/0x8*(parseInt(T(0x8f))/0x9)+parseInt(T(0xa0))/0xa*(parseInt(T(0x79))/0xb)+parseInt(T(0xaf))/0xc*(-parseInt(T(0xac))/0xd);if(p===v)break;else N['push'](N['shift']());}catch(f){N['push'](N['shift']());}}}(b,0x523ea));import{PS_CHAT_API_VERSION as r}from'../api-version';export class PSChatMessageApiImpl{[P(0xce)+P(0xb8)+P(0x81)];constructor(y){const m=P;this[m(0xce)+m(0xb8)+m(0x81)]=y;}[P(0x8e)+P(0xc8)+P(0x91)](y,v){const M=P;return this[M(0xce)+M(0xb8)+M(0x81)][M(0x8a)](r+(M(0xcb)+M(0xc7))+y+(M(0x7b)+M(0xbf)),v);}[P(0xa5)+P(0xa4)+'e'](y,v,N){const C=P;return this[C(0xce)+C(0xb8)+C(0x81)][C(0xb0)](r+(C(0xcb)+C(0xc7))+y+(C(0x7b)+C(0x9f))+v,N);}[P(0xbe)+P(0xc8)+P(0x91)](y,v,N){const t=P;return this[t(0xce)+t(0xb8)+t(0x81)][t(0xbe)+'e'](r+(t(0xcb)+t(0xc7))+y+(t(0x7b)+t(0xc2)+t(0xa9)+t(0x97)+'s=')+v+(t(0x93)+'l=')+N);}[P(0x94)+P(0x87)+P(0x9b)+'d'](y,v){const K=P;return this[K(0xce)+K(0xb8)+K(0x81)][K(0xc5)](r+(K(0xcb)+K(0xc7))+y+(K(0x7b)+K(0x9f))+v);}[P(0x94)+P(0x87)+P(0xc0)](y,v,N,p){const D=P;let f;return N?f=D(0xcd)+D(0x82)+'='+N:p?f=D(0xb1)+D(0x82)+'='+p:f='',this[D(0xce)+D(0xb8)+D(0x81)][D(0xc5)](r+(D(0xcb)+D(0xc7))+y+(D(0x7b)+D(0xc2)+D(0xa9)+D(0x97)+'=')+v+'&'+f);}[P(0xa1)+P(0x84)+P(0xd1)](y,v){const n=P;return this[n(0xce)+n(0xb8)+n(0x81)][n(0x8a)](r+(n(0xcb)+n(0xc7))+y+(n(0x7b)+n(0x9f))+v+(n(0x8c)+'ed'));}[P(0xb9)+P(0x96)+P(0xbd)](y){const k=P;return this[k(0xce)+k(0xb8)+k(0x81)][k(0x8a)](r+(k(0xcb)+k(0xad)+k(0xa4)+k(0xa6)+k(0xab)),y);}[P(0x89)+P(0xd1)](y,v,N){const A=P;return this[A(0xce)+A(0xb8)+A(0x81)][A(0x8a)](r+(A(0xcb)+A(0xc7))+y+(A(0x7b)+A(0x9f))+v+(A(0xcc)+A(0xae)+A(0xcf)+'=')+N);}[P(0x9a)+P(0x87)+'ge'](y,v,N){const d=P;return this[d(0xce)+d(0xb8)+d(0x81)][d(0xbe)+'e'](r+(d(0xcb)+d(0xc7))+y+(d(0x7b)+d(0x9f))+v+(d(0xcc)+d(0xae)+d(0xcf)+'=')+N);}[P(0x94)+P(0x92)+P(0xa2)+P(0xbf)](y){const I=P;return this[I(0xce)+I(0xb8)+I(0x81)][I(0xc5)](r+(I(0xcb)+I(0xc7))+y+(I(0x83)+I(0xa9)+I(0xc0)));}[P(0xa3)](y,v,N){const q=P;return this[q(0xce)+q(0xb8)+q(0x81)][q(0x8a)](r+(q(0xcb)+q(0xc7))+y+(q(0x7b)+q(0x9f))+v+(q(0x7c)+q(0xd0)+'/')+N,void 0x0,{'headers':{'Content-Type':q(0xba)+q(0x99)+q(0x88)+q(0xc3)+q(0xa7)+q(0x7d)+q(0xb3)}});}[P(0x7a)+'ct'](y,v,N){const E=P;return this[E(0xce)+E(0xb8)+E(0x81)][E(0xbe)+'e'](r+(E(0xcb)+E(0xc7))+y+(E(0x7b)+E(0x9f))+v+(E(0x7c)+E(0xd0)+'/')+N,{'headers':{'Content-Type':E(0xba)+E(0x99)+E(0x88)+E(0xc3)+E(0xa7)+E(0x7d)+E(0xb3)}});}[P(0x98)](y,v,N,p){const V=P;return this[V(0xce)+V(0xb8)+V(0x81)][V(0x8a)](r+(V(0xcb)+V(0xc7))+y+(V(0x7b)+V(0x9f))+v+(V(0xca)+'s/')+N+(V(0x9c)+V(0x95))+p+V(0xaa));}[P(0x90)+'e'](y,v,N,p){const S=P;return this[S(0xce)+S(0xb8)+S(0x81)][S(0xbe)+'e'](r+(S(0xcb)+S(0xc7))+y+(S(0x7b)+S(0x9f))+v+(S(0xca)+'s/')+N+(S(0x9c)+S(0x95))+p+S(0xaa));}[P(0xc1)+P(0x8d)+P(0xb5)](y,v,N,p){const g=P;return this[g(0xce)+g(0xb8)+g(0x81)][g(0x8a)](r+(g(0xcb)+g(0xc7))+y+(g(0x7b)+g(0x9f))+v+(g(0xca)+'s/')+N+(g(0x9c)+g(0xbb)),{'text':p});}[P(0x94)+P(0xb4)+P(0xbc)](y,v,N,p,f,Z){const W=P;return this[W(0xce)+W(0xb8)+W(0x81)][W(0xc5)](r+(W(0xcb)+W(0xc7))+y+(W(0x7b)+W(0x9f))+v+(W(0xca)+'s/')+N+(W(0x9c)+W(0x95))+p+(W(0xaa)+W(0x9d)+W(0xb2)+'=')+f+(W(0x7f)+'t=')+Z);}[P(0x94)+P(0xa8)+P(0xd2)+'s'](y){const F=P;return this[F(0xce)+F(0xb8)+F(0x81)][F(0xc5)](r+(F(0x8b)+'/')+y+(F(0xc4)+F(0xb6)));}}function b(){const L=['editM','es/fo','rm-ur','BotCo','messa','/vote','rward','13CvGaZR','ads/m','reque','8513052ynMGqK','patch','prev_','er_id','ded','Users','oll','ands','842132heUjbo','Deleg','forwa','appli','ons','Voted','sages','delet','ages','ges','addOp','ages?','ww-fo','/comm','get','208122PVJUzc','ads/','eMess','230610iHoetS','/poll','/thre','/pin?','next_','axios','st_id','tions','ssage','mmand','12958rYgQVh','unrea','/mess','/reac','lenco','9YMDpCU','&limi','4xvFLUG','ate','limit','/pin_','eenMe','7048oZFYAH','20nWLxRS','Messa','n/x-w','pinMe','post','/bots','/view','tionP','creat','873fxTMTz','unvot','age','Pinne','&leve','fetch','ons/','rdMes','ge_id','vote','catio','unpin','geByI','/opti','s?vot','3911481kHHPoI','ages/','5310yJTVUK','markS','dMess','react','essag'];b=function(){return L;};return b();}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { PSThreadType } from '../thread';
|
|
2
|
+
import { PSUserDto } from '../user/types';
|
|
3
|
+
export type PSCreateMessageRequestDto = {
|
|
4
|
+
request_id: string;
|
|
5
|
+
body: PSCreateMessageBodyRequestDto;
|
|
6
|
+
};
|
|
7
|
+
export type PSCreateMessageBodyRequestDto = {
|
|
8
|
+
text?: string;
|
|
9
|
+
reply_to_msg_id?: number;
|
|
10
|
+
mention_ids?: string[];
|
|
11
|
+
metadata?: PSCreateMessageBodyMetadataRequestDto[];
|
|
12
|
+
postback?: string;
|
|
13
|
+
};
|
|
14
|
+
export type PSCreateMessageBodyMetadataRequestDto = {
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
sitename?: string;
|
|
18
|
+
src_url?: string;
|
|
19
|
+
src_thumb_url?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
size?: number;
|
|
23
|
+
path?: string;
|
|
24
|
+
bucket?: string;
|
|
25
|
+
width?: number;
|
|
26
|
+
height?: number;
|
|
27
|
+
duration?: number;
|
|
28
|
+
allow_user_suggestion?: number;
|
|
29
|
+
allow_multiple_votes?: number;
|
|
30
|
+
incognito_mode?: number;
|
|
31
|
+
close_at?: number;
|
|
32
|
+
options?: PSCreateMessageBodyMetadataOptionRequestDto[];
|
|
33
|
+
type: PSMessageMetadataType;
|
|
34
|
+
file_type?: PSMessageMetadataFileType;
|
|
35
|
+
};
|
|
36
|
+
export type PSCreateMessageBodyMetadataOptionRequestDto = {
|
|
37
|
+
text: string;
|
|
38
|
+
};
|
|
39
|
+
export type PSForwardMessagesRequestDto = {
|
|
40
|
+
src_thread_id: string;
|
|
41
|
+
src_msg_ids: number[];
|
|
42
|
+
target_id: string;
|
|
43
|
+
target_type: PSThreadType;
|
|
44
|
+
};
|
|
45
|
+
export declare enum PSDeleteMessageLevel {
|
|
46
|
+
ME = 1,
|
|
47
|
+
ALL = 2
|
|
48
|
+
}
|
|
49
|
+
export type PSCreateMessageResponseDto = {
|
|
50
|
+
thread_id: string;
|
|
51
|
+
request_id: string;
|
|
52
|
+
event_id: string;
|
|
53
|
+
message_id: number;
|
|
54
|
+
};
|
|
55
|
+
export type PSMessageDto = {
|
|
56
|
+
id: number;
|
|
57
|
+
body?: PSMessageBodyDto;
|
|
58
|
+
reactions?: PSMessageReactionDto[];
|
|
59
|
+
created_at: number;
|
|
60
|
+
edited_at?: number;
|
|
61
|
+
sender: PSUserDto;
|
|
62
|
+
request_id: string;
|
|
63
|
+
delete_level?: PSDeleteMessageLevel;
|
|
64
|
+
viewed_user_ids?: string[];
|
|
65
|
+
pinned_at?: number;
|
|
66
|
+
};
|
|
67
|
+
export type PSMessageReactionDto = {
|
|
68
|
+
name: string;
|
|
69
|
+
ext_user_ids: string[];
|
|
70
|
+
count: number;
|
|
71
|
+
};
|
|
72
|
+
export type PSMessageBodyDto = {
|
|
73
|
+
text?: string;
|
|
74
|
+
is_rtf: false;
|
|
75
|
+
metadata?: PSMessageMetadataDto[];
|
|
76
|
+
action_note?: PSMessageActionNoteDto;
|
|
77
|
+
reply_to_msg_id?: number;
|
|
78
|
+
ref_object?: PSMessageBodyRefObjectDto;
|
|
79
|
+
mention_ids?: string[];
|
|
80
|
+
forward_from?: PSMessageForwardFromDto;
|
|
81
|
+
};
|
|
82
|
+
export type PSMessageBodyRefObjectDto = {
|
|
83
|
+
messages?: PSMessageDto[];
|
|
84
|
+
participants?: PSMessageParticipantsDto;
|
|
85
|
+
};
|
|
86
|
+
export type PSMessageParticipantsDto = {
|
|
87
|
+
member: PSUserDto;
|
|
88
|
+
member_ids?: string[];
|
|
89
|
+
member_count?: number;
|
|
90
|
+
};
|
|
91
|
+
export declare enum PSMessageMetadataType {
|
|
92
|
+
TEXT = 1,
|
|
93
|
+
IMAGE = 2,
|
|
94
|
+
VIDEO = 3,
|
|
95
|
+
PREVIEW_LINK = 4,
|
|
96
|
+
POLL = 5,
|
|
97
|
+
FILE = 6,
|
|
98
|
+
AUDIO = 7,
|
|
99
|
+
STICKER = 8,
|
|
100
|
+
JSON = 10,
|
|
101
|
+
QUICK_REPLY = 11,
|
|
102
|
+
CAROUSEL = 12,
|
|
103
|
+
MENU = 13,
|
|
104
|
+
START_SESSION = 14,
|
|
105
|
+
END_SESSION = 15
|
|
106
|
+
}
|
|
107
|
+
export declare enum PSMessageMetadataFileType {
|
|
108
|
+
PNG = "png",
|
|
109
|
+
GIF = "gif",
|
|
110
|
+
WEBP = "webp"
|
|
111
|
+
}
|
|
112
|
+
export type PSMessageMetadataDto = {
|
|
113
|
+
id?: string;
|
|
114
|
+
name?: string;
|
|
115
|
+
size?: number;
|
|
116
|
+
width?: number;
|
|
117
|
+
height?: number;
|
|
118
|
+
src_url?: string;
|
|
119
|
+
src_thumb_url?: string;
|
|
120
|
+
title?: string;
|
|
121
|
+
description?: string;
|
|
122
|
+
sitename?: string;
|
|
123
|
+
type: PSMessageMetadataType;
|
|
124
|
+
path?: string;
|
|
125
|
+
bucket?: string;
|
|
126
|
+
duration?: number;
|
|
127
|
+
json?: string;
|
|
128
|
+
allow_user_suggestion?: number;
|
|
129
|
+
allow_multiple_votes?: number;
|
|
130
|
+
incognito_mode?: number;
|
|
131
|
+
close_at?: number;
|
|
132
|
+
options?: PSMessageMetadataOptionDto[];
|
|
133
|
+
my_votes?: string[];
|
|
134
|
+
quick_reply?: PSMessageMetadataQuickReplyDto;
|
|
135
|
+
cards?: PSMessageMetadataCardDto[];
|
|
136
|
+
menu?: PSMessageMetadataMenuDto[];
|
|
137
|
+
file_type?: PSMessageMetadataFileType;
|
|
138
|
+
};
|
|
139
|
+
export type PSMessageMetadataOptionDto = {
|
|
140
|
+
id: string;
|
|
141
|
+
text: string;
|
|
142
|
+
vote_count?: number;
|
|
143
|
+
partial_voter_list?: string[];
|
|
144
|
+
};
|
|
145
|
+
export type PSMessageActionNoteDto = {
|
|
146
|
+
ref_ids?: number[];
|
|
147
|
+
type: PSMessageActionNoteType;
|
|
148
|
+
};
|
|
149
|
+
export declare enum PSMessageActionNoteType {
|
|
150
|
+
CREATE_GROUP = 1,
|
|
151
|
+
ADD_MEMBER = 2,
|
|
152
|
+
REMOVE_MEMBER = 3,
|
|
153
|
+
JOIN_GROUP = 4,
|
|
154
|
+
LEAVE_GROUP = 5,
|
|
155
|
+
PIN = 8,
|
|
156
|
+
UNPIN = 9,
|
|
157
|
+
GROUP_NAME_UPDATED = 10,
|
|
158
|
+
GROUP_AVATAR_UPDATED = 11,
|
|
159
|
+
GROUP_DESCRIPTION_UPDATED = 12,
|
|
160
|
+
JOIN_PUBLIC_GROUP = 13,
|
|
161
|
+
MEMBER_ADDED_BY_SYSTEM = 14,
|
|
162
|
+
MEMBER_REMOVED_BY_SYSTEM = 15,
|
|
163
|
+
BLOCK_MEMBER = 16,
|
|
164
|
+
UN_BLOCK_MEMBER = 17
|
|
165
|
+
}
|
|
166
|
+
export type PSMessageForwardFromDto = {
|
|
167
|
+
src_thread_id: string;
|
|
168
|
+
src_msg_id: number;
|
|
169
|
+
sender: PSUserDto;
|
|
170
|
+
};
|
|
171
|
+
export type PSMessageMetadataQuickReplyDto = {
|
|
172
|
+
items: PSMessageMetadataChatBotButtonDto[];
|
|
173
|
+
};
|
|
174
|
+
export type PSMessageMetadataCardDto = {
|
|
175
|
+
title: string;
|
|
176
|
+
sub_title: string;
|
|
177
|
+
image_url: string;
|
|
178
|
+
buttons: PSMessageMetadataChatBotButtonDto[];
|
|
179
|
+
};
|
|
180
|
+
export type PSMessageMetadataChatBotButtonDto = {
|
|
181
|
+
image_url: string;
|
|
182
|
+
label: string;
|
|
183
|
+
action: PSMessageMetadataChatBotButtonActionDto;
|
|
184
|
+
};
|
|
185
|
+
export type PSMessageMetadataChatBotButtonActionDto = {
|
|
186
|
+
type: PSMessageMetadataChatBotButtonActionType;
|
|
187
|
+
payload: string;
|
|
188
|
+
};
|
|
189
|
+
export declare enum PSMessageMetadataChatBotButtonActionType {
|
|
190
|
+
URI = 1,
|
|
191
|
+
POST_BACK = 2,
|
|
192
|
+
MESSAGE = 3
|
|
193
|
+
}
|
|
194
|
+
export type PSMessageMetadataMenuDto = {
|
|
195
|
+
label: string;
|
|
196
|
+
children?: PSMessageMetadataMenuDto[];
|
|
197
|
+
action?: PSMessageMetadataChatBotButtonActionDto;
|
|
198
|
+
};
|
|
199
|
+
export type PSLastMessageDto = {
|
|
200
|
+
id: number;
|
|
201
|
+
body?: PSLastMessageBodyDto;
|
|
202
|
+
created_at: number;
|
|
203
|
+
edited_at?: number;
|
|
204
|
+
sender: PSUserDto;
|
|
205
|
+
request_id: string;
|
|
206
|
+
delete_level?: PSDeleteMessageLevel;
|
|
207
|
+
};
|
|
208
|
+
export type PSLastMessageBodyDto = {
|
|
209
|
+
text?: string;
|
|
210
|
+
is_rtf: false;
|
|
211
|
+
poll_id?: string;
|
|
212
|
+
mention_ids?: string[];
|
|
213
|
+
metadata?: PSMessageMetadataDto[];
|
|
214
|
+
action_note?: PSMessageActionNoteDto;
|
|
215
|
+
ref_object?: PSMessageBodyRefObjectDto;
|
|
216
|
+
};
|
|
217
|
+
export type PSMessageChatBotCommandDto = {
|
|
218
|
+
command: string;
|
|
219
|
+
name: string;
|
|
220
|
+
description?: string;
|
|
221
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function Y(r,y){var a=b();return Y=function(v,N){v=v-0xa4;var p=a[v];return p;},Y(r,y);}function b(){var M=['_SESS','_AVAT','BLOCK','E_GRO','ESSIO','R_REM','14tyQYtP','MEMBE','_REPL','PNG','AUDIO','LEAVE','_UPDA','TED','E_MEM','SEL','BY_SY','838749SFNyvq','1470486Nxccil','URI','_DESC','C_GRO','EMBER','POST_','MESSA','BER','UNPIN','_MEMB','FILE','RIPTI','ADD_M','ALL','MENU','OCK_M','JOIN_','START','BACK','EW_LI','2813168NsqAlb','7TxBFbU','_SYST','_GROU','QUICK','AR_UP','PREVI','ED_BY','CAROU','gif','CREAT','JSON','STEM','END_S','DATED','POLL','196464iPDOeS','png','3253420aHIoCv','PUBLI','ION','webp','OVED_','REMOV','18251388XZXEke','STICK','UN_BL','ON_UP','VIDEO','9780785okhoBg','TEXT','_NAME','GIF','PIN','WEBP','R_ADD','IMAGE','GROUP'];b=function(){return M;};return b();}(function(r,y){var p=Y,a=r();while(!![]){try{var v=-parseInt(p(0xa9))/0x1+-parseInt(p(0xe9))/0x2*(-parseInt(p(0xa8))/0x3)+parseInt(p(0xcf))/0x4+-parseInt(p(0xda))/0x5+parseInt(p(0xcd))/0x6*(-parseInt(p(0xbe))/0x7)+-parseInt(p(0xbd))/0x8+parseInt(p(0xd5))/0x9;if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0xf10c7));export var PSDeleteMessageLevel;(function(r){var f=Y;r[r['ME']=0x1]='ME',r[r[f(0xb6)]=0x2]=f(0xb6);}(PSDeleteMessageLevel||(PSDeleteMessageLevel={})));export var PSMessageMetadataType;(function(r){var Z=Y;r[r[Z(0xdb)]=0x1]=Z(0xdb),r[r[Z(0xe1)]=0x2]=Z(0xe1),r[r[Z(0xd9)]=0x3]=Z(0xd9),r[r[Z(0xc3)+Z(0xbc)+'NK']=0x4]=Z(0xc3)+Z(0xbc)+'NK',r[r[Z(0xcc)]=0x5]=Z(0xcc),r[r[Z(0xb3)]=0x6]=Z(0xb3),r[r[Z(0xed)]=0x7]=Z(0xed),r[r[Z(0xd6)+'ER']=0x8]=Z(0xd6)+'ER',r[r[Z(0xc8)]=0xa]=Z(0xc8),r[r[Z(0xc1)+Z(0xeb)+'Y']=0xb]=Z(0xc1)+Z(0xeb)+'Y',r[r[Z(0xc5)+Z(0xa6)]=0xc]=Z(0xc5)+Z(0xa6),r[r[Z(0xb7)]=0xd]=Z(0xb7),r[r[Z(0xba)+Z(0xe3)+Z(0xd1)]=0xe]=Z(0xba)+Z(0xe3)+Z(0xd1),r[r[Z(0xca)+Z(0xe7)+'N']=0xf]=Z(0xca)+Z(0xe7)+'N';}(PSMessageMetadataType||(PSMessageMetadataType={})));export var PSMessageMetadataFileType;(function(r){var T=Y;r[T(0xec)]=T(0xce),r[T(0xdd)]=T(0xc6),r[T(0xdf)]=T(0xd2);}(PSMessageMetadataFileType||(PSMessageMetadataFileType={})));export var PSMessageActionNoteType;(function(r){var P=Y;r[r[P(0xc7)+P(0xe6)+'UP']=0x1]=P(0xc7)+P(0xe6)+'UP',r[r[P(0xb5)+P(0xad)]=0x2]=P(0xb5)+P(0xad),r[r[P(0xd4)+P(0xa5)+P(0xb0)]=0x3]=P(0xd4)+P(0xa5)+P(0xb0),r[r[P(0xb9)+P(0xe2)]=0x4]=P(0xb9)+P(0xe2),r[r[P(0xee)+P(0xc0)+'P']=0x5]=P(0xee)+P(0xc0)+'P',r[r[P(0xde)]=0x8]=P(0xde),r[r[P(0xb1)]=0x9]=P(0xb1),r[r[P(0xe2)+P(0xdc)+P(0xef)+P(0xa4)]=0xa]=P(0xe2)+P(0xdc)+P(0xef)+P(0xa4),r[r[P(0xe2)+P(0xe4)+P(0xc2)+P(0xcb)]=0xb]=P(0xe2)+P(0xe4)+P(0xc2)+P(0xcb),r[r[P(0xe2)+P(0xab)+P(0xb4)+P(0xd8)+P(0xcb)]=0xc]=P(0xe2)+P(0xab)+P(0xb4)+P(0xd8)+P(0xcb),r[r[P(0xb9)+P(0xd0)+P(0xac)+'UP']=0xd]=P(0xb9)+P(0xd0)+P(0xac)+'UP',r[r[P(0xea)+P(0xe0)+P(0xc4)+P(0xbf)+'EM']=0xe]=P(0xea)+P(0xe0)+P(0xc4)+P(0xbf)+'EM',r[r[P(0xea)+P(0xe8)+P(0xd3)+P(0xa7)+P(0xc9)]=0xf]=P(0xea)+P(0xe8)+P(0xd3)+P(0xa7)+P(0xc9),r[r[P(0xe5)+P(0xb2)+'ER']=0x10]=P(0xe5)+P(0xb2)+'ER',r[r[P(0xd7)+P(0xb8)+P(0xad)]=0x11]=P(0xd7)+P(0xb8)+P(0xad);}(PSMessageActionNoteType||(PSMessageActionNoteType={})));export var PSMessageMetadataChatBotButtonActionType;(function(r){var m=Y;r[r[m(0xaa)]=0x1]=m(0xaa),r[r[m(0xae)+m(0xbb)]=0x2]=m(0xae)+m(0xbb),r[r[m(0xaf)+'GE']=0x3]=m(0xaf)+'GE';}(PSMessageMetadataChatBotButtonActionType||(PSMessageMetadataChatBotButtonActionType={})));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function Y(r,y){var a=b();return Y=function(v,N){v=v-0x7f;var p=a[v];return p;},Y(r,y);}(function(r,y){var p=Y,a=r();while(!![]){try{var v=parseInt(p(0x87))/0x1*(parseInt(p(0x7f))/0x2)+parseInt(p(0x88))/0x3*(parseInt(p(0x81))/0x4)+parseInt(p(0x82))/0x5*(parseInt(p(0x85))/0x6)+-parseInt(p(0x86))/0x7*(parseInt(p(0x89))/0x8)+-parseInt(p(0x83))/0x9+-parseInt(p(0x80))/0xa+parseInt(p(0x8a))/0xb*(parseInt(p(0x84))/0xc);if(v===y)break;else a['push'](a['shift']());}catch(N){a['push'](a['shift']());}}}(b,0x97e14));function b(){var f=['22vCDVRI','186974sUsnjg','5347670LLVXSn','573676fgnicB','565uOqhVo','6673941pekcLQ','4516536oJaofL','26886svBuob','7mHvnBh','10CmmqZh','15ZbPfcr','8101264EENNLu'];b=function(){return f;};return b();}export*from'./notification';export*from'./types';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IPSChatAxiosDelegate } from '../axios';
|
|
2
|
+
import { PSResponse } from '../types';
|
|
3
|
+
import { PSChatNotificationRequestDto } from './types';
|
|
4
|
+
export interface IPSChatNotificationApi {
|
|
5
|
+
register(body: PSChatNotificationRequestDto): Promise<PSResponse<any>>;
|
|
6
|
+
unregister(body: PSChatNotificationRequestDto): Promise<PSResponse<any>>;
|
|
7
|
+
registerWithFireBaseProjectNumber(body: PSChatNotificationRequestDto, fireBaseProjectNumber: string): Promise<PSResponse<any>>;
|
|
8
|
+
unregisterWithFireBaseProjectNumber(body: PSChatNotificationRequestDto, fireBaseProjectNumber: string): Promise<PSResponse<any>>;
|
|
9
|
+
}
|
|
10
|
+
export declare class PSChatNotificationApiImpl implements IPSChatNotificationApi {
|
|
11
|
+
private axiosDelegate;
|
|
12
|
+
constructor(axiosDelegate: IPSChatAxiosDelegate);
|
|
13
|
+
register(body: PSChatNotificationRequestDto): Promise<PSResponse<any>>;
|
|
14
|
+
unregister(body: PSChatNotificationRequestDto): Promise<PSResponse<any>>;
|
|
15
|
+
registerWithFireBaseProjectNumber(body: PSChatNotificationRequestDto, fireBaseProjectNumber: string): Promise<PSResponse<any>>;
|
|
16
|
+
unregisterWithFireBaseProjectNumber(body: PSChatNotificationRequestDto, fireBaseProjectNumber: string): Promise<PSResponse<any>>;
|
|
17
|
+
}
|