query protocol is implemented

This commit is contained in:
병준 박 2019-09-25 13:26:41 +09:00
parent 06f0219660
commit 872203b86b
9 changed files with 185 additions and 0 deletions

View File

@ -0,0 +1,4 @@
export enum DefaultScreen {
Messenger = 'M',
Call = 'C'
}

View File

@ -0,0 +1,7 @@
export enum FileTransferPermissions {
All = 'A',
Upload = 'U',
Download = 'D',
None = 'N',
Image = 'I'
}

View File

@ -0,0 +1,5 @@
export enum OrganizationChartPermissions {
Group = 'G',
Company = 'C',
None = 'N'
}

View File

@ -0,0 +1,4 @@
export enum VideoConferenceType {
Uprism = 'U',
Cisco = 'C'
}

View File

@ -7,10 +7,14 @@ export * from './lib/type/call-alarm.type';
export * from './lib/type/call-forward.type'; export * from './lib/type/call-forward.type';
export * from './lib/type/call-mode.type'; export * from './lib/type/call-mode.type';
export * from './lib/type/caller-type.type'; export * from './lib/type/caller-type.type';
export * from './lib/type/default-screen.type';
export * from './lib/type/device-devision.type'; export * from './lib/type/device-devision.type';
export * from './lib/type/device-type.type'; export * from './lib/type/device-type.type';
export * from './lib/type/file-transfer-permissions.type';
export * from './lib/type/locale-code.type'; export * from './lib/type/locale-code.type';
export * from './lib/type/notification-method.type'; export * from './lib/type/notification-method.type';
export * from './lib/type/organization-chart-permissions.type';
export * from './lib/type/push-type.type'; export * from './lib/type/push-type.type';
export * from './lib/type/status-code.type'; export * from './lib/type/status-code.type';
export * from './lib/type/status-type.type'; export * from './lib/type/status-type.type';
export * from './lib/type/video-conference-type.type';

View File

@ -11,4 +11,6 @@ export * from './lib/models/view';
export * from './lib/services/option-protocol.service'; export * from './lib/services/option-protocol.service';
export * from './lib/types/service';
export * from './lib/ucap-option-protocol.module'; export * from './lib/ucap-option-protocol.module';

View File

@ -0,0 +1,121 @@
import {
ProtocolRequest,
ProtocolResponse,
ProtocolEncoder,
PacketBody,
ProtocolDecoder,
ProtocolMessage,
PacketBodyValue
} from '@ucap-webmessenger/protocol';
import {
DeviceType,
FileTransferPermissions,
OrganizationChartPermissions,
DefaultScreen,
VideoConferenceType
} from '@ucap-webmessenger/core';
export interface AuthRequest extends ProtocolRequest {
deviceType: DeviceType;
}
export interface AuthResponse extends ProtocolResponse {
// 0 단말타입(s)
deviceType?: DeviceType;
// 1 파일전송허용회사정보(s)
fileTransferAllowedCompanyList?: string[];
// 2 파일전송권한(s)
fileTransferPermissions?: FileTransferPermissions;
// 3 파일보관기간(n)
fileRetentionPeriod?: number;
// 4 비밀번호유효기간(n)
passwordValidityPeriod?: number;
// 5 화상회의권한(s)
canVideoConference?: boolean;
// 6 조직도권한(s)
organizationChartPermissions?: OrganizationChartPermissions;
// 7 외부전화권한(s)
canExternalCall?: boolean;
// 8 내/외부망 체크(s)
checkNetwork?: boolean;
// 9 아이폰사용여부(s)
useIPhone?: boolean;
// 10 메인화면(s)
defaultScreen?: DefaultScreen;
// 11 모바일 화면캡처사용여부(s)
canCaptureMobileScreen?: boolean;
// 12 마이톡권한(s)
canMyTalk?: boolean;
// 13 타이머챗권한(s)
canTimerChat?: boolean;
// 14 메일보내기권한(s)
canSendEmail?: boolean;
// 15 MDM권한(s)
canMdm?: boolean;
// 16 쿠폰선물권한(s)
canCouponGift?: boolean;
// 17 GAMS 사용여부(s)
useGams?: boolean;
// 18 PC 화면캡춰 사용여부(s)
useCapturePcScreen?: boolean;
// 19 화상회의타입(s)
videoConferenceType?: VideoConferenceType;
// 20 번역 권한(s)
canTranslation?: boolean;
// 21 스케쥴 보기 권한(s)
scheduleViewAllowedCompanyList?: string[];
// 22 챗봇 권한(s)
canChatBot?: boolean;
// 23 스트리밍 전송 허용회사정보(s)
streamingTransmissionAllowedCompanyList?: string[];
// 24 스트리밍 전송 권한(s)
canStreamingTransmission?: boolean;
// 25 I-Messenger 메시지함 권한
canIMessengerMessageBox?: boolean;
}
export const encodeAuth: ProtocolEncoder<AuthRequest> = (req: AuthRequest) => {
const bodyList: PacketBody[] = [];
bodyList.push({
type: PacketBodyValue.String,
value: req.deviceType
});
return bodyList;
};
export const decodeAuth: ProtocolDecoder<AuthResponse> = (
message: ProtocolMessage
) => {
return {
deviceType: message.bodyList[0] as DeviceType,
fileTransferAllowedCompanyList: (message.bodyList[1] as string).split(';'),
fileTransferPermissions: message.bodyList[2] as FileTransferPermissions,
fileRetentionPeriod: message.bodyList[3],
passwordValidityPeriod: message.bodyList[4],
canVideoConference: message.bodyList[5] === 'Y' ? true : false,
organizationChartPermissions: message
.bodyList[6] as OrganizationChartPermissions,
canExternalCall: message.bodyList[7] === 'Y' ? true : false,
checkNetwork: message.bodyList[8] === 'Y' ? true : false,
useIPhone: message.bodyList[9] === 'Y' ? true : false,
defaultScreen: message.bodyList[10] as DefaultScreen,
canCaptureMobileScreen: message.bodyList[11] === 'Y' ? true : false,
canMyTalk: message.bodyList[12] === 'Y' ? true : false,
canTimerChat: message.bodyList[13] === 'Y' ? true : false,
canSendEmail: message.bodyList[14] === 'Y' ? true : false,
canMdm: message.bodyList[15] === 'Y' ? true : false,
canCouponGift: message.bodyList[16] === 'Y' ? true : false,
useGams: message.bodyList[17] === 'Y' ? true : false,
useCapturePcScreen: message.bodyList[18] === 'Y' ? true : false,
videoConferenceType: message.bodyList[19] as VideoConferenceType,
canTranslation: message.bodyList[20] === 'Y' ? true : false,
scheduleViewAllowedCompanyList: (message.bodyList[21] as string).split(';'),
canChatBot: message.bodyList[22] === 'Y' ? true : false,
streamingTransmissionAllowedCompanyList: (message
.bodyList[23] as string).split(';'),
canStreamingTransmission: message.bodyList[24] === 'Y' ? true : false,
canIMessengerMessageBox: message.bodyList[25] === 'Y' ? true : false
} as AuthResponse;
};

View File

@ -0,0 +1,34 @@
export const SVC_TYPE_QUERY_DATA = 91; // 사용자 정보 쿼리
export const SSVC_TYPE_QUERY_DATA_USER_REQ = 1; // 사용자 정보 쿼리 요청
export const SSVC_TYPE_QUERY_DATA_USER_RES = 2; //
export const SSVC_TYPE_QUERY_EXT_DATA_USER_REQ = 3; // 사용자 추가 정보 쿼리 요청
export const SSVC_TYPE_QUERY_EXT_DATA_USER_RES = 4; //
export const SSVC_TYPE_QUERY_DEPT_REQ = 11; // 부서 정보 쿼리 요청
export const SSVC_TYPE_QUERY_DEPT_DATA = 12; //
export const SSVC_TYPE_QUERY_DEPT_RES = 13; //
export const SSVC_TYPE_QUERY_DEPT_USER_REQ = 14; // 사용자 검색 쿼리 요청
export const SSVC_TYPE_QUERY_DEPT_USER_DATA = 15; //
export const SSVC_TYPE_QUERY_DEPT_USER_RES = 16; //
export const SSVC_TYPE_QUERY_TEAM_CONTACT_USER_REQ = 17; // 공용 주소록 검색 쿼리 요청
export const SSVC_TYPE_QUERY_TEAM_CONTACT_USER_DATA = 18; //
export const SSVC_TYPE_QUERY_TEAM_CONTACT_USER_RES = 19; //
export const SSVC_TYPE_QUERY_USER_SEQ_REQ = 21; // 사용자 SEQ 검색
export const SSVC_TYPE_QUERY_USER_SEQ_DATA = 22; // 사용자 SEQ 정보
export const SSVC_TYPE_QUERY_USER_SEQ_DATA2 = 24; // 사용자 SEQ 정보 (상세)
export const SSVC_TYPE_QUERY_USER_SEQ_RES = 23; //
export const SSVC_TYPE_QUERY_USER_ID_REQ = 25; // 사용자 ID 검색
export const SSVC_TYPE_QUERY_USER_ID_DATA = 26; // 사용자 ID 정보
export const SSVC_TYPE_QUERY_USER_ID_RES = 27; //
export const SSVC_TYPE_QUERY_USER_BY_DN_REQ = 31; // 사용자 정보 검색 요청(DN으로)
export const SSVC_TYPE_QUERY_USER_BY_DN_DATA = 32; //
export const SSVC_TYPE_QUERY_USER_BY_DN_RES = 33; // 사용자 정보 검색 응답(DN으로)
export const SSVC_TYPE_QUERY_MY_GROUP_REQ = 41; // 정렬된 그룹 SEQs 정보 요청
export const SSVC_TYPE_QUERY_MY_GROUP_RES = 42; // 정렬된 그룹 SEQs 정보 응답
export const SSVC_TYPE_QUERY_CONFIRM_USER_REQ = 51; // 사용자 확인 요청
export const SSVC_TYPE_QUERY_CONFIRM_USER_RES = 52; // 사용자 확인 응답
export const SSVC_TYPE_QUERY_AUTH_REQ = 91; // 사용자 권한 정보 요청
export const SSVC_TYPE_QUERY_AUTH_RES = 92; // 사용자 권한 정보 응답
export const SSVC_TYPE_QUERY_CONTACT_VCARD_REQ = 101; // 명함주소록(거래처) 검색 요청
export const SSVC_TYPE_QUERY_CONTACT_VCARD_DATA = 102; // 명함주소록(거래처) 데이터
export const SSVC_TYPE_QUERY_CONTACT_VCARD_RES = 103; // 명함주소록(거래처) 검색 요청 응답

View File

@ -2,6 +2,10 @@
* Public API Surface of ucap-webmessenger-protocol-query * Public API Surface of ucap-webmessenger-protocol-query
*/ */
export * from './lib/models/auth';
export * from './lib/services/query-protocol.service'; export * from './lib/services/query-protocol.service';
export * from './lib/types/service';
export * from './lib/ucap-query-protocol.module'; export * from './lib/ucap-query-protocol.module';