create-disposabl-app 0.15.0 → 0.16.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/README.md +15 -1
- package/dist/disposabl.js +357 -50
- package/dist/index.js +8973 -154
- package/dist/templates/default/apps/desktop/forge.config.mts +2 -1
- package/dist/templates/default/apps/docs/content/getting-started.mdx +1 -1
- package/dist/templates/default/apps/mobile/package.json +1 -0
- package/dist/templates/default/apps/web/eslint.config.ts +5 -1
- package/dist/templates/default/apps/web/public/disposabl-logo-light.svg +8 -0
- package/dist/templates/default/apps/web/public/landing/coast.jpg +0 -0
- package/dist/templates/default/apps/web/public/landing/community.jpg +0 -0
- package/dist/templates/default/apps/web/public/landing/stores/app-store.svg +46 -0
- package/dist/templates/default/apps/web/public/landing/stores/google-play.png +0 -0
- package/dist/templates/default/apps/web/public/landing/taste/LICENSE +21 -0
- package/dist/templates/default/apps/web/public/landing/taste/init.js +3 -0
- package/dist/templates/default/apps/web/public/landing/taste/moments/lib.js +189 -0
- package/dist/templates/default/apps/web/public/landing/taste/moments/moments.js +109 -0
- package/dist/templates/default/apps/web/public/landing/taste/moments/word-highlight/moment.css +8 -0
- package/dist/templates/default/apps/web/public/landing/taste/moments/word-highlight/moment.js +35 -0
- package/dist/templates/default/apps/web/public/landing/taste/motion/motion.css +321 -0
- package/dist/templates/default/apps/web/public/landing/taste/motion/motion.js +406 -0
- package/dist/templates/default/apps/web/routes.config.ts +14 -0
- package/dist/templates/default/apps/web/src/router/__root.tsx +8 -2
- package/dist/templates/default/apps/web/tsr.config.json +1 -1
- package/dist/templates/default/apps/web/vite.config.ts +10 -2
- package/dist/templates/default/bun.lock +6 -0
- package/dist/templates/default/bunfig.toml +1 -0
- package/dist/templates/default/disposabl.json +1 -1
- package/dist/templates/default/packages/backend/convex/authSetup.ts +2 -5
- package/dist/templates/default/packages/backend/convex/billing.ts +5 -0
- package/dist/templates/default/packages/backend/convex/billingHandoff.ts +6 -0
- package/dist/templates/default/packages/backend/convex/convex.config.ts +8 -0
- package/dist/templates/default/packages/backend/convex/http.ts +6 -0
- package/dist/templates/default/packages/backend/convex/revenuecat.ts +13 -0
- package/dist/templates/default/packages/backend/convex/schema.ts +44 -0
- package/dist/templates/default/packages/backend/convex/telemetry.ts +41 -5
- package/dist/templates/default/packages/backend/generate.ts +6 -0
- package/dist/templates/default/packages/cli/auth.ts +36 -3
- package/dist/templates/default/packages/cli/build.ts +6 -0
- package/dist/templates/default/packages/cli/client.ts +189 -19
- package/dist/templates/default/packages/cli/errors.ts +18 -0
- package/dist/templates/default/packages/cli/telemetry-build.ts +27 -0
- package/dist/templates/default/packages/cli/telemetry.ts +266 -0
- package/dist/templates/default/packages/disposabl-kit/PAYMENTS.md +23 -5
- package/dist/templates/default/packages/disposabl-kit/client/lib/telemetry.ts +24 -2
- package/dist/templates/default/packages/disposabl-kit/client/lib/theme.ts +1 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/billing-login.tsx +92 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/pricing.tsx +113 -43
- package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +13 -5
- package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +3 -2
- package/dist/templates/default/packages/disposabl-kit/lib/telemetry.ts +148 -12
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/account-billing.tsx +143 -40
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/paywall.ts +83 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/policy.ts +125 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/session.ts +31 -3
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/topup.ts +99 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/use-topup.ts +116 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/billing/web-checkout.ts +190 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/layout.tsx +9 -2
- package/dist/templates/default/packages/disposabl-kit/package.json +10 -1
- package/dist/templates/default/packages/disposabl-kit/payments/checkout-attempt.ts +64 -0
- package/dist/templates/default/packages/disposabl-kit/payments/config.ts +16 -3
- package/dist/templates/default/packages/disposabl-kit/server/billing-functions.ts +218 -9
- package/dist/templates/default/packages/disposabl-kit/server/billing-handoff.ts +126 -0
- package/dist/templates/default/packages/disposabl-kit/server/billing-native-capability.ts +12 -0
- package/dist/templates/default/packages/disposabl-kit/server/billing-setup.ts +2 -0
- package/dist/templates/default/packages/disposabl-kit/server/billing.ts +31 -0
- package/dist/templates/default/packages/disposabl-kit/server/browser-session.ts +27 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/telemetry.ts +173 -59
- package/dist/templates/default/packages/disposabl-kit/server/revenuecat-contract.ts +233 -0
- package/dist/templates/default/packages/disposabl-kit/server/revenuecat-functions.ts +554 -0
- package/dist/templates/default/packages/disposabl-kit/server/revenuecat-validator.ts +76 -0
- package/dist/templates/default/packages/reconfigure-skill/SKILL.md +36 -0
- package/dist/templates/default/packages/sdk/README.md +21 -0
- package/dist/templates/default/packages/sdk/src/analytics.ts +102 -0
- package/dist/templates/default/packages/sdk/src/index.ts +2 -0
- package/dist/templates/default/packages/skill/SKILL.md +2 -0
- package/dist/templates/default/packages/skill/references/agent.md +2 -0
- package/dist/templates/default/packages/tests/billing-attempts.test.ts +156 -0
- package/dist/templates/default/packages/tests/billing-handoff.test.ts +116 -0
- package/dist/templates/default/packages/tests/billing-setup.test.ts +4 -3
- package/dist/templates/default/packages/tests/billing.test.ts +48 -4
- package/dist/templates/default/packages/tests/desktop-packaging.test.ts +12 -0
- package/dist/templates/default/packages/tests/flows/seo.e2e.ts +3 -1
- package/dist/templates/default/packages/tests/native-billing.test.ts +417 -0
- package/dist/templates/default/packages/tests/page-telemetry.test.ts +218 -0
- package/dist/templates/default/packages/tests/revenuecat-inbox.test.ts +476 -0
- package/dist/templates/default/packages/tests/sdk-analytics.test.ts +158 -0
- package/dist/templates/default/packages/tests/telemetry.test.ts +272 -55
- package/package.json +1 -1
- package/dist/templates/default/apps/web/src/routeTree.gen.ts +0 -578
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../disposabl-kit/server/lib/telemetry";
|
|
7
7
|
import {
|
|
8
8
|
pageCategory,
|
|
9
|
-
|
|
9
|
+
createPageTelemetry,
|
|
10
10
|
} from "../disposabl-kit/lib/telemetry";
|
|
11
11
|
|
|
12
12
|
const originalFetch = globalThis.fetch;
|
|
@@ -114,79 +114,250 @@ test("capture uses stable opaque authenticated identity and approved metadata",
|
|
|
114
114
|
);
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
})
|
|
117
|
+
function identityContext() {
|
|
118
|
+
const rows = new Map<
|
|
119
|
+
string,
|
|
120
|
+
{ _id: string; hash: string; expiresAt: number; userId?: string }
|
|
121
|
+
>();
|
|
122
|
+
const jobs: any[] = [];
|
|
123
|
+
let bucket: any = null;
|
|
124
|
+
const db = {
|
|
125
|
+
query: (table: string) => ({
|
|
126
|
+
withIndex: (_index: string, predicate: (q: any) => unknown) => {
|
|
127
|
+
let hash = "";
|
|
128
|
+
predicate({
|
|
129
|
+
eq: (_field: string, value: string) => {
|
|
130
|
+
hash = value;
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
unique: async () =>
|
|
135
|
+
table === "telemetryIssuance"
|
|
136
|
+
? bucket
|
|
137
|
+
: ([...rows.values()].find((row) => row.hash === hash) ?? null),
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
insert: async (table: string, value: any) => {
|
|
142
|
+
if (table === "telemetryIssuance") {
|
|
143
|
+
bucket = { _id: "bucket", ...value };
|
|
144
|
+
return "bucket";
|
|
145
|
+
}
|
|
146
|
+
const id = `row-${rows.size + 1}`;
|
|
147
|
+
rows.set(id, { _id: id, ...value });
|
|
148
|
+
return id;
|
|
149
|
+
},
|
|
150
|
+
patch: async (table: string, id: string, value: any) => {
|
|
151
|
+
Object.assign(
|
|
152
|
+
table === "telemetryIssuance" ? bucket : rows.get(id)!,
|
|
153
|
+
value,
|
|
154
|
+
);
|
|
155
|
+
},
|
|
156
|
+
get: async (_table: string, id: string) => rows.get(id) ?? null,
|
|
157
|
+
delete: async (_table: string, id: string) => {
|
|
158
|
+
rows.delete(id);
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
rows,
|
|
163
|
+
jobs,
|
|
164
|
+
exhaust: () => {
|
|
165
|
+
bucket = {
|
|
166
|
+
_id: "bucket",
|
|
167
|
+
key: "global",
|
|
168
|
+
tokens: 0,
|
|
169
|
+
updatedAt: Date.now(),
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
ctx: {
|
|
173
|
+
db,
|
|
174
|
+
scheduler: {
|
|
175
|
+
runAfter: async (...args: any[]) => {
|
|
176
|
+
jobs.push(args);
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
}
|
|
141
182
|
|
|
142
|
-
test("page ingestion
|
|
143
|
-
const { page } = await import("../backend/convex/telemetry");
|
|
183
|
+
test("page ingestion issues and binds an anonymous identity only to the verified account", async () => {
|
|
184
|
+
const { page, claimIdentity } = await import("../backend/convex/telemetry");
|
|
144
185
|
const { default: app } = await import("../../disposabl.json");
|
|
145
186
|
const originalFeatures = [...app.features];
|
|
146
|
-
(app.features
|
|
187
|
+
if (!app.features.includes("analytics" as never))
|
|
188
|
+
(app.features as string[]).push("analytics");
|
|
147
189
|
process.env.DISPOSABL_ENVIRONMENT = "production";
|
|
148
190
|
process.env.POSTHOG_PROJECT_TOKEN = "test-token";
|
|
149
191
|
process.env.POSTHOG_HOST = "https://us.i.posthog.com";
|
|
150
192
|
delete process.env.E2E_TELEMETRY_DISABLED;
|
|
151
193
|
delete process.env.POSTHOG_ENABLED;
|
|
152
|
-
|
|
194
|
+
const events: any[] = [];
|
|
195
|
+
globalThis.fetch = (async (_url, init) => {
|
|
196
|
+
events.push(JSON.parse(String(init?.body)));
|
|
197
|
+
return new Response(null, { status: 200 });
|
|
198
|
+
}) as typeof fetch;
|
|
199
|
+
const fixture = identityContext();
|
|
200
|
+
let user: string | null = null;
|
|
153
201
|
const ctx = {
|
|
154
|
-
auth: {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return { userId: "verified-user" };
|
|
158
|
-
},
|
|
159
|
-
scheduler: {
|
|
160
|
-
runAfter: async (_delay: number, _ref: unknown, args: unknown) => {
|
|
161
|
-
scheduled = args;
|
|
162
|
-
},
|
|
202
|
+
auth: {
|
|
203
|
+
getUserIdentity: async () =>
|
|
204
|
+
user ? { subject: "verified-session" } : null,
|
|
163
205
|
},
|
|
206
|
+
runQuery: async () => ({ userId: user }),
|
|
207
|
+
runMutation: async (_ref: unknown, args: any) =>
|
|
208
|
+
(claimIdentity as any)._handler(fixture.ctx, args),
|
|
164
209
|
};
|
|
210
|
+
const request = (anonymousId?: string, authenticated = false) =>
|
|
211
|
+
new Request("https://example.com/telemetry/page", {
|
|
212
|
+
method: "POST",
|
|
213
|
+
headers: authenticated ? { Authorization: "Bearer private-token" } : {},
|
|
214
|
+
body: JSON.stringify({
|
|
215
|
+
platform: "web",
|
|
216
|
+
page: "home",
|
|
217
|
+
...(anonymousId ? { anonymousId } : {}),
|
|
218
|
+
userId: "spoofed",
|
|
219
|
+
email: "private@example.com",
|
|
220
|
+
}),
|
|
221
|
+
});
|
|
165
222
|
try {
|
|
166
|
-
const
|
|
223
|
+
const first = await (page as any)._handler(ctx, request());
|
|
224
|
+
const { anonymousId } = await first.json();
|
|
225
|
+
assert.match(anonymousId, /^[0-9a-f-]{36}$/);
|
|
226
|
+
assert.equal(events[0].event, "page_view");
|
|
227
|
+
const anonymousDistinct = events[0].properties.distinct_id;
|
|
228
|
+
user = "verified-user";
|
|
229
|
+
const login = await (page as any)._handler(ctx, request(anonymousId, true));
|
|
230
|
+
assert.equal((await login.json()).anonymousId, anonymousId);
|
|
231
|
+
assert.equal(events[1].event, "$identify");
|
|
232
|
+
assert.equal(events[1].properties.$anon_distinct_id, anonymousDistinct);
|
|
233
|
+
assert.equal(
|
|
234
|
+
events[2].properties.distinct_id,
|
|
235
|
+
events[1].properties.distinct_id,
|
|
236
|
+
);
|
|
237
|
+
assert.doesNotMatch(
|
|
238
|
+
JSON.stringify(events),
|
|
239
|
+
/private|spoofed|verified-user/,
|
|
240
|
+
);
|
|
241
|
+
const fabricated = "12345678-1234-4123-8123-123456789abc";
|
|
242
|
+
const fakeResponse = await (page as any)._handler(
|
|
167
243
|
ctx,
|
|
168
|
-
|
|
169
|
-
method: "POST",
|
|
170
|
-
body: JSON.stringify({
|
|
171
|
-
platform: "web",
|
|
172
|
-
page: "home",
|
|
173
|
-
userId: "spoofed",
|
|
174
|
-
email: "private@example.com",
|
|
175
|
-
url: "https://private/?token=secret",
|
|
176
|
-
}),
|
|
177
|
-
}),
|
|
244
|
+
request(fabricated, true),
|
|
178
245
|
);
|
|
179
|
-
|
|
180
|
-
assert.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
246
|
+
const fakeResult = await fakeResponse.json();
|
|
247
|
+
assert.notEqual(fakeResult.anonymousId, fabricated);
|
|
248
|
+
const crypto = await import("node:crypto");
|
|
249
|
+
const fabricatedDistinct = crypto
|
|
250
|
+
.createHash("sha256")
|
|
251
|
+
.update(`disposabl:test-token:anonymous:${fabricated}`)
|
|
252
|
+
.digest("hex");
|
|
253
|
+
assert.notEqual(events[3].properties.$anon_distinct_id, fabricatedDistinct);
|
|
254
|
+
user = "different-user";
|
|
255
|
+
const switched = await (page as any)._handler(
|
|
256
|
+
ctx,
|
|
257
|
+
request(anonymousId, true),
|
|
258
|
+
);
|
|
259
|
+
assert.notEqual((await switched.json()).anonymousId, anonymousId);
|
|
260
|
+
assert.notEqual(events[5].properties.$anon_distinct_id, anonymousDistinct);
|
|
261
|
+
fixture.exhaust();
|
|
262
|
+
const eventCount = events.length;
|
|
263
|
+
const rowCount = fixture.rows.size;
|
|
264
|
+
const jobCount = fixture.jobs.length;
|
|
265
|
+
assert.equal(
|
|
266
|
+
(await (page as any)._handler(ctx, request(undefined, true))).status,
|
|
267
|
+
429,
|
|
268
|
+
);
|
|
269
|
+
assert.equal(fixture.rows.size, rowCount);
|
|
270
|
+
assert.equal(fixture.jobs.length, jobCount);
|
|
271
|
+
assert.equal(events.length, eventCount);
|
|
272
|
+
user = "verified-user";
|
|
273
|
+
assert.equal(
|
|
274
|
+
(await (page as any)._handler(ctx, request(anonymousId, true))).status,
|
|
275
|
+
200,
|
|
276
|
+
);
|
|
277
|
+
process.env.E2E_TELEMETRY_DISABLED = "1";
|
|
278
|
+
const count = events.length;
|
|
279
|
+
assert.equal(
|
|
280
|
+
(await (page as any)._handler(ctx, request(anonymousId, true))).status,
|
|
281
|
+
204,
|
|
282
|
+
);
|
|
283
|
+
assert.equal(events.length, count);
|
|
284
|
+
delete process.env.E2E_TELEMETRY_DISABLED;
|
|
285
|
+
user = null;
|
|
286
|
+
assert.equal(
|
|
287
|
+
(await (page as any)._handler(ctx, request(anonymousId, true))).status,
|
|
288
|
+
401,
|
|
289
|
+
);
|
|
290
|
+
assert.equal(events.length, count);
|
|
185
291
|
} finally {
|
|
186
292
|
app.features.splice(0, app.features.length, ...originalFeatures);
|
|
187
293
|
}
|
|
188
294
|
});
|
|
189
295
|
|
|
296
|
+
test("capabilities expire, cannot be reused by another account, and schedule bounded cleanup", async () => {
|
|
297
|
+
const { claimIdentity, expireIdentity } =
|
|
298
|
+
await import("../backend/convex/telemetry");
|
|
299
|
+
const { ctx, rows, jobs } = identityContext();
|
|
300
|
+
const claim = (hash: string | undefined, newHash: string, userId?: string) =>
|
|
301
|
+
(claimIdentity as any)._handler(ctx, { hash, newHash, userId });
|
|
302
|
+
assert.equal(await claim(undefined, "issued"), false);
|
|
303
|
+
assert.equal(await claim("issued", "unused", "a"), true);
|
|
304
|
+
assert.equal(await claim("issued", "unused", "a"), true);
|
|
305
|
+
assert.equal(await claim("issued", "second", "b"), false);
|
|
306
|
+
assert.equal(await claim("issued", "third"), false);
|
|
307
|
+
assert.equal(jobs.length, 3);
|
|
308
|
+
const original = [...rows.values()].find((row) => row.hash === "issued")!;
|
|
309
|
+
original.expiresAt = Date.now() - 1;
|
|
310
|
+
assert.equal(await claim("issued", "fourth", "a"), false);
|
|
311
|
+
await (expireIdentity as any)._handler(ctx, { id: original._id });
|
|
312
|
+
assert.equal(rows.has(original._id), false);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
test("issuance budget refills at one identity per minute", async () => {
|
|
316
|
+
const { claimIdentity } = await import("../backend/convex/telemetry");
|
|
317
|
+
const fixture = identityContext();
|
|
318
|
+
const originalNow = Date.now;
|
|
319
|
+
let now = 1_000_000;
|
|
320
|
+
Date.now = () => now;
|
|
321
|
+
try {
|
|
322
|
+
fixture.exhaust();
|
|
323
|
+
const claim = (newHash: string) =>
|
|
324
|
+
(claimIdentity as any)._handler(fixture.ctx, { newHash });
|
|
325
|
+
assert.equal(await claim("first"), null);
|
|
326
|
+
now += 59_999;
|
|
327
|
+
assert.equal(await claim("first"), null);
|
|
328
|
+
now++;
|
|
329
|
+
assert.equal(await claim("first"), false);
|
|
330
|
+
assert.equal(await claim("second"), null);
|
|
331
|
+
assert.equal(fixture.rows.size, 1);
|
|
332
|
+
assert.equal(fixture.jobs.length, 1);
|
|
333
|
+
} finally {
|
|
334
|
+
Date.now = originalNow;
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
test("anonymous capture and identify use the same opaque identity", async () => {
|
|
339
|
+
process.env.CONVEX_SITE_URL = config.productionConvexSiteUrl;
|
|
340
|
+
delete process.env.E2E_TELEMETRY_DISABLED;
|
|
341
|
+
delete process.env.POSTHOG_ENABLED;
|
|
342
|
+
const events: any[] = [];
|
|
343
|
+
globalThis.fetch = (async (_input, init) => {
|
|
344
|
+
events.push(JSON.parse(String(init?.body)));
|
|
345
|
+
return new Response(null, { status: 200 });
|
|
346
|
+
}) as typeof fetch;
|
|
347
|
+
const id = "12345678-1234-4123-8123-123456789abc";
|
|
348
|
+
await captureTelemetry("page_view", { page: "home" }, undefined, config, id);
|
|
349
|
+
await captureTelemetry("page_view", { page: "login" }, "user-a", config, id);
|
|
350
|
+
assert.equal(
|
|
351
|
+
events[0].properties.distinct_id,
|
|
352
|
+
events[1].properties.$anon_distinct_id,
|
|
353
|
+
);
|
|
354
|
+
assert.equal(events[1].event, "$identify");
|
|
355
|
+
assert.equal(
|
|
356
|
+
events[2].properties.distinct_id,
|
|
357
|
+
events[1].properties.distinct_id,
|
|
358
|
+
);
|
|
359
|
+
});
|
|
360
|
+
|
|
190
361
|
test("deployment telemetry sends only approved platform, channel and elapsed time", async () => {
|
|
191
362
|
process.env.CONVEX_SITE_URL = config.productionConvexSiteUrl;
|
|
192
363
|
delete process.env.E2E_TELEMETRY_DISABLED;
|
|
@@ -244,3 +415,49 @@ test("deployment telemetry sends only approved platform, channel and elapsed tim
|
|
|
244
415
|
);
|
|
245
416
|
assert.notEqual(body.properties.app_id, appId);
|
|
246
417
|
});
|
|
418
|
+
|
|
419
|
+
test("disabled, local and E2E capture makes no transport calls", async () => {
|
|
420
|
+
let calls = 0;
|
|
421
|
+
globalThis.fetch = (async () => {
|
|
422
|
+
calls++;
|
|
423
|
+
return new Response();
|
|
424
|
+
}) as typeof fetch;
|
|
425
|
+
delete process.env.DISPOSABL_ENVIRONMENT;
|
|
426
|
+
process.env.CONVEX_SITE_URL = "https://dev.convex.site";
|
|
427
|
+
delete process.env.E2E_TELEMETRY_DISABLED;
|
|
428
|
+
delete process.env.POSTHOG_ENABLED;
|
|
429
|
+
await captureTelemetry(
|
|
430
|
+
"page_view",
|
|
431
|
+
{ page: "home" },
|
|
432
|
+
"user",
|
|
433
|
+
config,
|
|
434
|
+
"12345678-1234-4123-8123-123456789abc",
|
|
435
|
+
);
|
|
436
|
+
process.env.CONVEX_SITE_URL = config.productionConvexSiteUrl;
|
|
437
|
+
process.env.E2E_TELEMETRY_DISABLED = "1";
|
|
438
|
+
await captureTelemetry(
|
|
439
|
+
"page_view",
|
|
440
|
+
{ page: "home" },
|
|
441
|
+
"user",
|
|
442
|
+
config,
|
|
443
|
+
"12345678-1234-4123-8123-123456789abc",
|
|
444
|
+
);
|
|
445
|
+
delete process.env.E2E_TELEMETRY_DISABLED;
|
|
446
|
+
process.env.POSTHOG_ENABLED = "false";
|
|
447
|
+
await captureTelemetry(
|
|
448
|
+
"page_view",
|
|
449
|
+
{ page: "home" },
|
|
450
|
+
"user",
|
|
451
|
+
config,
|
|
452
|
+
"12345678-1234-4123-8123-123456789abc",
|
|
453
|
+
);
|
|
454
|
+
delete process.env.POSTHOG_ENABLED;
|
|
455
|
+
await captureTelemetry(
|
|
456
|
+
"page_view",
|
|
457
|
+
{ page: "home" },
|
|
458
|
+
"user",
|
|
459
|
+
{ ...config, features: [] },
|
|
460
|
+
"12345678-1234-4123-8123-123456789abc",
|
|
461
|
+
);
|
|
462
|
+
assert.equal(calls, 0);
|
|
463
|
+
});
|