diff --git a/projects/ucap-webmessenger-core/src/lib/type/default-screen.type.ts b/projects/ucap-webmessenger-core/src/lib/type/default-screen.type.ts new file mode 100644 index 00000000..e62667d1 --- /dev/null +++ b/projects/ucap-webmessenger-core/src/lib/type/default-screen.type.ts @@ -0,0 +1,4 @@ +export enum DefaultScreen { + Messenger = 'M', + Call = 'C' +} diff --git a/projects/ucap-webmessenger-core/src/lib/type/file-transfer-permissions.type.ts b/projects/ucap-webmessenger-core/src/lib/type/file-transfer-permissions.type.ts new file mode 100644 index 00000000..a093a26b --- /dev/null +++ b/projects/ucap-webmessenger-core/src/lib/type/file-transfer-permissions.type.ts @@ -0,0 +1,7 @@ +export enum FileTransferPermissions { + All = 'A', + Upload = 'U', + Download = 'D', + None = 'N', + Image = 'I' +} diff --git a/projects/ucap-webmessenger-core/src/lib/type/organization-chart-permissions.type.ts b/projects/ucap-webmessenger-core/src/lib/type/organization-chart-permissions.type.ts new file mode 100644 index 00000000..506c2a8d --- /dev/null +++ b/projects/ucap-webmessenger-core/src/lib/type/organization-chart-permissions.type.ts @@ -0,0 +1,5 @@ +export enum OrganizationChartPermissions { + Group = 'G', + Company = 'C', + None = 'N' +} diff --git a/projects/ucap-webmessenger-core/src/lib/type/video-conference-type.type.ts b/projects/ucap-webmessenger-core/src/lib/type/video-conference-type.type.ts new file mode 100644 index 00000000..8d19dbcc --- /dev/null +++ b/projects/ucap-webmessenger-core/src/lib/type/video-conference-type.type.ts @@ -0,0 +1,4 @@ +export enum VideoConferenceType { + Uprism = 'U', + Cisco = 'C' +} diff --git a/projects/ucap-webmessenger-core/src/public-api.ts b/projects/ucap-webmessenger-core/src/public-api.ts index 1efbf2fe..879e03a7 100644 --- a/projects/ucap-webmessenger-core/src/public-api.ts +++ b/projects/ucap-webmessenger-core/src/public-api.ts @@ -7,10 +7,14 @@ export * from './lib/type/call-alarm.type'; export * from './lib/type/call-forward.type'; export * from './lib/type/call-mode.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-type.type'; +export * from './lib/type/file-transfer-permissions.type'; export * from './lib/type/locale-code.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/status-code.type'; export * from './lib/type/status-type.type'; +export * from './lib/type/video-conference-type.type'; diff --git a/projects/ucap-webmessenger-protocol-option/src/public-api.ts b/projects/ucap-webmessenger-protocol-option/src/public-api.ts index 1f4ba615..59c5c147 100644 --- a/projects/ucap-webmessenger-protocol-option/src/public-api.ts +++ b/projects/ucap-webmessenger-protocol-option/src/public-api.ts @@ -11,4 +11,6 @@ export * from './lib/models/view'; export * from './lib/services/option-protocol.service'; +export * from './lib/types/service'; + export * from './lib/ucap-option-protocol.module'; diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/models/auth.ts b/projects/ucap-webmessenger-protocol-query/src/lib/models/auth.ts new file mode 100644 index 00000000..8297aa9f --- /dev/null +++ b/projects/ucap-webmessenger-protocol-query/src/lib/models/auth.ts @@ -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 = (req: AuthRequest) => { + const bodyList: PacketBody[] = []; + + bodyList.push({ + type: PacketBodyValue.String, + value: req.deviceType + }); + + return bodyList; +}; + +export const decodeAuth: ProtocolDecoder = ( + 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; +}; diff --git a/projects/ucap-webmessenger-protocol-query/src/lib/types/service.ts b/projects/ucap-webmessenger-protocol-query/src/lib/types/service.ts new file mode 100644 index 00000000..efc92581 --- /dev/null +++ b/projects/ucap-webmessenger-protocol-query/src/lib/types/service.ts @@ -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; // 명함주소록(거래처) 검색 요청 응답 diff --git a/projects/ucap-webmessenger-protocol-query/src/public-api.ts b/projects/ucap-webmessenger-protocol-query/src/public-api.ts index 85db4a9d..14062a62 100644 --- a/projects/ucap-webmessenger-protocol-query/src/public-api.ts +++ b/projects/ucap-webmessenger-protocol-query/src/public-api.ts @@ -2,6 +2,10 @@ * Public API Surface of ucap-webmessenger-protocol-query */ +export * from './lib/models/auth'; + export * from './lib/services/query-protocol.service'; +export * from './lib/types/service'; + export * from './lib/ucap-query-protocol.module';