create-disposabl-app 0.20.15 → 0.20.17
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/disposabl.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/default/.github/scripts/apple.sh +9 -0
- package/dist/templates/default/.github/workflows/pipeline.yml +1 -1
- package/dist/templates/default/apps/mobile/eas.json +2 -0
- package/dist/templates/default/apps/mobile/package.json +14 -14
- package/dist/templates/default/apps/mobile/scripts/android-release-verify.mjs +11 -1
- package/dist/templates/default/bun.lock +103 -169
- package/dist/templates/default/disposabl.json +1 -1
- package/dist/templates/default/package.json +6 -6
- package/dist/templates/default/packages/backend/convex/authEmail.ts +1 -1
- package/dist/templates/default/packages/backend/convex/convex.config.ts +1 -0
- package/dist/templates/default/packages/backend/convex/users/internal.ts +13 -16
- package/dist/templates/default/packages/disposabl-kit/PAYMENTS.md +6 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/google-sign-in.tsx +0 -2
- package/dist/templates/default/packages/disposabl-kit/client/components/legal-page.tsx +4 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/verify-email.tsx +4 -2
- package/dist/templates/default/packages/disposabl-kit/client/routes/pricing.tsx +18 -4
- package/dist/templates/default/packages/disposabl-kit/legal/config.ts +10 -7
- package/dist/templates/default/packages/disposabl-kit/legal/documents/privacy.ts +3 -1
- package/dist/templates/default/packages/disposabl-kit/legal/index.ts +2 -1
- package/dist/templates/default/packages/disposabl-kit/legal/publisher.ts +5 -1
- package/dist/templates/default/packages/disposabl-kit/legal/types.ts +18 -0
- package/dist/templates/default/packages/disposabl-kit/lib/auth-errors.ts +2 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/email-verification.tsx +4 -2
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-errors.ts +2 -0
- package/dist/templates/default/packages/disposabl-kit/package.json +7 -7
- package/dist/templates/default/packages/disposabl-kit/payments/catalog.ts +6 -0
- package/dist/templates/default/packages/disposabl-kit/payments/config.ts +5 -3
- package/dist/templates/default/packages/disposabl-kit/server/revenuecat-contract.ts +87 -8
- package/dist/templates/default/packages/disposabl-kit/server/revenuecat-functions.ts +34 -8
- package/dist/templates/default/packages/disposabl-kit/server/revenuecat-validator.ts +3 -0
- package/dist/templates/default/packages/tests/billing-setup.test.ts +14 -14
- package/dist/templates/default/packages/tests/flows/email-delivery.e2e.ts +1 -1
- package/dist/templates/default/packages/tests/flows/legal.e2e.ts +7 -5
- package/dist/templates/default/packages/tests/flows/password-backend.e2e.ts +1 -1
- package/dist/templates/default/packages/tests/helpers/auth-email-setup/probe.test.mjs +1 -1
- package/dist/templates/default/packages/tests/ios-ota.test.ts +19 -0
- package/dist/templates/default/packages/tests/revenuecat-inbox.test.ts +91 -3
- package/dist/templates/default/patches/expo-modules-core@58.1.0.patch +23 -0
- package/dist/templates/default/vendor/README.md +4 -10
- package/dist/templates/default/vendor/convex-auth-2.0.0-disposabl.2.patch +2096 -0
- package/dist/templates/default/vendor/convex-auth-2.0.0-disposabl.2.tgz +0 -0
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ const claimRef = makeFunctionReference<
|
|
|
62
62
|
store: string;
|
|
63
63
|
product: string;
|
|
64
64
|
},
|
|
65
|
-
{ customer: string; kind: "grant" | "refund" } | null
|
|
65
|
+
{ customer: string; kind: "grant" | "refund"; expiresAt?: number } | null
|
|
66
66
|
>("revenuecat:claim");
|
|
67
67
|
const completeRef = makeFunctionReference<
|
|
68
68
|
"mutation",
|
|
@@ -119,6 +119,7 @@ export const createWebhook = (
|
|
|
119
119
|
}
|
|
120
120
|
const event = parseRevenueCatEvent(payload, config);
|
|
121
121
|
if (!event) return new Response("Invalid event", { status: 400 });
|
|
122
|
+
if (event.type === "ignore") return Response.json({ status: "ignored" });
|
|
122
123
|
const result = await ctx.runMutation(receiveRef, {
|
|
123
124
|
event,
|
|
124
125
|
balanceId: await balanceId(event),
|
|
@@ -303,7 +304,8 @@ export const receive = internalMutation({
|
|
|
303
304
|
existingDelivery.balanceId !== balanceId ||
|
|
304
305
|
existingDelivery.customer !== event.customer ||
|
|
305
306
|
existingDelivery.type !== event.type ||
|
|
306
|
-
existingDelivery.product !== event.product
|
|
307
|
+
existingDelivery.product !== event.product ||
|
|
308
|
+
existingDelivery.expiresAt !== event.expiresAt
|
|
307
309
|
)
|
|
308
310
|
throw new Error("Conflicting delivery");
|
|
309
311
|
return existingDelivery.conflict ? "operator_review" : "pending";
|
|
@@ -314,7 +316,9 @@ export const receive = internalMutation({
|
|
|
314
316
|
.unique();
|
|
315
317
|
const conflict =
|
|
316
318
|
!!prior &&
|
|
317
|
-
(prior.customer !== event.customer ||
|
|
319
|
+
(prior.customer !== event.customer ||
|
|
320
|
+
prior.product !== event.product ||
|
|
321
|
+
(event.type === "purchase" && prior.expiresAt !== event.expiresAt));
|
|
318
322
|
await ctx.db.insert("revenueCatDeliveries", {
|
|
319
323
|
...event,
|
|
320
324
|
balanceId,
|
|
@@ -337,6 +341,9 @@ export const receive = internalMutation({
|
|
|
337
341
|
transaction: event.transaction,
|
|
338
342
|
product: event.product,
|
|
339
343
|
customer: event.customer,
|
|
344
|
+
...(event.expiresAt === undefined
|
|
345
|
+
? {}
|
|
346
|
+
: { expiresAt: event.expiresAt }),
|
|
340
347
|
state,
|
|
341
348
|
refundPending: false,
|
|
342
349
|
reviewPending: false,
|
|
@@ -393,6 +400,7 @@ export const claim = internalMutation({
|
|
|
393
400
|
v.object({
|
|
394
401
|
customer: v.string(),
|
|
395
402
|
kind: v.union(v.literal("grant"), v.literal("refund")),
|
|
403
|
+
expiresAt: v.optional(v.number()),
|
|
396
404
|
}),
|
|
397
405
|
),
|
|
398
406
|
handler: async (
|
|
@@ -425,6 +433,8 @@ export const claim = internalMutation({
|
|
|
425
433
|
.take(1);
|
|
426
434
|
if (holds.length) return null;
|
|
427
435
|
if (row.state === "queued") {
|
|
436
|
+
if (row.expiresAt !== undefined && row.expiresAt <= Date.now())
|
|
437
|
+
return null;
|
|
428
438
|
const customerId = ctx.db.normalizeId("users", row.customer);
|
|
429
439
|
if (!customerId || !(await ctx.db.get("users", customerId))) return null;
|
|
430
440
|
}
|
|
@@ -433,7 +443,11 @@ export const claim = internalMutation({
|
|
|
433
443
|
await ctx.db.patch("revenueCatPurchases", row._id, {
|
|
434
444
|
state: kind === "grant" ? "grant_unknown" : "refund_unknown",
|
|
435
445
|
});
|
|
436
|
-
return {
|
|
446
|
+
return {
|
|
447
|
+
customer: row.customer,
|
|
448
|
+
kind,
|
|
449
|
+
...(row.expiresAt === undefined ? {} : { expiresAt: row.expiresAt }),
|
|
450
|
+
};
|
|
437
451
|
},
|
|
438
452
|
});
|
|
439
453
|
|
|
@@ -517,9 +531,11 @@ export const complete = internalMutation({
|
|
|
517
531
|
export async function dispatchBalance(
|
|
518
532
|
config: RevenueCatConfig,
|
|
519
533
|
balanceId: string,
|
|
520
|
-
claimOperation: (
|
|
521
|
-
|
|
522
|
-
|
|
534
|
+
claimOperation: (scope: ReturnType<typeof scopedOperation>) => Promise<{
|
|
535
|
+
customer: string;
|
|
536
|
+
kind: "grant" | "refund";
|
|
537
|
+
expiresAt?: number;
|
|
538
|
+
} | null>,
|
|
523
539
|
completeOperation: (kind: "grant" | "refund") => Promise<unknown>,
|
|
524
540
|
fetcher: typeof fetch = fetch,
|
|
525
541
|
) {
|
|
@@ -527,11 +543,21 @@ export async function dispatchBalance(
|
|
|
527
543
|
scopedOperation({ config, balanceId }),
|
|
528
544
|
);
|
|
529
545
|
if (!operation) return;
|
|
546
|
+
if (
|
|
547
|
+
config.reviewerCustomers &&
|
|
548
|
+
!config.reviewerCustomers.includes(operation.customer)
|
|
549
|
+
)
|
|
550
|
+
return;
|
|
530
551
|
try {
|
|
531
552
|
const result = await billingRequest(
|
|
532
553
|
config.autumnKey,
|
|
533
554
|
operation.kind === "grant" ? "balances.create" : "balances.update",
|
|
534
|
-
balanceRequest(
|
|
555
|
+
balanceRequest(
|
|
556
|
+
operation.customer,
|
|
557
|
+
balanceId,
|
|
558
|
+
operation.kind,
|
|
559
|
+
operation.expiresAt,
|
|
560
|
+
),
|
|
535
561
|
fetcher,
|
|
536
562
|
);
|
|
537
563
|
if (result.success === true) await completeOperation(operation.kind);
|
|
@@ -10,10 +10,12 @@ export const purchaseEventFields = {
|
|
|
10
10
|
product: v.string(),
|
|
11
11
|
customer: v.string(),
|
|
12
12
|
transaction: v.string(),
|
|
13
|
+
expiresAt: v.optional(v.number()),
|
|
13
14
|
type: v.union(
|
|
14
15
|
v.literal("purchase"),
|
|
15
16
|
v.literal("cancel"),
|
|
16
17
|
v.literal("review"),
|
|
18
|
+
v.literal("ignore"),
|
|
17
19
|
),
|
|
18
20
|
};
|
|
19
21
|
export const revenueCatDeliveries = defineTable({
|
|
@@ -44,6 +46,7 @@ export const revenueCatPurchases = defineTable({
|
|
|
44
46
|
v.literal("refunded"),
|
|
45
47
|
v.literal("review"),
|
|
46
48
|
),
|
|
49
|
+
expiresAt: v.optional(v.number()),
|
|
47
50
|
refundPending: v.boolean(),
|
|
48
51
|
reviewPending: v.boolean(),
|
|
49
52
|
refundEvidence: v.optional(v.string()),
|
|
@@ -91,7 +91,7 @@ test("defaults create monthly included credits and nonexpiring prepaid top-ups o
|
|
|
91
91
|
{
|
|
92
92
|
method: "features.create",
|
|
93
93
|
body: {
|
|
94
|
-
feature_id:
|
|
94
|
+
feature_id: pricing.featureId,
|
|
95
95
|
name: "Credits",
|
|
96
96
|
type: "metered",
|
|
97
97
|
consumable: true,
|
|
@@ -100,13 +100,13 @@ test("defaults create monthly included credits and nonexpiring prepaid top-ups o
|
|
|
100
100
|
{
|
|
101
101
|
method: "plans.create",
|
|
102
102
|
body: {
|
|
103
|
-
plan_id:
|
|
103
|
+
plan_id: pricing.monthly.planId,
|
|
104
104
|
name: "Monthly credits",
|
|
105
105
|
auto_enable: false,
|
|
106
106
|
price: { amount: 5, interval: "month" },
|
|
107
107
|
items: [
|
|
108
108
|
{
|
|
109
|
-
feature_id:
|
|
109
|
+
feature_id: pricing.featureId,
|
|
110
110
|
included: 750,
|
|
111
111
|
reset: { interval: "month" },
|
|
112
112
|
},
|
|
@@ -116,13 +116,13 @@ test("defaults create monthly included credits and nonexpiring prepaid top-ups o
|
|
|
116
116
|
{
|
|
117
117
|
method: "plans.create",
|
|
118
118
|
body: {
|
|
119
|
-
plan_id:
|
|
119
|
+
plan_id: pricing.topup.planId,
|
|
120
120
|
name: "Credits top-up",
|
|
121
121
|
add_on: true,
|
|
122
122
|
auto_enable: false,
|
|
123
123
|
items: [
|
|
124
124
|
{
|
|
125
|
-
feature_id:
|
|
125
|
+
feature_id: pricing.featureId,
|
|
126
126
|
price: {
|
|
127
127
|
amount: 5,
|
|
128
128
|
billing_units: 500,
|
|
@@ -177,14 +177,14 @@ test("edited config drives new IDs, prices and quantities without assuming USD",
|
|
|
177
177
|
|
|
178
178
|
test("custom, archived and unrelated catalog entries remain byte-for-byte unchanged", async () => {
|
|
179
179
|
const p = provider();
|
|
180
|
-
p.features.set(
|
|
181
|
-
id:
|
|
180
|
+
p.features.set(pricing.featureId, {
|
|
181
|
+
id: pricing.featureId,
|
|
182
182
|
type: "credit_system",
|
|
183
183
|
archived: true,
|
|
184
184
|
creditSchema: ["custom"],
|
|
185
185
|
});
|
|
186
|
-
p.plans.set(
|
|
187
|
-
id:
|
|
186
|
+
p.plans.set(pricing.monthly.planId, {
|
|
187
|
+
id: pricing.monthly.planId,
|
|
188
188
|
price: { amount: 37 },
|
|
189
189
|
version: 8,
|
|
190
190
|
archived: true,
|
|
@@ -192,8 +192,8 @@ test("custom, archived and unrelated catalog entries remain byte-for-byte unchan
|
|
|
192
192
|
p.plans.set("enterprise", { id: "enterprise", name: "Custom deal" });
|
|
193
193
|
const before = JSON.stringify([...p.features, ...p.plans]);
|
|
194
194
|
const result = await setupBilling(true, env, pricing, p.fetcher);
|
|
195
|
-
assert.deepEqual(result.created, [
|
|
196
|
-
p.plans.delete(
|
|
195
|
+
assert.deepEqual(result.created, [`plans:${pricing.topup.planId}`]);
|
|
196
|
+
p.plans.delete(pricing.topup.planId);
|
|
197
197
|
assert.equal(JSON.stringify([...p.features, ...p.plans]), before);
|
|
198
198
|
});
|
|
199
199
|
|
|
@@ -203,7 +203,7 @@ test("partial failure stops writes and a later run resumes from provider state",
|
|
|
203
203
|
const body = JSON.parse(String(init?.body));
|
|
204
204
|
if (
|
|
205
205
|
String(url).endsWith("plans.create") &&
|
|
206
|
-
body.plan_id ===
|
|
206
|
+
body.plan_id === pricing.topup.planId
|
|
207
207
|
)
|
|
208
208
|
return new Response("private error", { status: 500 });
|
|
209
209
|
return p.fetcher(url, init);
|
|
@@ -215,7 +215,7 @@ test("partial failure stops writes and a later run resumes from provider state",
|
|
|
215
215
|
assert.equal(p.features.size, 1);
|
|
216
216
|
assert.equal(p.plans.size, 1);
|
|
217
217
|
const resumed = await setupBilling(true, env, pricing, p.fetcher);
|
|
218
|
-
assert.deepEqual(resumed.created, [
|
|
218
|
+
assert.deepEqual(resumed.created, [`plans:${pricing.topup.planId}`]);
|
|
219
219
|
assert.equal(
|
|
220
220
|
p.calls.filter((call) => call.method.endsWith(".create")).length,
|
|
221
221
|
3,
|
|
@@ -265,7 +265,7 @@ test("uncertain create is not retried in place; next run discovers committed ent
|
|
|
265
265
|
assert.equal(p.calls.length, 3);
|
|
266
266
|
assert.equal(p.plans.size, 0);
|
|
267
267
|
const resumed = await setupBilling(true, env, pricing, p.fetcher);
|
|
268
|
-
assert.deepEqual(resumed.preserved, [
|
|
268
|
+
assert.deepEqual(resumed.preserved, [`features:${pricing.featureId}`]);
|
|
269
269
|
assert.equal(resumed.created.length, 2);
|
|
270
270
|
}
|
|
271
271
|
});
|
|
@@ -72,7 +72,7 @@ test(
|
|
|
72
72
|
.map((link: string) => new URL(link).searchParams.get("code"))
|
|
73
73
|
.find(Boolean);
|
|
74
74
|
if (!code) throw new Error("Verification email has no code link");
|
|
75
|
-
const verified = await call("authEmail:
|
|
75
|
+
const verified = await call("authEmail:completeSignUpWithEmailPassword", {
|
|
76
76
|
emailCode: code,
|
|
77
77
|
browserSecret: signup.browserSecret,
|
|
78
78
|
});
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { test } from "@e2e-dev/web";
|
|
2
2
|
import { expect } from "e2e";
|
|
3
3
|
import { authenticationEnabled } from "../../disposabl-kit/features";
|
|
4
|
-
import { legalConfig } from "../../disposabl-kit/legal";
|
|
4
|
+
import { legalConfig, legalIsDraft } from "../../disposabl-kit/legal";
|
|
5
5
|
|
|
6
6
|
for (const [path, title] of [
|
|
7
7
|
["/legal/privacy", "Privacy policy"],
|
|
8
8
|
["/legal/terms", "Terms of service"],
|
|
9
9
|
] as const) {
|
|
10
10
|
test(
|
|
11
|
-
`${title} is public
|
|
11
|
+
`${title} is public with its publication status`,
|
|
12
12
|
{ platforms: ["web"] },
|
|
13
13
|
async ({ app, screen, browser }) => {
|
|
14
14
|
await app.open(path);
|
|
15
15
|
await expect(screen.getByRole("heading", title)).toBeVisible();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (legalIsDraft())
|
|
17
|
+
await expect(browser.locator('[role="note"]')).toHaveText(
|
|
18
|
+
"Draft documents. Publisher details and data practices are still being reviewed. These documents are not yet final.",
|
|
19
|
+
);
|
|
20
|
+
else await expect(browser.locator('[role="note"]')).toHaveCount(0);
|
|
19
21
|
await expect(
|
|
20
22
|
screen.getByRole("link", "All legal documents"),
|
|
21
23
|
).toBeVisible();
|
|
@@ -28,7 +28,7 @@ test(
|
|
|
28
28
|
newPassword: "Not-a-real-password-2",
|
|
29
29
|
});
|
|
30
30
|
expect(denied.value?.success).toBe(false);
|
|
31
|
-
expect(denied.value?.userError?.error).toBe("
|
|
31
|
+
expect(denied.value?.userError?.error).toBe("NOT_LOGGED_IN");
|
|
32
32
|
const emailDenied = await call("mutation", "authEmail:changePassword", {
|
|
33
33
|
currentPassword: "Not-a-real-password-1",
|
|
34
34
|
newPassword: "Not-a-real-password-2",
|
|
@@ -30,7 +30,7 @@ test("email module honors the deployment origin and optional sender", async () =
|
|
|
30
30
|
});
|
|
31
31
|
for (const name of [
|
|
32
32
|
"signUpWithEmailPassword",
|
|
33
|
-
"
|
|
33
|
+
"completeSignUpWithEmailPassword",
|
|
34
34
|
"signInWithEmailPassword",
|
|
35
35
|
"changePassword",
|
|
36
36
|
"startPasswordRecovery",
|
|
@@ -141,6 +141,25 @@ else if (!args.includes('update')) process.exit(5);
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
test("product iOS delivery requires public store configuration", async () => {
|
|
145
|
+
const config = {
|
|
146
|
+
GH_REPO: "disposabl-dev/create-disposabl-app",
|
|
147
|
+
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY: "fixture",
|
|
148
|
+
EXPO_PUBLIC_REVENUECAT_IOS_MONTHLY_PRODUCT: "monthly",
|
|
149
|
+
EXPO_PUBLIC_REVENUECAT_IOS_APP_ID: "app",
|
|
150
|
+
EXPO_PUBLIC_REVENUECAT_IOS_TOPUP_PRODUCT: "topup",
|
|
151
|
+
};
|
|
152
|
+
for (const name of Object.keys(config).filter((key) => key !== "GH_REPO")) {
|
|
153
|
+
for (const operation of ["ota-plan", "production", "deliver"]) {
|
|
154
|
+
const result = await run(operation, { ...config, [name]: " " });
|
|
155
|
+
assert.notEqual(result.status, 0);
|
|
156
|
+
assert.match(result.stderr, new RegExp(`Missing ${name}`));
|
|
157
|
+
assert.equal(result.trace, "");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
assert.equal((await run("ota-plan", config)).status, 0);
|
|
161
|
+
});
|
|
162
|
+
|
|
144
163
|
test("iOS reuses only a matching finished production binary", async () => {
|
|
145
164
|
const result = await run("ota-plan");
|
|
146
165
|
assert.equal(result.status, 0, result.stderr);
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
inspectReviewDeliveries,
|
|
28
28
|
} from "../disposabl-kit/server/revenuecat-functions";
|
|
29
29
|
|
|
30
|
-
import { creditQuantity } from "../disposabl-kit/payments/config";
|
|
30
|
+
import { creditQuantity, pricing } from "../disposabl-kit/payments/config";
|
|
31
31
|
import { paymentsEnabled } from "../disposabl-kit/features";
|
|
32
32
|
|
|
33
33
|
const config = {
|
|
@@ -919,7 +919,7 @@ describe("RevenueCat consumable inbox", () => {
|
|
|
919
919
|
assert.equal(f.jobs.length, 2);
|
|
920
920
|
assert.deepEqual(balanceRequest(event.customer, id, "grant"), {
|
|
921
921
|
customer_id: event.customer,
|
|
922
|
-
feature_id:
|
|
922
|
+
feature_id: pricing.featureId,
|
|
923
923
|
balance_id: id,
|
|
924
924
|
included_grant: creditQuantity("topup"),
|
|
925
925
|
});
|
|
@@ -984,7 +984,7 @@ describe("RevenueCat consumable inbox", () => {
|
|
|
984
984
|
});
|
|
985
985
|
assert.deepEqual(balanceRequest(event.customer, id, "refund"), {
|
|
986
986
|
customer_id: event.customer,
|
|
987
|
-
feature_id:
|
|
987
|
+
feature_id: pricing.featureId,
|
|
988
988
|
balance_id: id,
|
|
989
989
|
remaining: 0,
|
|
990
990
|
});
|
|
@@ -998,3 +998,91 @@ describe("RevenueCat consumable inbox", () => {
|
|
|
998
998
|
assert.equal(g.tables.revenueCatPurchases![0].state, "refund_unknown");
|
|
999
999
|
});
|
|
1000
1000
|
});
|
|
1001
|
+
|
|
1002
|
+
test("reviewer sandbox routing is disabled by default and bound to exact account and product", () => {
|
|
1003
|
+
const env = {
|
|
1004
|
+
REVENUECAT_CONSUMABLE_OWNER: "custom",
|
|
1005
|
+
REVENUECAT_WEBHOOK_AUTH: "Bearer fixture",
|
|
1006
|
+
REVENUECAT_PROJECT_ID: "proj",
|
|
1007
|
+
REVENUECAT_ENVIRONMENT: "PRODUCTION",
|
|
1008
|
+
AUTUMN_SECRET_KEY: "am_sk_live_fixture",
|
|
1009
|
+
REVENUECAT_ROUTES: JSON.stringify([
|
|
1010
|
+
{ app: "app", store: "APP_STORE", product: "topup" },
|
|
1011
|
+
]),
|
|
1012
|
+
REVENUECAT_MANAGED_MONTHLY_ROUTES: JSON.stringify([
|
|
1013
|
+
{ app: "app", store: "APP_STORE", product: "monthly" },
|
|
1014
|
+
]),
|
|
1015
|
+
};
|
|
1016
|
+
const reviewer = "a".repeat(32);
|
|
1017
|
+
const body = {
|
|
1018
|
+
api_version: "1.0",
|
|
1019
|
+
event: {
|
|
1020
|
+
id: "delivery",
|
|
1021
|
+
app_id: "app",
|
|
1022
|
+
app_user_id: reviewer,
|
|
1023
|
+
original_app_user_id: reviewer,
|
|
1024
|
+
environment: "SANDBOX",
|
|
1025
|
+
store: "APP_STORE",
|
|
1026
|
+
product_id: "monthly",
|
|
1027
|
+
transaction_id: "tx",
|
|
1028
|
+
type: "RENEWAL",
|
|
1029
|
+
expiration_at_ms: 1900000000000,
|
|
1030
|
+
},
|
|
1031
|
+
};
|
|
1032
|
+
assert.equal(
|
|
1033
|
+
selectRevenueCatRoute(body, revenueCatConfigs(true, env)!),
|
|
1034
|
+
null,
|
|
1035
|
+
);
|
|
1036
|
+
const configs = revenueCatConfigs(true, {
|
|
1037
|
+
...env,
|
|
1038
|
+
REVENUECAT_REVIEWER_USERS: JSON.stringify([reviewer]),
|
|
1039
|
+
})!;
|
|
1040
|
+
const route = selectRevenueCatRoute(body, configs)!;
|
|
1041
|
+
assert.equal(parseRevenueCatEvent(body, route)?.expiresAt, 1900000000000);
|
|
1042
|
+
assert.equal(
|
|
1043
|
+
selectRevenueCatRoute(
|
|
1044
|
+
{ ...body, event: { ...body.event, app_user_id: "b".repeat(32) } },
|
|
1045
|
+
configs,
|
|
1046
|
+
),
|
|
1047
|
+
null,
|
|
1048
|
+
);
|
|
1049
|
+
assert.equal(
|
|
1050
|
+
selectRevenueCatRoute(
|
|
1051
|
+
{ ...body, event: { ...body.event, store: "PLAY_STORE" } },
|
|
1052
|
+
configs,
|
|
1053
|
+
),
|
|
1054
|
+
null,
|
|
1055
|
+
);
|
|
1056
|
+
assert.equal(
|
|
1057
|
+
selectRevenueCatRoute(
|
|
1058
|
+
{ ...body, event: { ...body.event, product_id: "other" } },
|
|
1059
|
+
configs,
|
|
1060
|
+
),
|
|
1061
|
+
null,
|
|
1062
|
+
);
|
|
1063
|
+
assert.equal(
|
|
1064
|
+
parseTransfer(
|
|
1065
|
+
{
|
|
1066
|
+
api_version: "1.0",
|
|
1067
|
+
event: {
|
|
1068
|
+
id: "transfer",
|
|
1069
|
+
type: "TRANSFER",
|
|
1070
|
+
app_id: "app",
|
|
1071
|
+
environment: "SANDBOX",
|
|
1072
|
+
store: "APP_STORE",
|
|
1073
|
+
transferred_from: [reviewer],
|
|
1074
|
+
transferred_to: [reviewer],
|
|
1075
|
+
},
|
|
1076
|
+
},
|
|
1077
|
+
route,
|
|
1078
|
+
),
|
|
1079
|
+
null,
|
|
1080
|
+
);
|
|
1081
|
+
assert.equal(
|
|
1082
|
+
revenueCatConfigs(true, {
|
|
1083
|
+
...env,
|
|
1084
|
+
REVENUECAT_REVIEWER_USERS: JSON.stringify(["$RCAnonymousID:bad"]),
|
|
1085
|
+
}),
|
|
1086
|
+
null,
|
|
1087
|
+
);
|
|
1088
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
diff --git a/android/src/main/java/expo/modules/kotlin/jni/fabric/NativeStatePropsGetter.kt b/android/src/main/java/expo/modules/kotlin/jni/fabric/NativeStatePropsGetter.kt
|
|
2
|
+
index 1509bddac6ae6ee7e21857b27def28e8454fc33a..ed01ecde2f87404a42ea2899d5ab0016cd3a9df7 100644
|
|
3
|
+
--- a/android/src/main/java/expo/modules/kotlin/jni/fabric/NativeStatePropsGetter.kt
|
|
4
|
+
+++ b/android/src/main/java/expo/modules/kotlin/jni/fabric/NativeStatePropsGetter.kt
|
|
5
|
+
@@ -1,10 +1,18 @@
|
|
6
|
+
package expo.modules.kotlin.jni.fabric
|
|
7
|
+
|
|
8
|
+
import com.facebook.jni.HybridData
|
|
9
|
+
+import com.facebook.soloader.SoLoader
|
|
10
|
+
import com.facebook.yoga.annotations.DoNotStrip
|
|
11
|
+
|
|
12
|
+
@DoNotStrip
|
|
13
|
+
class NativeStatePropsGetter {
|
|
14
|
+
+ companion object {
|
|
15
|
+
+ init {
|
|
16
|
+
+ // Expo UI can be destroyed before the JavaScript runtime installs JNI bindings.
|
|
17
|
+
+ SoLoader.loadLibrary("expo-modules-core")
|
|
18
|
+
+ }
|
|
19
|
+
+ }
|
|
20
|
+
+
|
|
21
|
+
// We can't use StateWrapper directly, as this class is not exposed
|
|
22
|
+
external fun getStateProps(stateWrapper: Any): Map<String, Any?>?
|
|
23
|
+
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
# Convex Auth snapshot
|
|
2
2
|
|
|
3
|
-
The product selects `convex-auth-
|
|
3
|
+
The product selects `convex-auth-2.0.0-disposabl.2.tgz`, a locally patched build of official Convex Auth 2.0.0 source commit [`f73ec4399f1883ba383817bdc34350669ef5e6d3`](https://github.com/convex/convex-auth/commit/f73ec4399f1883ba383817bdc34350669ef5e6d3). Archive SHA-256: `42d6065e5410999290b9b599af064b128bdb4897a8784759ccbdba7aef2c01a5`. Source patch: `convex-auth-2.0.0-disposabl.2.patch`, SHA-256 `17a735461744bd35c1dfea5aa323dc2fde7ba8cf82f8e6b416b3d25e8e50a205`. It contains the Apache 2.0 license, source, compiled JavaScript and declarations. It is a local security patch, not the unmodified npm release.
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The patch retains the Google HTTPS relay, token-store serialization, session exchange and bounded auth erasure. Stable 2.0 moves Google mappings into its provider component. The transitional schema retains old core mappings and fences and rejects old sessions. The internal `authMigration:advance` coordinator copies fences and mappings in bounded atomic batches and retires attributed legacy sessions and refresh tokens; run repeatedly until complete. Migration signs existing users out. Before production migration, quiesce app-specific auth/deletion writers and verify the exact deployment, backups and rollback plan. Never call component migration advance or lock operations directly. Historical unattributed tokens and challenges remain unverified; identity digests and user fences remain retained.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
On an owned local Convex backend with outbound traffic blocked, the selected old package was upgraded to the patched stable package on the same database. A fixture seeded 205 real app IDs and Google mappings, an erased user, an identity cutoff, legacy OAuth request/ticket rows and a legacy session with 205 tokens. All 204 unfenced mappings retained their owner IDs; fenced identities and old sessions were denied; tokens were cleared; inert sign-in and refresh passed. A separate conflicting mapping remained blocked across retries. This does not prove production migration, live Google OAuth or native behavior. The source patch applied cleanly to the official core; official codegen, build, typecheck and 1,007 upstream core tests passed.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
At product revisions `5319558` and fixture-only follow-on `5d4a279`, the selected archive matched all 1,333 installed files. Offline frozen installation and backend, kit, web, mobile and test typechecks passed. Six marker cases passed from source and six from compiled runtime; 23 upstream OAuth cases passed. The earlier 99 non-OAuth source cases passed, followed by all 51 cases in the four previously omitted email suites using native Vitest 4.1.6 against final `.2` source.
|
|
12
|
-
|
|
13
|
-
Fresh isolated Convex runs passed product identity fencing and bounded erasure, independent SDK OAuth-grant revocation, API authentication, and email/password signup, verification, change and recovery. The email flow also denied login and recovery for the fenced identity while preserving the other account. Senders and provider adapters were inert; no real email or provider login was performed. The corrected ownership guard passed before product fixture mutations. Generated auth-off and auth/payments web profiles passed installation, typechecks and retained email setup tests.
|
|
14
|
-
|
|
15
|
-
These results establish local package and component behavior. They do not establish production authentication, real provider delivery, native runtime behavior or complete account deletion. The combined web/backend gate at `5319558` passed 292 unit tests and 43 E2E tests, with 55 unit and 24 E2E skips explicitly recorded. Separate `.2` fixtures also passed the local deletion coordinator and authenticated browser handoff/session exchange. Skipped opt-in fixtures are not implied coverage. The older artifacts and descriptions below are historical evidence, not supported compatibility paths or current rebuild instructions.
|
|
9
|
+
Rebuild from the exact upstream source: apply the patch with `patch -p1` in `packages/core`, install pinned workspace dependencies, run the upstream component codegen and `pnpm --filter @convex-dev/auth build`, copy the upstream root `LICENSE` to `packages/core/LICENSE`, and run `npm pack --ignore-scripts`. Compare source, compiled JavaScript and declarations, and record the resulting archive hash.
|
|
16
10
|
|
|
17
11
|
## Historical snapshots
|
|
18
12
|
|