@wireai/activation 0.9.1 → 0.9.2
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/analytics/index.d.mts +2 -2
- package/dist/analytics/index.d.ts +2 -2
- package/dist/analytics/index.js +9 -5
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +9 -5
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/{currentSession-Bs2JfTJ8.d.mts → currentSession-CRRQLbAq.d.mts} +16 -0
- package/dist/{currentSession-61dcm3V-.d.ts → currentSession-Dj0cN3Rg.d.ts} +16 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -7
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.js +2 -1
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +2 -1
- package/dist/questionnaire/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/WireOnboarding.tsx +15 -4
- package/src/analytics/eventQueue.ts +28 -9
- package/src/questionnaire/transport.ts +9 -1
- package/src/session/persistedSession.ts +17 -0
- package/src/types.ts +16 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { R as ReportAppEventOptions, r as reportAppEvent } from '../transport-Bzb-bcB2.mjs';
|
|
2
|
-
import { W as WireUserContext, E as EventQueueOptions } from '../currentSession-
|
|
3
|
-
export { A as AnalyticsEvent, C as ClientEvent, a as ClientEventTarget, b as ClientEventType, c as ContextEnvelope, d as ContextEnvelopeInput, e as EnvelopeSource, f as EventQueue, g as WIRE_ONBOARDING_EVENTS, h as WireOnboardingEventName, i as buildContextEnvelope, j as createEventQueue, k as getCurrentSessionId, m as makeSessionId, r as reportClientEvent, l as reportClientEvents, n as resetCurrentSessionId, s as setCurrentSessionId, t as toAnalyticsEvent } from '../currentSession-
|
|
2
|
+
import { W as WireUserContext, E as EventQueueOptions } from '../currentSession-CRRQLbAq.mjs';
|
|
3
|
+
export { A as AnalyticsEvent, C as ClientEvent, a as ClientEventTarget, b as ClientEventType, c as ContextEnvelope, d as ContextEnvelopeInput, e as EnvelopeSource, f as EventQueue, g as WIRE_ONBOARDING_EVENTS, h as WireOnboardingEventName, i as buildContextEnvelope, j as createEventQueue, k as getCurrentSessionId, m as makeSessionId, r as reportClientEvent, l as reportClientEvents, n as resetCurrentSessionId, s as setCurrentSessionId, t as toAnalyticsEvent } from '../currentSession-CRRQLbAq.mjs';
|
|
4
4
|
import '../types-CNUqMK0D.mjs';
|
|
5
5
|
import '../types-BKfpdZzX.mjs';
|
|
6
6
|
import '../types-BcmagF6K.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { R as ReportAppEventOptions, r as reportAppEvent } from '../transport-B31G0Cib.js';
|
|
2
|
-
import { W as WireUserContext, E as EventQueueOptions } from '../currentSession-
|
|
3
|
-
export { A as AnalyticsEvent, C as ClientEvent, a as ClientEventTarget, b as ClientEventType, c as ContextEnvelope, d as ContextEnvelopeInput, e as EnvelopeSource, f as EventQueue, g as WIRE_ONBOARDING_EVENTS, h as WireOnboardingEventName, i as buildContextEnvelope, j as createEventQueue, k as getCurrentSessionId, m as makeSessionId, r as reportClientEvent, l as reportClientEvents, n as resetCurrentSessionId, s as setCurrentSessionId, t as toAnalyticsEvent } from '../currentSession-
|
|
2
|
+
import { W as WireUserContext, E as EventQueueOptions } from '../currentSession-Dj0cN3Rg.js';
|
|
3
|
+
export { A as AnalyticsEvent, C as ClientEvent, a as ClientEventTarget, b as ClientEventType, c as ContextEnvelope, d as ContextEnvelopeInput, e as EnvelopeSource, f as EventQueue, g as WIRE_ONBOARDING_EVENTS, h as WireOnboardingEventName, i as buildContextEnvelope, j as createEventQueue, k as getCurrentSessionId, m as makeSessionId, r as reportClientEvent, l as reportClientEvents, n as resetCurrentSessionId, s as setCurrentSessionId, t as toAnalyticsEvent } from '../currentSession-Dj0cN3Rg.js';
|
|
4
4
|
import '../types-Buj9Lw9t.js';
|
|
5
5
|
import '../types-BKfpdZzX.js';
|
|
6
6
|
import '../types-BcmagF6K.js';
|
package/dist/analytics/index.js
CHANGED
|
@@ -860,8 +860,9 @@ var createEventQueue = (options) => {
|
|
|
860
860
|
} catch {
|
|
861
861
|
}
|
|
862
862
|
})();
|
|
863
|
+
const DROP_STATUSES = /* @__PURE__ */ new Set([400, 404, 413, 422]);
|
|
863
864
|
const postBatch = async (events) => {
|
|
864
|
-
if (!(target == null ? void 0 : target.serverUrl) || events.length === 0) return
|
|
865
|
+
if (!(target == null ? void 0 : target.serverUrl) || events.length === 0) return "retry";
|
|
865
866
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
866
867
|
const timer = setTimeout(() => controller == null ? void 0 : controller.abort(), 15e3);
|
|
867
868
|
try {
|
|
@@ -874,9 +875,12 @@ var createEventQueue = (options) => {
|
|
|
874
875
|
body: JSON.stringify({ events }),
|
|
875
876
|
signal: controller == null ? void 0 : controller.signal
|
|
876
877
|
});
|
|
877
|
-
|
|
878
|
+
if (res && res.ok) return "ok";
|
|
879
|
+
const status = res == null ? void 0 : res.status;
|
|
880
|
+
if (typeof status === "number" && DROP_STATUSES.has(status)) return "drop";
|
|
881
|
+
return "retry";
|
|
878
882
|
} catch {
|
|
879
|
-
return
|
|
883
|
+
return "retry";
|
|
880
884
|
} finally {
|
|
881
885
|
clearTimeout(timer);
|
|
882
886
|
}
|
|
@@ -908,8 +912,8 @@ var createEventQueue = (options) => {
|
|
|
908
912
|
try {
|
|
909
913
|
while (pending.length > 0) {
|
|
910
914
|
const batch = pending.slice(0, batchSize);
|
|
911
|
-
const
|
|
912
|
-
if (
|
|
915
|
+
const result = await postBatch(batch.map((item) => item.event));
|
|
916
|
+
if (result === "retry") {
|
|
913
917
|
scheduleRetry();
|
|
914
918
|
return;
|
|
915
919
|
}
|