@wireai/activation 0.7.0 → 0.8.0
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/CHANGELOG.md +35 -0
- package/dist/analytics/index.d.mts +8 -4
- package/dist/analytics/index.d.ts +8 -4
- package/dist/analytics/index.js +83 -11
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +83 -11
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/{currentSession-BJBB7i4-.d.mts → currentSession-d9CrBxwe.d.mts} +9 -1
- package/dist/{currentSession-CxnP7gAa.d.ts → currentSession-f7LWcdWG.d.ts} +9 -1
- package/dist/index.d.mts +69 -5
- package/dist/index.d.ts +69 -5
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/analytics/analyticsFacade.ts +55 -10
- package/src/context/deviceId.ts +43 -0
- package/src/device/deviceContext.ts +14 -1
- package/src/device/deviceModel.ts +93 -0
- package/src/index.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -2399,6 +2399,47 @@ var detectAppVersion = (requireModule = runtimeRequire) => {
|
|
|
2399
2399
|
return void 0;
|
|
2400
2400
|
};
|
|
2401
2401
|
|
|
2402
|
+
// src/device/deviceModel.ts
|
|
2403
|
+
var coerceModel = (value) => {
|
|
2404
|
+
if (typeof value !== "string") return void 0;
|
|
2405
|
+
const trimmed = value.trim();
|
|
2406
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
2407
|
+
};
|
|
2408
|
+
var runtimeRequire2 = (moduleName) => {
|
|
2409
|
+
try {
|
|
2410
|
+
if (typeof __require !== "function") return void 0;
|
|
2411
|
+
return __require(moduleName);
|
|
2412
|
+
} catch {
|
|
2413
|
+
return void 0;
|
|
2414
|
+
}
|
|
2415
|
+
};
|
|
2416
|
+
var interop2 = (mod) => {
|
|
2417
|
+
if (!mod || typeof mod !== "object") return void 0;
|
|
2418
|
+
const def = mod.default;
|
|
2419
|
+
if (def && typeof def === "object") return def;
|
|
2420
|
+
return mod;
|
|
2421
|
+
};
|
|
2422
|
+
var safeInterop2 = (requireModule, moduleName) => {
|
|
2423
|
+
try {
|
|
2424
|
+
return interop2(requireModule(moduleName));
|
|
2425
|
+
} catch {
|
|
2426
|
+
return void 0;
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2429
|
+
var detectNativeModel = (requireModule = runtimeRequire2) => {
|
|
2430
|
+
try {
|
|
2431
|
+
const device = safeInterop2(requireModule, "expo-device");
|
|
2432
|
+
if (device) {
|
|
2433
|
+
const modelName = coerceModel(device.modelName);
|
|
2434
|
+
if (modelName) return modelName;
|
|
2435
|
+
const modelId = coerceModel(device.modelId);
|
|
2436
|
+
if (modelId) return modelId;
|
|
2437
|
+
}
|
|
2438
|
+
} catch {
|
|
2439
|
+
}
|
|
2440
|
+
return void 0;
|
|
2441
|
+
};
|
|
2442
|
+
|
|
2402
2443
|
// src/device/deviceContext.ts
|
|
2403
2444
|
var deriveFormFactor = (iosIdiom, width, height) => {
|
|
2404
2445
|
if (iosIdiom === "pad") return "tablet";
|
|
@@ -2445,6 +2486,8 @@ var collectDeviceContext = () => {
|
|
|
2445
2486
|
ctx.interfaceIdiom = idiom;
|
|
2446
2487
|
iosIdiom = idiom;
|
|
2447
2488
|
}
|
|
2489
|
+
const iosModel = detectNativeModel();
|
|
2490
|
+
if (iosModel) ctx.model = iosModel;
|
|
2448
2491
|
}
|
|
2449
2492
|
} catch {
|
|
2450
2493
|
}
|
|
@@ -3293,6 +3336,15 @@ var resolveUserContext = (ctx = {}, opts = {}) => {
|
|
|
3293
3336
|
return result;
|
|
3294
3337
|
};
|
|
3295
3338
|
|
|
3339
|
+
// src/context/deviceId.ts
|
|
3340
|
+
var AUTO_DEVICE_ID_PREFIX = "wdev_";
|
|
3341
|
+
var deviceIdStorageKey = (appId) => `wireai:analytics:deviceKey:${appId != null ? appId : "default"}`;
|
|
3342
|
+
var randomChunk = () => Math.floor(Math.random() * 4294967296).toString(36).padStart(6, "0");
|
|
3343
|
+
var mintDeviceId = () => {
|
|
3344
|
+
const time = Date.now().toString(36);
|
|
3345
|
+
return `${AUTO_DEVICE_ID_PREFIX}${time}_${randomChunk()}${randomChunk()}`;
|
|
3346
|
+
};
|
|
3347
|
+
|
|
3296
3348
|
// src/session-analytics/reportSessionStart.ts
|
|
3297
3349
|
var SESSION_STARTED_EVENT = "app.session_started";
|
|
3298
3350
|
var _emitted = /* @__PURE__ */ new Set();
|
|
@@ -3792,6 +3844,6 @@ var useLifecycleEvents = (config, options = {}) => {
|
|
|
3792
3844
|
}, []);
|
|
3793
3845
|
};
|
|
3794
3846
|
|
|
3795
|
-
export { AnimatedSparkle, BACKGROUND_SESSION_MS, CardHandoff, CenteredModal, ChipSelectCard, CompletionView, DEFAULT_FEATURES_TTL_MS, DEFAULT_SESSION_TTL_MS, DemoOnboarding, DoneBlock, EXTRA_KEY_PREFIX, ErrorBlock, FIRST_OPEN_EVENT, IllustrationProvider, InterstitialCard, LoadingBlock, LoadingScreen, NumberStepperCard, Button as OnboardingButton, OnboardingFlow, OnboardingScaffold, OnboardingThemeProvider, RESERVED_USER_CONTEXT_KEYS, SESSION_STARTED_EVENT, SelectionCard, StatusCard, StepProgress, TextInputCard, USER_ID_MAX_LENGTH, WIRE_ONBOARDING_EVENTS, WireFeaturesProvider, WireOnboarding, attributionMetadata, clearPersistedSession, collectDeviceContext, defaultIllustrations, defaultOnboardingTheme, defaultWireFeatures, deriveAnswers, detectAppVersion, featuresCacheKey, featuresEqual, fetchWireFeatures, firstOpenStorageKey, getCurrentSessionId, hashEmailFnv1a, identifyOnboarding, isFeaturesFresh, isOnboardingEnabled, isWireScalar, loadPersistedSession, makeSessionId, mergeTheme, motionSpec_exports as motionSpec, namespaceExtra, onboardingComponents, parseWireFeatures, peekPersistedSession, readCachedFeatures, readProgress, reportClientEvent, reportClientEvents, reportFirstOpen, reportSessionStart, resetCurrentSessionId, resetFirstOpenLatch, resetSessionStartGuard, resolveUserContext, sanitizeUserId, savePersistedSession, sessionStorageKey, setCurrentSessionId, themeFromBrand, toAnalyticsEvent, useIllustration, useLifecycleEvents, useOnboardingTheme, useReducedMotion, useResolvedFeatures, useSessionStart, useWireFeatures, useWireFeaturesContext, wireConfigFromEnv, wireLifecycleEvents, writeCachedFeatures };
|
|
3847
|
+
export { AUTO_DEVICE_ID_PREFIX, AnimatedSparkle, BACKGROUND_SESSION_MS, CardHandoff, CenteredModal, ChipSelectCard, CompletionView, DEFAULT_FEATURES_TTL_MS, DEFAULT_SESSION_TTL_MS, DemoOnboarding, DoneBlock, EXTRA_KEY_PREFIX, ErrorBlock, FIRST_OPEN_EVENT, IllustrationProvider, InterstitialCard, LoadingBlock, LoadingScreen, NumberStepperCard, Button as OnboardingButton, OnboardingFlow, OnboardingScaffold, OnboardingThemeProvider, RESERVED_USER_CONTEXT_KEYS, SESSION_STARTED_EVENT, SelectionCard, StatusCard, StepProgress, TextInputCard, USER_ID_MAX_LENGTH, WIRE_ONBOARDING_EVENTS, WireFeaturesProvider, WireOnboarding, attributionMetadata, clearPersistedSession, collectDeviceContext, defaultIllustrations, defaultOnboardingTheme, defaultWireFeatures, deriveAnswers, detectAppVersion, detectNativeModel, deviceIdStorageKey, featuresCacheKey, featuresEqual, fetchWireFeatures, firstOpenStorageKey, getCurrentSessionId, hashEmailFnv1a, identifyOnboarding, isFeaturesFresh, isOnboardingEnabled, isWireScalar, loadPersistedSession, makeSessionId, mergeTheme, mintDeviceId, motionSpec_exports as motionSpec, namespaceExtra, onboardingComponents, parseWireFeatures, peekPersistedSession, readCachedFeatures, readProgress, reportClientEvent, reportClientEvents, reportFirstOpen, reportSessionStart, resetCurrentSessionId, resetFirstOpenLatch, resetSessionStartGuard, resolveUserContext, sanitizeUserId, savePersistedSession, sessionStorageKey, setCurrentSessionId, themeFromBrand, toAnalyticsEvent, useIllustration, useLifecycleEvents, useOnboardingTheme, useReducedMotion, useResolvedFeatures, useSessionStart, useWireFeatures, useWireFeaturesContext, wireConfigFromEnv, wireLifecycleEvents, writeCachedFeatures };
|
|
3796
3848
|
//# sourceMappingURL=index.mjs.map
|
|
3797
3849
|
//# sourceMappingURL=index.mjs.map
|