Slug-based scenarios, quests and offers per the environments contract; regenerated models; e2e seed passes environment to admin mirrors
Claude-Session: https://claude.ai/code/session_01SMCvdwDmuxoaqGgvGBLk1V
This commit is contained in:
@@ -33,8 +33,8 @@ export interface FakeGatewayState {
|
||||
export interface FakeGateway {
|
||||
state: FakeGatewayState;
|
||||
recorded: RecordedRequest[];
|
||||
purchases: Array<{ storeSlug: string; offerId: string; idempotencyKey: string; authToken: string | null }>;
|
||||
questClaims: Array<{ questId: string; authToken: string | null }>;
|
||||
purchases: Array<{ storeSlug: string; offerSlug: string; idempotencyKey: string; authToken: string | null }>;
|
||||
questClaims: Array<{ questSlug: string; authToken: string | null }>;
|
||||
install(): void;
|
||||
onEvent(event: string, ...effects: PendingEffect[]): void;
|
||||
onCallback(nodeId: string, handle: string, next: PendingEffect | null): void;
|
||||
@@ -175,7 +175,7 @@ export function createFakeGateway(seed?: Partial<FakeGatewayState>): FakeGateway
|
||||
const b = body as { idempotencyKey?: string };
|
||||
purchases.push({
|
||||
storeSlug: decodeURIComponent(purchaseMatch[1]),
|
||||
offerId: decodeURIComponent(purchaseMatch[2]),
|
||||
offerSlug: decodeURIComponent(purchaseMatch[2]),
|
||||
idempotencyKey: b.idempotencyKey ?? '',
|
||||
authToken: req.authToken,
|
||||
});
|
||||
@@ -192,10 +192,10 @@ export function createFakeGateway(seed?: Partial<FakeGatewayState>): FakeGateway
|
||||
return json(state.quests);
|
||||
}
|
||||
if (method === 'POST' && path === '/sdk/v1/quests/claim') {
|
||||
const b = body as { questId?: string };
|
||||
const questId = b.questId ?? '';
|
||||
questClaims.push({ questId, authToken: req.authToken });
|
||||
return json(state.questClaims.get(questId) ?? { success: false, error: 'not found' });
|
||||
const b = body as { questSlug?: string };
|
||||
const questSlug = b.questSlug ?? '';
|
||||
questClaims.push({ questSlug, authToken: req.authToken });
|
||||
return json(state.questClaims.get(questSlug) ?? { success: false, error: 'not found' });
|
||||
}
|
||||
|
||||
if (path === '/sdk/v1/storage') {
|
||||
|
||||
Reference in New Issue
Block a user