@adstage/web-sdk 3.0.3 → 3.0.5
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/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +34 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.standalone.js +2 -2
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
- package/src/managers/device-info-collector.ts +1 -1
- package/src/managers/events/event-device-collector.ts +2 -4
- package/src/modules/events/events-module.ts +67 -0
- package/src/types/config.ts +1 -2
- package/src/utils/config-utils.ts +1 -7
package/package.json
CHANGED
|
@@ -99,7 +99,7 @@ export class DeviceInfoCollector {
|
|
|
99
99
|
sessionId: DeviceInfoCollector.generateSessionId(),
|
|
100
100
|
osVersion: DOMUtils.isBrowser() ? navigator.platform : 'SSR',
|
|
101
101
|
deviceModel: DOMUtils.isBrowser() ? navigator.platform : 'SSR',
|
|
102
|
-
appVersion:
|
|
102
|
+
appVersion: '1.0.0', // 기본값 (사용자가 별도 설정 필요)
|
|
103
103
|
sdkVersion: getSDKVersion(), // package.json에서 동적 로드
|
|
104
104
|
language: DOMUtils.isBrowser() ? (navigator.language || 'ko') : 'ko',
|
|
105
105
|
country: 'KR', // 기본값
|
|
@@ -53,7 +53,6 @@ export class EventDeviceCollector {
|
|
|
53
53
|
category: 'other',
|
|
54
54
|
platform: 'SSR',
|
|
55
55
|
model: 'SSR',
|
|
56
|
-
appVersion: ConfigUtils.getAppVersion(),
|
|
57
56
|
osVersion: 'SSR'
|
|
58
57
|
};
|
|
59
58
|
}
|
|
@@ -76,7 +75,6 @@ export class EventDeviceCollector {
|
|
|
76
75
|
category,
|
|
77
76
|
platform: platformString,
|
|
78
77
|
model: navigator.platform,
|
|
79
|
-
appVersion: ConfigUtils.getAppVersion(),
|
|
80
78
|
osVersion: navigator.platform
|
|
81
79
|
};
|
|
82
80
|
}
|
|
@@ -107,14 +105,14 @@ export class EventDeviceCollector {
|
|
|
107
105
|
/**
|
|
108
106
|
* 사용자 제공 디바이스 정보 초기화
|
|
109
107
|
*/
|
|
110
|
-
static
|
|
108
|
+
static clearDeviceInfo(): void {
|
|
111
109
|
EventDeviceCollector._userProvidedDeviceInfo = {};
|
|
112
110
|
}
|
|
113
111
|
|
|
114
112
|
/**
|
|
115
113
|
* 현재 사용자가 설정한 디바이스 정보 반환
|
|
116
114
|
*/
|
|
117
|
-
static
|
|
115
|
+
static getUserDeviceInfo(): typeof EventDeviceCollector._userProvidedDeviceInfo {
|
|
118
116
|
return { ...EventDeviceCollector._userProvidedDeviceInfo };
|
|
119
117
|
}
|
|
120
118
|
|
|
@@ -80,6 +80,73 @@ export class EventsModule implements BaseModule {
|
|
|
80
80
|
return EventUserCollector.getCurrentUserProperties();
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* 디바이스 정보 설정
|
|
85
|
+
*/
|
|
86
|
+
setDeviceInfo(deviceInfo: Partial<{
|
|
87
|
+
category: 'mobile' | 'desktop' | 'tablet' | 'other';
|
|
88
|
+
platform: string;
|
|
89
|
+
model: string;
|
|
90
|
+
appVersion: string;
|
|
91
|
+
osVersion: string;
|
|
92
|
+
}>): void {
|
|
93
|
+
EventDeviceCollector.setDeviceInfo(deviceInfo);
|
|
94
|
+
|
|
95
|
+
if (this._config?.debug) {
|
|
96
|
+
console.log('📱 Device info set:', deviceInfo);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 개별 디바이스 속성 설정
|
|
102
|
+
*/
|
|
103
|
+
setDeviceProperty(key: 'category' | 'platform' | 'model' | 'appVersion' | 'osVersion', value: string): void {
|
|
104
|
+
EventDeviceCollector.setDeviceProperty(key, value);
|
|
105
|
+
|
|
106
|
+
if (this._config?.debug) {
|
|
107
|
+
console.log('📱 Device property set:', key, value);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 사용자 제공 디바이스 정보 초기화
|
|
113
|
+
*/
|
|
114
|
+
clearDeviceInfo(): void {
|
|
115
|
+
EventDeviceCollector.clearDeviceInfo();
|
|
116
|
+
|
|
117
|
+
if (this._config?.debug) {
|
|
118
|
+
console.log('📱 User provided device info cleared');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 현재 사용자가 설정한 디바이스 정보 반환
|
|
124
|
+
*/
|
|
125
|
+
getUserDeviceInfo(): any {
|
|
126
|
+
return EventDeviceCollector.getUserDeviceInfo();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* 현재 디바이스 정보 반환
|
|
131
|
+
*/
|
|
132
|
+
getDeviceInfo(): any {
|
|
133
|
+
return EventDeviceCollector.getDeviceInfo();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 현재 사용자 정보 반환
|
|
138
|
+
*/
|
|
139
|
+
getUserInfo(): any {
|
|
140
|
+
return EventUserCollector.getUserInfo();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 현재 사용자 속성 반환 (별칭)
|
|
145
|
+
*/
|
|
146
|
+
getCurrentUserProperties(): any {
|
|
147
|
+
return EventUserCollector.getCurrentUserProperties();
|
|
148
|
+
}
|
|
149
|
+
|
|
83
150
|
/**
|
|
84
151
|
* 이벤트 추적
|
|
85
152
|
* @param eventName 이벤트 이름
|
package/src/types/config.ts
CHANGED