@adstage/web-sdk 2.4.9 → 2.4.11
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
CHANGED
|
@@ -482,9 +482,11 @@ class AdvertisementEventTracker {
|
|
|
482
482
|
// 광고 이벤트 데이터 구성 (DTO 구조에 맞춤)
|
|
483
483
|
// 서버에서 자동 설정: orgId (API 키로부터), advertisementId, action (URL 파라미터로부터)
|
|
484
484
|
const eventData = {
|
|
485
|
-
// 필수 필드들
|
|
485
|
+
// 필수 필드들 (DTO 검증용)
|
|
486
486
|
adType: slot?.adType || 'BANNER',
|
|
487
|
-
platform: deviceInfo.platform,
|
|
487
|
+
platform: deviceInfo.platform,
|
|
488
|
+
deviceId: deviceInfo.deviceId, // DTO 검증을 위해 deviceId 직접 전송
|
|
489
|
+
// 디바이스 정보는 deviceInfo 객체로 래핑
|
|
488
490
|
deviceInfo: deviceInfo,
|
|
489
491
|
// 페이지 및 슬롯 정보
|
|
490
492
|
pageUrl: DOMUtils.getPageInfo().url,
|
|
@@ -909,7 +911,7 @@ class EndpointBuilder {
|
|
|
909
911
|
batch: () => `${this.baseUrl}${API_PATHS.events.batch}`
|
|
910
912
|
};
|
|
911
913
|
// 기본값은 베타 환경 사용
|
|
912
|
-
this.baseUrl = baseUrl || API_ENDPOINTS.
|
|
914
|
+
this.baseUrl = baseUrl || API_ENDPOINTS.production;
|
|
913
915
|
}
|
|
914
916
|
/**
|
|
915
917
|
* 기본 URL 변경
|
|
@@ -3322,6 +3324,13 @@ class AdStage {
|
|
|
3322
3324
|
productionMode: false,
|
|
3323
3325
|
...config
|
|
3324
3326
|
};
|
|
3327
|
+
// 🔧 baseUrl이 설정된 경우 전역 endpoints 객체 업데이트
|
|
3328
|
+
if (instance._config.baseUrl) {
|
|
3329
|
+
endpoints.setBaseUrl(instance._config.baseUrl);
|
|
3330
|
+
if (config.debug) {
|
|
3331
|
+
console.log('🌐 API endpoint configured:', instance._config.baseUrl);
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3325
3334
|
// 모듈 동기 초기화
|
|
3326
3335
|
const enabledModules = instance._config.modules || ['ads', 'events', 'config'];
|
|
3327
3336
|
for (const moduleName of enabledModules) {
|
package/dist/index.esm.js
CHANGED
|
@@ -480,9 +480,11 @@ class AdvertisementEventTracker {
|
|
|
480
480
|
// 광고 이벤트 데이터 구성 (DTO 구조에 맞춤)
|
|
481
481
|
// 서버에서 자동 설정: orgId (API 키로부터), advertisementId, action (URL 파라미터로부터)
|
|
482
482
|
const eventData = {
|
|
483
|
-
// 필수 필드들
|
|
483
|
+
// 필수 필드들 (DTO 검증용)
|
|
484
484
|
adType: slot?.adType || 'BANNER',
|
|
485
|
-
platform: deviceInfo.platform,
|
|
485
|
+
platform: deviceInfo.platform,
|
|
486
|
+
deviceId: deviceInfo.deviceId, // DTO 검증을 위해 deviceId 직접 전송
|
|
487
|
+
// 디바이스 정보는 deviceInfo 객체로 래핑
|
|
486
488
|
deviceInfo: deviceInfo,
|
|
487
489
|
// 페이지 및 슬롯 정보
|
|
488
490
|
pageUrl: DOMUtils.getPageInfo().url,
|
|
@@ -907,7 +909,7 @@ class EndpointBuilder {
|
|
|
907
909
|
batch: () => `${this.baseUrl}${API_PATHS.events.batch}`
|
|
908
910
|
};
|
|
909
911
|
// 기본값은 베타 환경 사용
|
|
910
|
-
this.baseUrl = baseUrl || API_ENDPOINTS.
|
|
912
|
+
this.baseUrl = baseUrl || API_ENDPOINTS.production;
|
|
911
913
|
}
|
|
912
914
|
/**
|
|
913
915
|
* 기본 URL 변경
|
|
@@ -3320,6 +3322,13 @@ class AdStage {
|
|
|
3320
3322
|
productionMode: false,
|
|
3321
3323
|
...config
|
|
3322
3324
|
};
|
|
3325
|
+
// 🔧 baseUrl이 설정된 경우 전역 endpoints 객체 업데이트
|
|
3326
|
+
if (instance._config.baseUrl) {
|
|
3327
|
+
endpoints.setBaseUrl(instance._config.baseUrl);
|
|
3328
|
+
if (config.debug) {
|
|
3329
|
+
console.log('🌐 API endpoint configured:', instance._config.baseUrl);
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3323
3332
|
// 모듈 동기 초기화
|
|
3324
3333
|
const enabledModules = instance._config.modules || ['ads', 'events', 'config'];
|
|
3325
3334
|
for (const moduleName of enabledModules) {
|
package/dist/index.standalone.js
CHANGED
|
@@ -477,9 +477,11 @@ class AdvertisementEventTracker {
|
|
|
477
477
|
// 광고 이벤트 데이터 구성 (DTO 구조에 맞춤)
|
|
478
478
|
// 서버에서 자동 설정: orgId (API 키로부터), advertisementId, action (URL 파라미터로부터)
|
|
479
479
|
const eventData = {
|
|
480
|
-
// 필수 필드들
|
|
480
|
+
// 필수 필드들 (DTO 검증용)
|
|
481
481
|
adType: slot?.adType || 'BANNER',
|
|
482
|
-
platform: deviceInfo.platform,
|
|
482
|
+
platform: deviceInfo.platform,
|
|
483
|
+
deviceId: deviceInfo.deviceId, // DTO 검증을 위해 deviceId 직접 전송
|
|
484
|
+
// 디바이스 정보는 deviceInfo 객체로 래핑
|
|
483
485
|
deviceInfo: deviceInfo,
|
|
484
486
|
// 페이지 및 슬롯 정보
|
|
485
487
|
pageUrl: DOMUtils.getPageInfo().url,
|
|
@@ -904,7 +906,7 @@ class EndpointBuilder {
|
|
|
904
906
|
batch: () => `${this.baseUrl}${API_PATHS.events.batch}`
|
|
905
907
|
};
|
|
906
908
|
// 기본값은 베타 환경 사용
|
|
907
|
-
this.baseUrl = baseUrl || API_ENDPOINTS.
|
|
909
|
+
this.baseUrl = baseUrl || API_ENDPOINTS.production;
|
|
908
910
|
}
|
|
909
911
|
/**
|
|
910
912
|
* 기본 URL 변경
|
|
@@ -3317,6 +3319,13 @@ class AdStage {
|
|
|
3317
3319
|
productionMode: false,
|
|
3318
3320
|
...config
|
|
3319
3321
|
};
|
|
3322
|
+
// 🔧 baseUrl이 설정된 경우 전역 endpoints 객체 업데이트
|
|
3323
|
+
if (instance._config.baseUrl) {
|
|
3324
|
+
endpoints.setBaseUrl(instance._config.baseUrl);
|
|
3325
|
+
if (config.debug) {
|
|
3326
|
+
console.log('🌐 API endpoint configured:', instance._config.baseUrl);
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3320
3329
|
// 모듈 동기 초기화
|
|
3321
3330
|
const enabledModules = instance._config.modules || ['ads', 'events', 'config'];
|
|
3322
3331
|
for (const moduleName of enabledModules) {
|
package/package.json
CHANGED
|
@@ -15,9 +15,9 @@ export const API_ENDPOINTS = {
|
|
|
15
15
|
} as const;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* 기본 엔드포인트 (
|
|
18
|
+
* 기본 엔드포인트 (프로덕션 환경)
|
|
19
19
|
*/
|
|
20
|
-
export const DEFAULT_API_ENDPOINT = API_ENDPOINTS.
|
|
20
|
+
export const DEFAULT_API_ENDPOINT = API_ENDPOINTS.production;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* API 경로 상수
|
|
@@ -45,7 +45,7 @@ export class EndpointBuilder {
|
|
|
45
45
|
|
|
46
46
|
constructor(baseUrl?: string) {
|
|
47
47
|
// 기본값은 베타 환경 사용
|
|
48
|
-
this.baseUrl = baseUrl || API_ENDPOINTS.
|
|
48
|
+
this.baseUrl = baseUrl || API_ENDPOINTS.production;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
package/src/core/AdStage.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { AdStageConfig, ModuleName } from '../types/config';
|
|
|
7
7
|
import { AdsModule } from '../modules/ads/AdsModule';
|
|
8
8
|
import { ConfigModule } from '../modules/config/ConfigModule';
|
|
9
9
|
import { EventsModule } from '../modules/events/EventsModule';
|
|
10
|
+
import { endpoints } from '../constants/endpoints';
|
|
10
11
|
|
|
11
12
|
export class AdStage {
|
|
12
13
|
private static instance: AdStage;
|
|
@@ -52,6 +53,14 @@ export class AdStage {
|
|
|
52
53
|
...config
|
|
53
54
|
};
|
|
54
55
|
|
|
56
|
+
// 🔧 baseUrl이 설정된 경우 전역 endpoints 객체 업데이트
|
|
57
|
+
if (instance._config.baseUrl) {
|
|
58
|
+
endpoints.setBaseUrl(instance._config.baseUrl);
|
|
59
|
+
if (config.debug) {
|
|
60
|
+
console.log('🌐 API endpoint configured:', instance._config.baseUrl);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
// 모듈 동기 초기화
|
|
56
65
|
const enabledModules = instance._config.modules || ['ads', 'events', 'config'];
|
|
57
66
|
|
|
@@ -53,10 +53,13 @@ export class AdvertisementEventTracker {
|
|
|
53
53
|
// 광고 이벤트 데이터 구성 (DTO 구조에 맞춤)
|
|
54
54
|
// 서버에서 자동 설정: orgId (API 키로부터), advertisementId, action (URL 파라미터로부터)
|
|
55
55
|
const eventData = {
|
|
56
|
-
// 필수 필드들
|
|
56
|
+
// 필수 필드들 (DTO 검증용)
|
|
57
57
|
adType: slot?.adType || 'BANNER',
|
|
58
|
-
platform: deviceInfo.platform,
|
|
59
|
-
|
|
58
|
+
platform: deviceInfo.platform,
|
|
59
|
+
deviceId: deviceInfo.deviceId, // DTO 검증을 위해 deviceId 직접 전송
|
|
60
|
+
|
|
61
|
+
// 디바이스 정보는 deviceInfo 객체로 래핑
|
|
62
|
+
deviceInfo: deviceInfo,
|
|
60
63
|
|
|
61
64
|
// 페이지 및 슬롯 정보
|
|
62
65
|
pageUrl: DOMUtils.getPageInfo().url,
|