@wireai/activation 0.13.2 → 0.13.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/AGENTS.md +6 -3
- package/CHANGELOG.md +291 -4
- package/INTEGRATION_PROMPT.md +7 -1
- package/README.md +68 -2
- package/dist/analytics/index.d.mts +86 -6
- package/dist/analytics/index.d.ts +86 -6
- package/dist/analytics/index.js +271 -472
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +269 -471
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/coachmarks/index.d.mts +15 -2
- package/dist/coachmarks/index.d.ts +15 -2
- package/dist/coachmarks/index.js +58 -14
- package/dist/coachmarks/index.js.map +1 -1
- package/dist/coachmarks/index.mjs +58 -14
- package/dist/coachmarks/index.mjs.map +1 -1
- package/dist/{currentSession-ClkLjcJ0.d.mts → currentSession-DgJf0fRz.d.mts} +4 -4
- package/dist/{currentSession-DOVZEWJl.d.ts → currentSession-EOHU64QD.d.ts} +4 -4
- package/dist/{decision-Bl_M2y3r.d.mts → decision-Bgo17oH7.d.mts} +1 -1
- package/dist/{decision-Cau5KmP6.d.ts → decision-Bkh_LigV.d.ts} +1 -1
- package/dist/index.d.mts +27 -4
- package/dist/index.d.ts +27 -4
- package/dist/index.js +224 -575
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +221 -572
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.d.mts +43 -11
- package/dist/questionnaire/index.d.ts +43 -11
- package/dist/questionnaire/index.js +45 -13
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +45 -13
- package/dist/questionnaire/index.mjs.map +1 -1
- package/dist/reviews/index.d.mts +5 -5
- package/dist/reviews/index.d.ts +5 -5
- package/dist/reviews/index.js +31 -9
- package/dist/reviews/index.js.map +1 -1
- package/dist/reviews/index.mjs +31 -9
- package/dist/reviews/index.mjs.map +1 -1
- package/dist/showcase/index.d.mts +1 -1
- package/dist/showcase/index.d.ts +1 -1
- package/dist/showcase/index.js +7 -2
- package/dist/showcase/index.js.map +1 -1
- package/dist/showcase/index.mjs +7 -2
- package/dist/showcase/index.mjs.map +1 -1
- package/dist/{transport-CF_eHwzC.d.mts → transport-B_0SgCBe.d.ts} +44 -5
- package/dist/{transport-DsRe4epC.d.ts → transport-j5gFfJhK.d.mts} +44 -5
- package/dist/{types-CKFhyrMu.d.mts → types-BpwiRpA8.d.mts} +1 -1
- package/dist/{types-CKFhyrMu.d.ts → types-BpwiRpA8.d.ts} +1 -1
- package/dist/{types-CNUqMK0D.d.mts → types-Cju-1_jT.d.mts} +42 -2
- package/dist/{types-Buj9Lw9t.d.ts → types-h2BZvl1t.d.ts} +42 -2
- package/llms.txt +1 -1
- package/package.json +6 -1
- package/src/OnboardingFlow.tsx +44 -15
- package/src/WireOnboarding.tsx +7 -6
- package/src/activation/revalidation.ts +9 -1
- package/src/activation/wireActivation.ts +3 -3
- package/src/analytics/analyticsFacade.ts +2 -2
- package/src/analytics/currentSession.ts +10 -0
- package/src/analytics/eventQueue.ts +88 -20
- package/src/analytics/index.ts +6 -0
- package/src/analytics/reportClientEvent.ts +29 -7
- package/src/analytics/wireDoctor.ts +330 -0
- package/src/cards/CardGridSelectCard.tsx +1 -1
- package/src/cards/ChipSelectCard.tsx +2 -2
- package/src/cards/SelectionCard.tsx +1 -1
- package/src/coachmarks/runtime.ts +72 -3
- package/src/coachmarks/useCoachmarkTour.ts +62 -14
- package/src/context/deviceId.ts +14 -5
- package/src/features/WireFeaturesProvider.tsx +12 -1
- package/src/identity/identityRecord.ts +9 -1
- package/src/identity/userIdentity.ts +1 -1
- package/src/questionnaire/QuestionnaireGate.tsx +90 -10
- package/src/questionnaire/index.ts +9 -1
- package/src/questionnaire/transport.ts +46 -11
- package/src/reviews/ReviewGate.tsx +61 -6
- package/src/reviews/index.ts +10 -1
- package/src/reviews/runtime.ts +11 -1
- package/src/reviews/transport.ts +58 -12
- package/src/session-analytics/useLifecycleEvents.ts +1 -1
- package/src/theme/ThemeContext.tsx +49 -1
- package/src/types.ts +1 -1
- package/src/utils/submitResult.ts +39 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { R as ReportAppEventOptions, r as reportAppEvent } from '../transport-
|
|
2
|
-
import { W as WireUserContext, E as EventQueueOptions } from '../currentSession-
|
|
3
|
-
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent,
|
|
4
|
-
import '../types-
|
|
1
|
+
export { R as ReportAppEventOptions, r as reportAppEvent } from '../transport-B_0SgCBe.js';
|
|
2
|
+
import { C as ClientEventTarget, W as WireUserContext, E as EventQueueOptions } from '../currentSession-EOHU64QD.js';
|
|
3
|
+
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, c as ClientEvent, d as ClientEventType, e as ContextEnvelope, f as ContextEnvelopeInput, D as DeviceKeyStorage, g as EnvelopeSource, h as EventQueue, R as ResolveAutoDeviceKeyOptions, i as WIRE_ONBOARDING_EVENTS, j as WireOnboardingEventName, k as analyticsUserIdStorageKey, l as buildContextEnvelope, m as clearPiiFromContext, n as clearUserContext, o as createEventQueue, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, s as looksLikeEmail, t as makeSessionId, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, B as resetEventQueueKeys, F as resolveAutoDeviceKey, G as setCurrentSessionId, H as toAnalyticsEvent } from '../currentSession-EOHU64QD.js';
|
|
4
|
+
import { W as WireOnboardingStorage } from '../types-BpwiRpA8.js';
|
|
5
|
+
import '../types-h2BZvl1t.js';
|
|
5
6
|
import '../types-BKfpdZzX.js';
|
|
6
7
|
import '../types-BcmagF6K.js';
|
|
7
|
-
import '../types-CKFhyrMu.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import 'wireai-rn';
|
|
10
10
|
import 'react-native';
|
|
@@ -95,6 +95,86 @@ interface NavigationRefLike {
|
|
|
95
95
|
*/
|
|
96
96
|
declare const useScreenTracking: (navigationRef: NavigationRefLike | undefined, options?: ScreenTrackerOptions) => void;
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* wireDoctor: a DEV-ONLY, opt-in self-check that proves a fresh integration end to end before the
|
|
100
|
+
* first real user ever runs it.
|
|
101
|
+
*
|
|
102
|
+
* WHY IT EXISTS: the `/v1/events` endpoint answers HTTP **200** for a batch it throws away. It
|
|
103
|
+
* reports the refusal in the response body (`{written, skipped, errors:[{reason, field}]}`), so a
|
|
104
|
+
* mis-wired integration looks perfectly healthy from the outside while every event evaporates. A
|
|
105
|
+
* numeric `ts` did exactly that through 0.13.0. This turns that class of loss from something you
|
|
106
|
+
* discover in a funnel report weeks later into something the first run tells you.
|
|
107
|
+
*
|
|
108
|
+
* SHAPE: four independent checks, each a `{name, ok, detail}` unit that can be read (and tested)
|
|
109
|
+
* without the others. The report is data, never a thrown error and never a side effect on the host:
|
|
110
|
+
*
|
|
111
|
+
* 1. `target` : is there a server URL and a key, and do they look like a key and a URL?
|
|
112
|
+
* 2. `reachability`: is the server actually there? (`GET /v1/events/contract`, public and cheap)
|
|
113
|
+
* 3. `storage` : can the offline queue persist? (a write / read / delete probe)
|
|
114
|
+
* 4. `round_trip` : does a REAL event survive REAL server validation? (a `dry_run` POST)
|
|
115
|
+
*
|
|
116
|
+
* NEVER THROWS, under any input, any network condition, or any hostile response object. A doctor
|
|
117
|
+
* that can crash the screen it is diagnosing is worse than no doctor.
|
|
118
|
+
*
|
|
119
|
+
* ⛔ NEVER PRINTS A SECRET. The `target` check reports the key's SHAPE (present / absent, length,
|
|
120
|
+
* whether the prefix is the expected one) and never any character of the key itself, in any
|
|
121
|
+
* `detail`, any log line, or any error. `wireDoctor.test.ts` asserts that with a sentinel key.
|
|
122
|
+
*
|
|
123
|
+
* COSTS A NON-CALLER NOTHING: it is a plain function behind the `./analytics` subpath, the package
|
|
124
|
+
* is `sideEffects: false`, and this module has no top-level side effects, so a host that never
|
|
125
|
+
* imports it never bundles it. It also mints no `globalThis` slot and retains no timer or listener.
|
|
126
|
+
*
|
|
127
|
+
* USAGE (dev builds only):
|
|
128
|
+
*
|
|
129
|
+
* import { wireDoctor } from "@wireai/activation/analytics";
|
|
130
|
+
*
|
|
131
|
+
* const report = await wireDoctor({
|
|
132
|
+
* target: { serverUrl: "https://api.example.com", apiKey: DRIVELINE_KEY },
|
|
133
|
+
* storage: AsyncStorage,
|
|
134
|
+
* });
|
|
135
|
+
* console.log(report.ok, report.checks);
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
/** One diagnosis. `name` is stable and machine-readable; `detail` is for a human reading a console. */
|
|
139
|
+
type WireDoctorCheck = {
|
|
140
|
+
/**
|
|
141
|
+
* Stable id: `target` | `reachability` | `storage` | `round_trip` | `dev_only` | `internal_error`.
|
|
142
|
+
*
|
|
143
|
+
* `dev_only` means ONE thing and only that thing: `__DEV__` is unset or false, so nothing ran.
|
|
144
|
+
* `internal_error` is the separate catch-all for a failure that got past every check's own
|
|
145
|
+
* swallow. They are distinct names because a consumer branching on `dev_only` would otherwise
|
|
146
|
+
* read an internal fault as "this is a release build" and report a healthy skip.
|
|
147
|
+
*/
|
|
148
|
+
name: string;
|
|
149
|
+
ok: boolean;
|
|
150
|
+
/** Human-readable result. ⛔ Never contains any part of an API key. */
|
|
151
|
+
detail: string;
|
|
152
|
+
};
|
|
153
|
+
/** What {@link wireDoctor} resolves to. `ok` is true only when EVERY check passed. */
|
|
154
|
+
type WireDoctorReport = {
|
|
155
|
+
ok: boolean;
|
|
156
|
+
checks: WireDoctorCheck[];
|
|
157
|
+
};
|
|
158
|
+
/** Input for {@link wireDoctor}. `storage` is optional: without it the queue runs in-memory only. */
|
|
159
|
+
type WireDoctorOptions = {
|
|
160
|
+
/** The same `{serverUrl, apiKey}` the kit is configured with. */
|
|
161
|
+
target: ClientEventTarget | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* The host storage the offline queue would use (AsyncStorage-compatible). Omit it and the storage
|
|
164
|
+
* check reports the DEGRADED in-memory mode rather than failing.
|
|
165
|
+
*/
|
|
166
|
+
storage?: WireOnboardingStorage;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Run the full diagnosis. Resolves a report; NEVER throws and NEVER rejects.
|
|
170
|
+
*
|
|
171
|
+
* DEV-ONLY BY CONTRACT: the `__DEV__` guard is the FIRST statement, so a release build performs no
|
|
172
|
+
* network call, no storage write, and no work at all. The report says it was skipped rather than
|
|
173
|
+
* pretending everything passed, because a green report that never ran is the exact failure mode
|
|
174
|
+
* this whole feature exists to remove.
|
|
175
|
+
*/
|
|
176
|
+
declare const wireDoctor: (options: WireDoctorOptions) => Promise<WireDoctorReport>;
|
|
177
|
+
|
|
98
178
|
/** Arbitrary non-PII event properties. Serialized to the event's `meta` (a JSON string) on the wire. */
|
|
99
179
|
type AnalyticsProps = Record<string, unknown>;
|
|
100
180
|
/**
|
|
@@ -203,4 +283,4 @@ declare const createAnalytics: (config: CreateAnalyticsConfig, options?: Analyti
|
|
|
203
283
|
*/
|
|
204
284
|
declare const useAnalytics: (config: CreateAnalyticsConfig, options?: AnalyticsOptions) => Analytics;
|
|
205
285
|
|
|
206
|
-
export { type Analytics, type AnalyticsOptions, type AnalyticsProps, type CreateAnalyticsConfig, EventQueueOptions, type NavigationRefLike, type NavigationRouteLike, type NavigationStateLike, type ScreenTracker, type ScreenTrackerOptions, createAnalytics, createScreenTracker, getActiveRouteName, screenTrackingHandler, useAnalytics, useScreenTracking };
|
|
286
|
+
export { type Analytics, type AnalyticsOptions, type AnalyticsProps, ClientEventTarget, type CreateAnalyticsConfig, EventQueueOptions, type NavigationRefLike, type NavigationRouteLike, type NavigationStateLike, type ScreenTracker, type ScreenTrackerOptions, type WireDoctorCheck, type WireDoctorOptions, type WireDoctorReport, createAnalytics, createScreenTracker, getActiveRouteName, screenTrackingHandler, useAnalytics, useScreenTracking, wireDoctor };
|