summaryrefslogtreecommitdiff
path: root/lib/soap/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/soap/types.ts')
-rw-r--r--lib/soap/types.ts64
1 files changed, 64 insertions, 0 deletions
diff --git a/lib/soap/types.ts b/lib/soap/types.ts
new file mode 100644
index 00000000..dac8f83b
--- /dev/null
+++ b/lib/soap/types.ts
@@ -0,0 +1,64 @@
+// SOAP 관련 타입 정의
+
+// 기본 인증 정보 타입
+export interface SoapAuthConfig {
+ username?: string;
+ password?: string;
+}
+
+// SOAP 전송 설정 타입
+export interface SoapSendConfig {
+ endpoint: string;
+ envelope: Record<string, unknown>;
+ soapAction?: string;
+ timeout?: number;
+ retryCount?: number;
+ retryDelay?: number;
+ namespace?: string; // 네임스페이스를 동적으로 설정할 수 있도록 추가
+ prefix: string; // 네임스페이스 접두사 (필수)
+}
+
+// 로깅 정보 타입
+export interface SoapLogInfo {
+ direction: 'INBOUND' | 'OUTBOUND';
+ system: string;
+ interface: string;
+}
+
+// 전송 결과 타입
+export interface SoapSendResult {
+ success: boolean;
+ message: string;
+ responseText?: string;
+ statusCode?: number;
+ headers?: Record<string, string>;
+ endpoint?: string;
+ requestXml?: string;
+ requestHeaders?: Record<string, string>;
+}
+
+// SOAP 에러 타입 (응답 정보 포함)
+export class SoapResponseError extends Error {
+ responseText?: string;
+ statusCode?: number;
+ headers?: Record<string, string>;
+ endpoint?: string;
+ requestXml?: string;
+ requestHeaders?: Record<string, string>;
+
+ constructor(message: string, details?: {
+ responseText?: string;
+ statusCode?: number;
+ headers?: Record<string, string>;
+ endpoint?: string;
+ requestXml?: string;
+ requestHeaders?: Record<string, string>;
+ }) {
+ super(message);
+ this.name = 'SoapResponseError';
+ if (details) {
+ Object.assign(this, details);
+ }
+ }
+}
+