ad2app-lib 1.36.0 → 1.37.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/package.json
CHANGED
|
@@ -86,7 +86,9 @@ const EVENT_PROPERTY_WITNESS: { [E in keyof EventProperties]: EventProperties[E]
|
|
|
86
86
|
[EVENTS.PLAYBOOK_DOWNLOADED]: {},
|
|
87
87
|
[EVENTS.SIGNED_UP]: { method: "email", role: "creator" },
|
|
88
88
|
[EVENTS.PROFILE_COMPLETED]: { role: "creator" },
|
|
89
|
-
|
|
89
|
+
// Spec 161 T010: proves 'apple' type-checks alongside the pre-existing
|
|
90
|
+
// 'email' | 'google' union (compile-time, enforced by `tsc --noEmit`).
|
|
91
|
+
[EVENTS.LOGGED_IN]: { method: "apple" },
|
|
90
92
|
[EVENTS.SOCIAL_ACCOUNT_CONNECTED]: { platform: "instagram" },
|
|
91
93
|
[EVENTS.COMPOSE_STARTED]: {},
|
|
92
94
|
[EVENTS.COMPOSE_STEP_VIEWED]: { step: "content" },
|
|
@@ -489,6 +491,17 @@ test("159 native_session_renewed carries no properties (the fact of the renewal
|
|
|
489
491
|
assert.deepEqual(renewed, {});
|
|
490
492
|
});
|
|
491
493
|
|
|
494
|
+
test("161 logged_in.method accepts all three sign-in methods, and stays optional", () => {
|
|
495
|
+
const email: EventProperties[typeof EVENTS.LOGGED_IN] = { method: "email" };
|
|
496
|
+
const google: EventProperties[typeof EVENTS.LOGGED_IN] = { method: "google" };
|
|
497
|
+
const apple: EventProperties[typeof EVENTS.LOGGED_IN] = { method: "apple" };
|
|
498
|
+
const unset: EventProperties[typeof EVENTS.LOGGED_IN] = {};
|
|
499
|
+
assert.equal(email.method, "email");
|
|
500
|
+
assert.equal(google.method, "google");
|
|
501
|
+
assert.equal(apple.method, "apple");
|
|
502
|
+
assert.deepEqual(unset, {});
|
|
503
|
+
});
|
|
504
|
+
|
|
492
505
|
test("159 LAUNCH_CONTEXT_PROPS governs the build-attribution key (no raw 'app_build' string at the call site)", () => {
|
|
493
506
|
assert.equal(LAUNCH_CONTEXT_PROPS.APP_BUILD, "app_build");
|
|
494
507
|
});
|
package/src/analytics/index.ts
CHANGED
|
@@ -341,7 +341,11 @@ export interface EventProperties {
|
|
|
341
341
|
[EVENTS.PLAYBOOK_DOWNLOADED]: { edition_version?: string; format?: string };
|
|
342
342
|
[EVENTS.SIGNED_UP]: { method: 'email' | 'google'; role: string };
|
|
343
343
|
[EVENTS.PROFILE_COMPLETED]: { role: string };
|
|
344
|
-
|
|
344
|
+
// Spec 161: widened to include 'apple' — the value was already missing from
|
|
345
|
+
// this union (Google/email only) even though native Apple sign-in has
|
|
346
|
+
// existed since spec 136; this closes that gap rather than inventing a new
|
|
347
|
+
// property.
|
|
348
|
+
[EVENTS.LOGGED_IN]: { method?: 'email' | 'google' | 'apple' };
|
|
345
349
|
[EVENTS.SOCIAL_ACCOUNT_CONNECTED]: {
|
|
346
350
|
platform: string;
|
|
347
351
|
account_count?: number;
|