@wireai/activation 0.14.3 → 0.15.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/AGENTS.md +1 -1
- package/CHANGELOG.md +73 -0
- package/README.md +11 -7
- package/dist/analytics/index.d.mts +5 -5
- package/dist/analytics/index.d.ts +5 -5
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/coachmarks/index.d.mts +1 -1
- package/dist/coachmarks/index.d.ts +1 -1
- package/dist/coachmarks/index.js +47 -2
- package/dist/coachmarks/index.js.map +1 -1
- package/dist/coachmarks/index.mjs +47 -2
- package/dist/coachmarks/index.mjs.map +1 -1
- package/dist/{currentSession-CW_5Mq4O.d.ts → currentSession-CFSRZ2wg.d.ts} +10 -4
- package/dist/{currentSession-CUvTOchb.d.mts → currentSession-orZy5p1e.d.mts} +10 -4
- package/dist/{decision-Bgo17oH7.d.mts → decision-3vWLuBlO.d.ts} +11 -2
- package/dist/{decision-Bkh_LigV.d.ts → decision-yBj2AyPW.d.mts} +11 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/questionnaire/index.d.mts +3 -3
- package/dist/questionnaire/index.d.ts +3 -3
- package/dist/questionnaire/index.js +48 -3
- package/dist/questionnaire/index.js.map +1 -1
- package/dist/questionnaire/index.mjs +48 -3
- package/dist/questionnaire/index.mjs.map +1 -1
- package/dist/reviews/index.d.mts +10 -6
- package/dist/reviews/index.d.ts +10 -6
- package/dist/reviews/index.js +167 -18
- package/dist/reviews/index.js.map +1 -1
- package/dist/reviews/index.mjs +167 -18
- 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 +47 -2
- package/dist/showcase/index.js.map +1 -1
- package/dist/showcase/index.mjs +47 -2
- package/dist/showcase/index.mjs.map +1 -1
- package/dist/{transport-j5gFfJhK.d.mts → transport-s5QxA-ci.d.mts} +18 -13
- package/dist/{transport-B_0SgCBe.d.ts → transport-xqqSFqxs.d.ts} +18 -13
- package/dist/{types-Cju-1_jT.d.mts → types-Byx306Kv.d.mts} +25 -10
- package/dist/{types-BcmagF6K.d.mts → types-D_0B0yay.d.mts} +7 -2
- package/dist/{types-BcmagF6K.d.ts → types-D_0B0yay.d.ts} +7 -2
- package/dist/{types-h2BZvl1t.d.ts → types-tdATL5z0.d.ts} +25 -10
- package/package.json +1 -1
- package/src/WireOnboarding.tsx +4 -1
- package/src/coachmarks/runtime.ts +103 -2
- package/src/coachmarks/types.ts +7 -2
- package/src/context/deviceId.ts +32 -0
- package/src/reviews/ReviewGate.tsx +86 -37
- package/src/reviews/decision.ts +11 -1
- package/src/reviews/idempotency.ts +71 -0
- package/src/reviews/index.ts +4 -2
- package/src/reviews/runtime.ts +5 -3
- package/src/reviews/transport.ts +17 -12
- package/src/reviews/types.ts +7 -0
- package/src/types.ts +10 -4
- package/src/utils/submitResult.ts +17 -9
|
@@ -685,8 +685,11 @@ type WireOnboardingProps = {
|
|
|
685
685
|
*
|
|
686
686
|
* SINCE 0.12.2, leaving it out no longer silently empties the funnel: when you pass `storage` and
|
|
687
687
|
* this prop carries no `device_key`, the kit injects its OWN per-install key — the same one the
|
|
688
|
-
* analytics surfaces mint and persist — so the default wiring joins.
|
|
689
|
-
* verbatim and is never touched
|
|
688
|
+
* analytics surfaces mint and persist — so the default wiring joins. A `device_key` you DO pass
|
|
689
|
+
* wins verbatim and is never touched, provided it is a string with at least one non-whitespace
|
|
690
|
+
* character (`resolveIdentity`) — this map also accepts numbers and booleans, and a non-string or
|
|
691
|
+
* all-whitespace value is not a usable join key, so it is read as absent and the auto key is
|
|
692
|
+
* merged over it. See `autoJoinKey` for the opt-out and the two cases where the kit
|
|
690
693
|
* still cannot fill the gap (no `storage`, or you opted out), which keep warning in dev.
|
|
691
694
|
*
|
|
692
695
|
* Never hand-write `userContext={{ deviceKey }}`: the server's device lookup reads `device_key`,
|
|
@@ -713,8 +716,11 @@ type WireOnboardingProps = {
|
|
|
713
716
|
* `autoJoinKey={false}` if you genuinely want an UNLINKED onboarding session; that restores the
|
|
714
717
|
* pre-0.12.2 behavior exactly (nothing injected) and the dev warning fires again.
|
|
715
718
|
*
|
|
716
|
-
* Two things this flag does NOT do. It never overrides a `device_key` you
|
|
717
|
-
* key always wins, whatever this is set to
|
|
719
|
+
* Two things this flag does NOT do. It never overrides a `device_key` you actually supplied — a
|
|
720
|
+
* host-supplied key always wins, whatever this is set to, where "supplied" means a string with at
|
|
721
|
+
* least one non-whitespace character (`resolveIdentity`); a non-string or an all-whitespace value
|
|
722
|
+
* is read as absent and the auto key is merged over it. And it cannot conjure a key without
|
|
723
|
+
* `storage`: with no
|
|
718
724
|
* persistence the kit's id is minted fresh every launch, and a per-launch key corrupts
|
|
719
725
|
* `min_sessions` instead of merely leaving the join empty, so the kit declines to inject and warns
|
|
720
726
|
* in dev instead.
|
|
@@ -685,8 +685,11 @@ type WireOnboardingProps = {
|
|
|
685
685
|
*
|
|
686
686
|
* SINCE 0.12.2, leaving it out no longer silently empties the funnel: when you pass `storage` and
|
|
687
687
|
* this prop carries no `device_key`, the kit injects its OWN per-install key — the same one the
|
|
688
|
-
* analytics surfaces mint and persist — so the default wiring joins.
|
|
689
|
-
* verbatim and is never touched
|
|
688
|
+
* analytics surfaces mint and persist — so the default wiring joins. A `device_key` you DO pass
|
|
689
|
+
* wins verbatim and is never touched, provided it is a string with at least one non-whitespace
|
|
690
|
+
* character (`resolveIdentity`) — this map also accepts numbers and booleans, and a non-string or
|
|
691
|
+
* all-whitespace value is not a usable join key, so it is read as absent and the auto key is
|
|
692
|
+
* merged over it. See `autoJoinKey` for the opt-out and the two cases where the kit
|
|
690
693
|
* still cannot fill the gap (no `storage`, or you opted out), which keep warning in dev.
|
|
691
694
|
*
|
|
692
695
|
* Never hand-write `userContext={{ deviceKey }}`: the server's device lookup reads `device_key`,
|
|
@@ -713,8 +716,11 @@ type WireOnboardingProps = {
|
|
|
713
716
|
* `autoJoinKey={false}` if you genuinely want an UNLINKED onboarding session; that restores the
|
|
714
717
|
* pre-0.12.2 behavior exactly (nothing injected) and the dev warning fires again.
|
|
715
718
|
*
|
|
716
|
-
* Two things this flag does NOT do. It never overrides a `device_key` you
|
|
717
|
-
* key always wins, whatever this is set to
|
|
719
|
+
* Two things this flag does NOT do. It never overrides a `device_key` you actually supplied — a
|
|
720
|
+
* host-supplied key always wins, whatever this is set to, where "supplied" means a string with at
|
|
721
|
+
* least one non-whitespace character (`resolveIdentity`); a non-string or an all-whitespace value
|
|
722
|
+
* is read as absent and the auto key is merged over it. And it cannot conjure a key without
|
|
723
|
+
* `storage`: with no
|
|
718
724
|
* persistence the kit's id is minted fresh every launch, and a per-launch key corrupts
|
|
719
725
|
* `min_sessions` instead of merely leaving the join empty, so the kit declines to inject and warns
|
|
720
726
|
* in dev instead.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-
|
|
1
|
+
import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-tdATL5z0.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* decision.ts — the pure decision logic for the review gate.
|
|
@@ -65,7 +65,14 @@ declare const evaluateGate: (rules: GateRules, s: GateSignals) => ReviewDecision
|
|
|
65
65
|
* never a button labeled "rate us 5 stars" (see the store-policy notes in the README).
|
|
66
66
|
*/
|
|
67
67
|
declare const routeRating: (stars: number) => RatingRoute;
|
|
68
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Build the `POST /v1/reviews` body. Feedback text/contact belong ONLY here, never in events.
|
|
70
|
+
*
|
|
71
|
+
* STILL PURE, deliberately: `idempotencyKey` and the `meta.device_key` the server scopes it to are
|
|
72
|
+
* both passed IN rather than resolved here. Reaching into the device-key registry from this function
|
|
73
|
+
* would make the gate logic untestable in isolation, and both values are scoped to an impression
|
|
74
|
+
* this function cannot see — see `reviews/idempotency.ts`.
|
|
75
|
+
*/
|
|
69
76
|
declare const buildReviewSubmission: (input: {
|
|
70
77
|
stars: number;
|
|
71
78
|
feedbackText?: string;
|
|
@@ -73,6 +80,8 @@ declare const buildReviewSubmission: (input: {
|
|
|
73
80
|
contact?: string;
|
|
74
81
|
sessionId?: string;
|
|
75
82
|
source?: string;
|
|
83
|
+
/** The impression's idempotency key. Omitted → the server mints a row id and inserts, as before. */
|
|
84
|
+
idempotencyKey?: string;
|
|
76
85
|
meta?: Record<string, unknown>;
|
|
77
86
|
}) => ReviewSubmission;
|
|
78
87
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-
|
|
1
|
+
import { c as ReviewDecision, j as ReviewSubmission, e as RatingRoute } from './types-Byx306Kv.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* decision.ts — the pure decision logic for the review gate.
|
|
@@ -65,7 +65,14 @@ declare const evaluateGate: (rules: GateRules, s: GateSignals) => ReviewDecision
|
|
|
65
65
|
* never a button labeled "rate us 5 stars" (see the store-policy notes in the README).
|
|
66
66
|
*/
|
|
67
67
|
declare const routeRating: (stars: number) => RatingRoute;
|
|
68
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Build the `POST /v1/reviews` body. Feedback text/contact belong ONLY here, never in events.
|
|
70
|
+
*
|
|
71
|
+
* STILL PURE, deliberately: `idempotencyKey` and the `meta.device_key` the server scopes it to are
|
|
72
|
+
* both passed IN rather than resolved here. Reaching into the device-key registry from this function
|
|
73
|
+
* would make the gate logic untestable in isolation, and both values are scoped to an impression
|
|
74
|
+
* this function cannot see — see `reviews/idempotency.ts`.
|
|
75
|
+
*/
|
|
69
76
|
declare const buildReviewSubmission: (input: {
|
|
70
77
|
stars: number;
|
|
71
78
|
feedbackText?: string;
|
|
@@ -73,6 +80,8 @@ declare const buildReviewSubmission: (input: {
|
|
|
73
80
|
contact?: string;
|
|
74
81
|
sessionId?: string;
|
|
75
82
|
source?: string;
|
|
83
|
+
/** The impression's idempotency key. Omitted → the server mints a row id and inserts, as before. */
|
|
84
|
+
idempotencyKey?: string;
|
|
76
85
|
meta?: Record<string, unknown>;
|
|
77
86
|
}) => ReviewSubmission;
|
|
78
87
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-
|
|
4
|
-
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-
|
|
3
|
+
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-orZy5p1e.mjs';
|
|
4
|
+
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-orZy5p1e.mjs';
|
|
5
5
|
import { O as OnboardingTheme } from './types-BKfpdZzX.mjs';
|
|
6
6
|
export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.mjs';
|
|
7
7
|
export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-C3qQBHsA.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode } from 'react';
|
|
3
|
-
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-
|
|
4
|
-
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-
|
|
3
|
+
import { I as WireOnboardingProps, J as WireOnboardingConfig, O as OnboardingResult, K as WirePermissionStatus, P as PermissionStage, L as WirePermissionOutcome, S as StepValidator, M as OnboardingEvent, N as OnboardingCopy, C as ClientEventTarget, Q as DeviceContext, T as PermissionScreenConfig, W as WireUserContext, c as ClientEvent, U as PermissionPlacement, g as EnvelopeSource } from './currentSession-CFSRZ2wg.js';
|
|
4
|
+
export { A as AUTO_DEVICE_ID_PREFIX, a as AnalyticsEvent, b as ClearUserContextOptions, d as ClientEventType, V as DEFAULT_PERMISSION_COPY, X as DeviceFormFactor, D as DeviceKeyStorage, Y as EXTRA_KEY_PREFIX, Z as GENERIC_PERMISSION_COPY, _ as IdentifyOnboardingBinding, $ as IdentifyOnboardingOptions, a0 as IdentityRecord, a1 as IdentitySource, a2 as IdentitySpace, a3 as NOTIFICATIONS_PERMISSION_COPY, a4 as OnboardingProgress, a5 as PermissionScreenCopy, R as ResolveAutoDeviceKeyOptions, a6 as ResolveUserContextOptions, a7 as ResolvedUserContext, a8 as USER_ID_MAX_LENGTH, i as WIRE_ONBOARDING_EVENTS, a9 as WIRE_PERMISSION_EVENTS, j as WireOnboardingEventName, aa as WirePermissionEventName, ab as WirePermissionKind, ac as activationJoinContext, k as analyticsUserIdStorageKey, m as clearPiiFromContext, n as clearUserContext, ad as collectDeviceContext, p as deviceIdStorageKey, q as ensureCurrentSessionId, r as getCurrentSessionId, ae as hashEmailFnv1a, af as hostIdentity, ag as hydrateAutoDeviceKey, ah as hydrateDeviceIdentity, ai as identifyOnboarding, aj as isWireScalar, s as looksLikeEmail, t as makeSessionId, ak as mintDeviceId, al as namespaceExtra, am as normalizePermissionStatus, an as permissionEventName, ao as permissionEventProps, u as reportClientEvent, v as reportClientEventAwait, w as reportClientEvents, x as reportClientEventsAwait, y as resetAutoDeviceKeys, z as resetCurrentSessionId, ap as resetIdentityProvenance, F as resolveAutoDeviceKey, aq as resolveIdentity, ar as resolvePermissionCopy, as as resolveUserContext, at as sanitizeUserId, G as setCurrentSessionId, H as toAnalyticsEvent } from './currentSession-CFSRZ2wg.js';
|
|
5
5
|
import { O as OnboardingTheme } from './types-BKfpdZzX.js';
|
|
6
6
|
export { a as OnboardingButtonStyle, b as OnboardingColors, c as OnboardingFonts, d as OnboardingRadius, e as OnboardingSpacing } from './types-BKfpdZzX.js';
|
|
7
7
|
export { C as CenteredModal, a as CenteredModalHandle, b as CenteredModalProps } from './CenteredModal-Cdgns6--.js';
|