@somewhere-cloud/cli 0.38.92 → 0.38.93
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/CHANGELOG.md +7 -0
- package/dist/commands/dev.js +5 -2
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/test.js +4 -2
- package/dist/commands/test.js.map +1 -1
- package/dist/lib/app-test.d.ts +29 -7
- package/dist/lib/app-test.js +126 -41
- package/dist/lib/app-test.js.map +1 -1
- package/dist/lib/form-accounts.d.ts +14 -2
- package/dist/lib/form-accounts.js +19 -6
- package/dist/lib/form-accounts.js.map +1 -1
- package/dist/lib/form-auth.d.ts +7 -5
- package/dist/lib/form-auth.js +70 -15
- package/dist/lib/form-auth.js.map +1 -1
- package/dist/lib/init-agent-guide.d.ts +3 -3
- package/dist/lib/init-agent-guide.js +15 -2
- package/dist/lib/init-agent-guide.js.map +1 -1
- package/dist/lib/init-feature-template.js +1 -1
- package/dist/lib/init-green-template.js +1 -1
- package/dist/lib/init-test-template.js +3 -0
- package/dist/lib/init-test-template.js.map +1 -1
- package/dist/lib/playwright-fixtures.d.ts +9 -2
- package/dist/lib/playwright-fixtures.js +150 -22
- package/dist/lib/playwright-fixtures.js.map +1 -1
- package/dist/lib/screenshot-guard.d.ts +2 -0
- package/dist/lib/screenshot-guard.js +30 -0
- package/dist/lib/screenshot-guard.js.map +1 -0
- package/dist/lib/test-control.d.ts +65 -0
- package/dist/lib/test-control.js +202 -0
- package/dist/lib/test-control.js.map +1 -0
- package/dist/lib/test-diagnostics.d.ts +10 -0
- package/dist/lib/test-diagnostics.js +27 -0
- package/dist/lib/test-diagnostics.js.map +1 -1
- package/dist/lib/test-reporter.js +34 -9
- package/dist/lib/test-reporter.js.map +1 -1
- package/dist/lib/test-run.d.ts +6 -3
- package/dist/lib/test-run.js +28 -9
- package/dist/lib/test-run.js.map +1 -1
- package/dist/lib/test-target.d.ts +5 -0
- package/dist/lib/test-target.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/runtime/DECLARED-DATA-VENDOR.json +3 -3
package/dist/lib/form-auth.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import { messagesAfter } from './test-identities.js';
|
|
2
1
|
import { rememberSecrets, scrub } from './test-diagnostics.js';
|
|
3
2
|
import { mark as timelineMark, span } from './test-timeline.js';
|
|
4
3
|
import { admitReservedAddress, generatedAddress, generatedPassword, recordAttempt, recordId } from './form-accounts.js';
|
|
4
|
+
/** Pages that may be showing a password, code or reset link: from the start of a sign-up, sign-in
|
|
5
|
+
* or verification step until it succeeds. No screenshot is taken of them (a failure inside one of
|
|
6
|
+
* these steps leaves the page marked). */
|
|
7
|
+
const secretScreens = new WeakSet();
|
|
8
|
+
export function mayShowSecret(page) { return secretScreens.has(page); }
|
|
9
|
+
async function onSecretScreen(page, work) {
|
|
10
|
+
secretScreens.add(page);
|
|
11
|
+
const result = await work();
|
|
12
|
+
secretScreens.delete(page);
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
5
15
|
export const FIND_MS = 5_000;
|
|
6
16
|
export const DEFAULT_FORM = {
|
|
7
17
|
email: '[data-sw-auth="email"]', password: '[data-sw-auth="password"]',
|
|
@@ -98,11 +108,13 @@ async function pageSays(page) {
|
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
110
|
/** Run one named step; a failure says which step, what the page showed, and the cause, scrubbed. */
|
|
101
|
-
async function step(page, name, work) {
|
|
111
|
+
async function step(page, name, work, beforeReport) {
|
|
102
112
|
try {
|
|
103
113
|
return await span(name, {}, work);
|
|
104
114
|
}
|
|
105
115
|
catch (error) {
|
|
116
|
+
// Secrets the failure may quote (a code the page already shows) are registered before any text is built.
|
|
117
|
+
await beforeReport?.().catch(() => { });
|
|
106
118
|
if (error instanceof StepError)
|
|
107
119
|
throw error;
|
|
108
120
|
const said = await pageSays(page);
|
|
@@ -139,9 +151,8 @@ async function outcome(pending, what) {
|
|
|
139
151
|
id: typeof user?.id === 'string' && user.id ? user.id : null, mfa: data?.mfa_required === true };
|
|
140
152
|
}
|
|
141
153
|
async function inbox(run, address, wait) {
|
|
142
|
-
const {
|
|
143
|
-
|
|
144
|
-
return messagesAfter(body.messages, address, 0);
|
|
154
|
+
const { control } = await run.control();
|
|
155
|
+
return run.timed('test inbox', () => control.inbox(address, wait));
|
|
145
156
|
}
|
|
146
157
|
/** What the test inbox already holds for this address, so a code is only ever one sent after this point. */
|
|
147
158
|
async function inboxMark(run, address) {
|
|
@@ -171,17 +182,31 @@ async function freshCodes(run, address, mark, what) {
|
|
|
171
182
|
throw new Error(`${what}: no code reached the project's test inbox for ${address} within 25 s. The test inbox holds at most a limited number of messages for 7 days; when it is full, new mail is not stored.`);
|
|
172
183
|
}
|
|
173
184
|
}
|
|
174
|
-
|
|
185
|
+
/** Register every code mailed to `address` for scrubbing (not consumed), once a form was submitted:
|
|
186
|
+
* a custom page can show it, and a failing step can quote it, before the helper would read it. */
|
|
187
|
+
async function registerMailedCodes(run, address, submitted) {
|
|
188
|
+
if (!submitted)
|
|
189
|
+
return;
|
|
190
|
+
for (const message of await inbox(run, address))
|
|
191
|
+
if (message.verification_code)
|
|
192
|
+
rememberSecrets(message.verification_code);
|
|
193
|
+
}
|
|
194
|
+
export function signUp(run, page, options) {
|
|
195
|
+
return onSecretScreen(page, () => signUpSteps(run, page, options));
|
|
196
|
+
}
|
|
197
|
+
async function signUpSteps(run, page, options) {
|
|
175
198
|
if (options.domain !== undefined && options.email !== undefined)
|
|
176
199
|
throw new Error('signUp: pass domain or email, not both.');
|
|
200
|
+
await run.prepare(page);
|
|
177
201
|
const email = options.email !== undefined ? admitReservedAddress(options.email) : generatedAddress(options.domain);
|
|
178
202
|
const password = generatedPassword();
|
|
179
203
|
rememberSecrets(password);
|
|
180
204
|
run.allowTime(20_000);
|
|
181
205
|
run.pages.add(page);
|
|
182
|
-
const {
|
|
206
|
+
const { control } = await run.control();
|
|
207
|
+
const target = control.target;
|
|
183
208
|
const mark = await inboxMark(run, email);
|
|
184
|
-
const attempt = { email, record: recordAttempt(run.root,
|
|
209
|
+
const attempt = { email, record: recordAttempt(control, run.root, email), id: null, submitted: false, refused: false };
|
|
185
210
|
run.attempts.push(attempt);
|
|
186
211
|
const onRequest = (request) => {
|
|
187
212
|
if (request.method() === 'POST' && new URL(request.url()).pathname.endsWith('/auth/signup'))
|
|
@@ -196,6 +221,20 @@ export async function signUp(run, page, options) {
|
|
|
196
221
|
await options.steps(page, { email, password });
|
|
197
222
|
else
|
|
198
223
|
await submitForm(page, 'sign-up', { email, password }, options.form);
|
|
224
|
+
}, async () => {
|
|
225
|
+
if (!attempt.submitted)
|
|
226
|
+
return;
|
|
227
|
+
await registerMailedCodes(run, email, true);
|
|
228
|
+
// The form step failed after submitting: learn the new account's id from the sign-up response
|
|
229
|
+
// already awaited, so cleanup can still remove it by exact id (never by address).
|
|
230
|
+
const late = await Promise.race([signedUp, new Promise((resolve) => setTimeout(() => resolve(new Error('no response yet')), 3_000))]);
|
|
231
|
+
if (late instanceof Error)
|
|
232
|
+
return;
|
|
233
|
+
const known = await outcome(Promise.resolve(late), 'sign-up').catch(() => null);
|
|
234
|
+
if (known?.ok && known.id) {
|
|
235
|
+
attempt.id = known.id;
|
|
236
|
+
recordId(attempt.record, known.id);
|
|
237
|
+
}
|
|
199
238
|
});
|
|
200
239
|
const result = await step(page, 'signUp: wait for the sign-up response', () => outcome(signedUp, 'sign-up'));
|
|
201
240
|
if (!result.ok) {
|
|
@@ -227,6 +266,9 @@ export async function signUp(run, page, options) {
|
|
|
227
266
|
throw new StepError('signUp: the sign-up succeeded but its response carried no account id, so the account cannot be cleaned up by id');
|
|
228
267
|
attempt.id = id;
|
|
229
268
|
recordId(attempt.record, id);
|
|
269
|
+
// Any code already mailed to the new address is a secret from now on, even one the test never
|
|
270
|
+
// enters (a custom page may show it): registered for scrubbing, not consumed.
|
|
271
|
+
await registerMailedCodes(run, email, true);
|
|
230
272
|
await step(page, 'signUp: wait for the signed-in page', () => signedIn(page, options.form));
|
|
231
273
|
await run.attach(page);
|
|
232
274
|
const person = { id, email, password, verified };
|
|
@@ -239,15 +281,23 @@ export async function signUp(run, page, options) {
|
|
|
239
281
|
page.off('request', onRequest);
|
|
240
282
|
}
|
|
241
283
|
}
|
|
242
|
-
export
|
|
284
|
+
export function verify(run, page, person) {
|
|
285
|
+
return onSecretScreen(page, () => verifySteps(run, page, person));
|
|
286
|
+
}
|
|
287
|
+
async function verifySteps(run, page, person) {
|
|
243
288
|
run.allowTime(20_000);
|
|
289
|
+
await run.prepare(page);
|
|
244
290
|
await run.attach(page);
|
|
245
291
|
const mark = marks.get(person) ?? await inboxMark(run, person.email);
|
|
292
|
+
// A cookie-authenticated POST from a script must carry the app's Origin, or the platform refuses it
|
|
293
|
+
// with 400 ORIGIN_REQUIRED (a browser adds it itself; page.request does not). From the docs lane's #309.
|
|
294
|
+
const { target } = (await run.control()).control;
|
|
295
|
+
const post = (path, data) => page.request.post(path, { data, headers: { Origin: target.origin } });
|
|
246
296
|
// A code the project sent at sign-up is used if it is already there (or arrives within 2 s);
|
|
247
297
|
// otherwise ask the app for one, as its own verify-email step does.
|
|
248
298
|
let codes = await step(page, 'verify: read a code sent at sign-up', () => takeCodes(run, person.email, mark, 2_000));
|
|
249
299
|
if (!codes.length) {
|
|
250
|
-
const sent = await step(page, 'verify: ask the app to email a code', () =>
|
|
300
|
+
const sent = await step(page, 'verify: ask the app to email a code', () => post('/api/auth/request-email-verification', {}));
|
|
251
301
|
if (!sent.ok())
|
|
252
302
|
throw new StepError(`verify: the app did not send a code (HTTP ${sent.status()} ${await errorCode(sent)})`);
|
|
253
303
|
codes = await step(page, 'verify: read the emailed code', () => freshCodes(run, person.email, mark, 'verify'));
|
|
@@ -257,11 +307,11 @@ export async function verify(run, page, person) {
|
|
|
257
307
|
// The platform stores the captured message just before it installs the code, so for a moment
|
|
258
308
|
// the code can read as "no pending verification" (404). Only that answer is retried, briefly;
|
|
259
309
|
// a wrong or expired code (401/400) is never retried.
|
|
260
|
-
let confirmed = await step(page, 'verify: enter the code in the app', () =>
|
|
310
|
+
let confirmed = await step(page, 'verify: enter the code in the app', () => post('/api/auth/verify-email', { code }));
|
|
261
311
|
for (let wait = 0; confirmed.status() === 404 && wait < 8; wait++) {
|
|
262
312
|
timelineMark('wait', { ms: 250, why: 'verify: code not installed yet (404)' });
|
|
263
313
|
await new Promise(resolve => setTimeout(resolve, 250));
|
|
264
|
-
confirmed = await step(page, 'verify: enter the code in the app', () =>
|
|
314
|
+
confirmed = await step(page, 'verify: enter the code in the app', () => post('/api/auth/verify-email', { code }));
|
|
265
315
|
}
|
|
266
316
|
if (confirmed.ok()) {
|
|
267
317
|
const state = await page.request.get('/api/auth/verify-email');
|
|
@@ -284,11 +334,15 @@ async function errorCode(response) {
|
|
|
284
334
|
return 'none';
|
|
285
335
|
}
|
|
286
336
|
}
|
|
287
|
-
export
|
|
337
|
+
export function signIn(run, page, person, options) {
|
|
338
|
+
return onSecretScreen(page, () => signInSteps(run, page, person, options));
|
|
339
|
+
}
|
|
340
|
+
async function signInSteps(run, page, person, options) {
|
|
288
341
|
rememberSecrets(person.password);
|
|
289
342
|
run.allowTime(20_000);
|
|
290
343
|
run.pages.add(page);
|
|
291
|
-
|
|
344
|
+
await run.prepare(page);
|
|
345
|
+
const { target } = (await run.control()).control;
|
|
292
346
|
const mark = await inboxMark(run, person.email);
|
|
293
347
|
const submit = async () => {
|
|
294
348
|
const signedIn = authResponse(page, target.origin, '/auth/login');
|
|
@@ -298,7 +352,7 @@ export async function signIn(run, page, person, options) {
|
|
|
298
352
|
await options.steps(page, { email: person.email, password: person.password });
|
|
299
353
|
else
|
|
300
354
|
await submitForm(page, 'sign-in', person, options.form);
|
|
301
|
-
});
|
|
355
|
+
}, () => registerMailedCodes(run, person.email, true));
|
|
302
356
|
return step(page, 'signIn: wait for the sign-in response', () => outcome(signedIn, 'sign-in'));
|
|
303
357
|
};
|
|
304
358
|
let result = await submit();
|
|
@@ -333,6 +387,7 @@ export async function signIn(run, page, person, options) {
|
|
|
333
387
|
}
|
|
334
388
|
export async function signOut(run, page, options) {
|
|
335
389
|
run.pages.add(page);
|
|
390
|
+
await run.prepare(page);
|
|
336
391
|
await step(page, 'signOut', async () => {
|
|
337
392
|
if (options.steps)
|
|
338
393
|
await options.steps(page);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-auth.js","sourceRoot":"","sources":["../../src/lib/form-auth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAqB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA6CxH,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAqD;IAC5E,KAAK,EAAE,wBAAwB,EAAE,QAAQ,EAAE,2BAA2B;IACtE,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,0BAA0B;IACtE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,2BAA2B;CACpE,CAAC;AACF,MAAM,IAAI,GAAG,CAAC,IAAU,EAAE,OAAgB,EAAW,EAAE,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5H,MAAM,QAAQ,GAAG,CAAC,OAAgB,EAAU,EAAE,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;AAEtG;gFACgF;AAChF,MAAM,CAAC,KAAK,U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AAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBACtE,MAAM,IAAI,SAAS,CAAC,iCAAiC,QAAQ,CAAC,OAAO,CAAC,yBAAyB,OAAO,GAAG,IAAI,qFAAqF,CAAC,CAAC;YACtM,CAAC,CAAC,CAAC;YACH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;QACD,MAAM,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const AGENT_WORKFLOW = "## Build, deploy, test\n\nEnough to start a typical app: declare access and use the browser client; docs are for exceptions.\n\n| Requirement | Declaration below |\n| --- | --- |\n| Each user sees only their own rows | notes: owner() |\n| Team: owner invites members; members read/write; creator or team owner deletes | tasks: anyOf(owner(), group()); sw.groups endpoints below |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain (or grantableBy) |\n| Public pages from private drafts | pages: conditional publicRead |\n| Share one record read-only | shared_notes/note_shares: read-only grant() |\n\ndb/schema.ts is declaration only: imports, constants/spreads, default schema;\nno helpers/expressions. id() is random text; owner() stamps user_id. client.read\nincludes the key. Inside anyOf(), owner() takes only column/read: it stamps the\ncreator, not create/delete options; group() gates placement (non-member create is\nrefused); inside anyOf an operation missing from roles allows no group role. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, group, anyOf, parent, appRole, boolean, grant } from 'somewhere/db';\nexport default schema({\n notes: table({ id: id(), title: text() }, { scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'], delete: true },\n }),\n tasks: table({ id: id(), team_id: text(), title: text() }, {\n scope: anyOf(owner(), group({ column: 'team_id', roles: { read: ['owner', 'admin', 'member'],\n create: ['owner', 'admin', 'member'], update: ['owner', 'admin', 'member'], delete: ['owner'] } })),\n client: { read: ['id', 'team_id', 'title'], create: ['team_id', 'title'], update: ['title'], delete: true },\n }),\n tickets: table({ id: id(), subject: text() }, {\n scope: anyOf(owner(), appRole({ roles: { read: ['staff'], create: ['staff'], update: ['staff'] } })),\n client: { read: true, create: ['subject'], update: ['subject'] },\n }),\n messages: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: parent({ via: 'ticket_id' }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n staff_notes: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: appRole({ roles: { read: ['staff'], create: ['staff'] } }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n pages: table({ id: id(), title: text(), published: boolean({ default: false }) }, {\n scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'],\n publicRead: { where: { published: true } } },\n }),\n note_shares: table({ id: id(), grantee_id: text(), note_id: text({ references: 'shared_notes', onDelete: 'cascade' }) }, {\n scope: owner(), unique: [['note_id', 'grantee_id']],\n }),\n shared_notes: table({ id: id(), title: text() }, {\n scope: anyOf(owner(), grant({ table: 'note_shares', grantee: 'grantee_id', row: 'note_id', operations: ['read'] })),\n client: { read: ['id', 'title'], create: ['title'], update: ['title'] },\n }),\n}, { appRoles: { staff: { emailDomain: 'staff.example' } } });\n```\n\nWho is staff is your app's decision; the platform enforces what the role may do.\nFirst choice, as above: emailDomain. The role holds once the person verifies an address\nat that domain; no grant code. An email ending alone proves nothing: anyone can sign up\nas anyone@your-domain without owning that mailbox. Without verification, grant only from\nsomething the visitor cannot choose, such as an invitation your app issued, checked inside\nthe sign-up route: single use, bound to one account, its link delivered only to that person:\nsomewhere docs sw.auth --section server-assigned-app-roles-setroles.\nmessages use parent(): owner() would hide staff replies from the customer.\nPublish pages in an owner-checked endpoint. Share with caller-scoped\nsw.db.insert('note_shares', { grantee_id, note_id }); it checks row ownership.\nBrowser calls THROW, not { error }; catch below.\nBrowser list: max 100, paginate after; no order (sort locally or in an endpoint).\n\n```ts\nimport { data } from 'somewhere:data';\nexport async function save(title: string) {\n try { await data.notes.create({ title }); return null; }\n catch (e) { return e instanceof Error ? e.message : 'Save failed'; }\n}\nexport const list = (after?: string) => data.notes.list({ limit: 100, after });\n```\n\nTeams are built-in groups: the platform keeps the team, invitations, roster, removal,\nleaving, last owner. Starting a team needs a signed-in user; joining needs a verified\nemail (a password sign-up joins once it enters its emailed code). The browser cannot call\nsw.groups: pass each call through an endpoint. A parent() child's delete follows the task\n(creator or team owner), so \"comment author or team owner deletes\" is an endpoint.\nStaff making others staff: appRoles { staff: { grantableBy: ['staff'] } } and\nsw.groups.appRoles.grant(request, userId, 'staff') in an endpoint (never to oneself).\nComplete apps and specs: somewhere docs sw.groups --section team-example or staff-example.\n\n```ts\n// api/teams.ts \u2014 GET my teams (completes invitations to me); POST starts one I own\nconst refusal = (e: { code: string; message: string; status: number }) =>\n Response.json({ error: e.code, message: e.message }, { status: e.status });\nexport const GET = sw.endpoint({ auth: 'required', handler: async ({ request }, sw) => {\n const page = await sw.groups.list(request, { limit: 100 });\n return page.error ? refusal(page.error) : { teams: page.data.items, next_cursor: page.data.next_cursor };\n} });\nexport default sw.endpoint({ auth: 'required', body: { name: 'string' }, handler: async ({ request, body }, sw) => {\n const made = await sw.groups.create(request, { name: body.name });\n return made.error ? refusal(made.error) : { id: made.data.id };\n} });\n```\n\n```ts\n// api/teams/[id]/invitations.ts \u2014 owners invite; others 403; a member's address 409 ALREADY_MEMBER\nexport default sw.endpoint({ auth: 'required', body: { email: 'string' }, handler: async ({ request, params, body }, sw) => {\n const sent = await sw.groups.invite(request, params.id, { email: body.email, role: 'member', redirect_uri: '/' });\n return sent.error ? Response.json({ error: sent.error.code }, { status: sent.error.status }) : { delivery: sent.data.delivery };\n} });\n```\n\nSame shape: sw.groups.get/members(request, id), remove(request, id, userId), leave(request, id)\n(last owner: 409 LAST_OWNER), delete(request, id) by owners.\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state.\nGrant ledgers use owner() without browser writes. Undeclarable: arbitrary predicates\n(e.g. expiry) or per-role writable fields (split tables or check that write).\n\nBuild src/pages/HomePage.tsx; routes src/App.tsx + src/routes.ts; auth src/auth/hooks.ts.\nAuth is wired: keep api/auth/[...path].ts; src/config.ts controls providers.\napi/notes/[id]/sub.ts \u2192 params.id; underscore files are helpers. POST: default export;\nGET/DELETE: named exports.\n\n```ts\nexport const GET = sw.endpoint({ auth: 'required', handler: async (_, sw) => sw.db.from('notes', { limit: 100 }) });\n```\n\nsw.db applies caller scopes; sw.db.server bypasses them: authorize first.\nCaller-scoped sw.db.insert needs no client.create grant: client limits only the browser.\nReads: from(table, { where, columns, order: [['id', 'asc']], limit, offset }).\nFilter: { id: { in: ids } }; unique: [['a', 'b']] in schema.\nWrites: insert(table, values), update(table, { where, set }), remove(table, { where }).\ntx takes an ARRAY of write intents, never a callback; pre-generate related IDs.\n\nBrowser: fetch(path, { method: 'POST', credentials: 'same-origin',\nheaders: { 'content-type': 'application/json' }, body: JSON.stringify(values) }).\nAccess cookies refresh automatically. Cookie-auth POST/PATCH/DELETE from scripts\nneed Origin equal to the app URL.\n\nTest with an ordinary Playwright script: the journeys you changed and your access boundaries.\nRun it only after a successful deploy: npx @somewhere-cloud/cli deploy && node tests/app-check.mjs\n(the starter's short example; one result file, and the exit code is the verdict). Rerun only to answer a question.\nHelpers from @somewhere-cloud/cli/script (import or require): openAppTest() then app.signUp/signIn/signOut(page)\nthrough your form, app.data(page, { table, operation, id, values, where }) as that person,\napp.expectRefused(page, request, { allowed: ownerPage }), captureResponses, dataReady, launchOptions.\nA rebuilt sign-in form keeps data-sw-auth=\"email\", \"password\", \"sign-up\", \"sign-in\" on its controls,\nor pass app.signUp(page, { form: { email, password, signUp, signIn } }) with your own selectors.\nDeploy raw source, no frontend build; type errors stop upload.\nEmail-domain role: app.signUp(page, { domain: 'staff.example' }), then app.verify(page, person).\nThe complete team spec, with removal and leaving: somewhere docs sw.groups --section team-example.\nDiagnose with somewhere errors and somewhere logs.\n\nOn demand:\n- Server paging: `somewhere docs sw.db --section server-read-paging`\n\n## Testing shared access\n\nWith the team endpoints above, the owner invites a fixture by email; test users are verified,\nso its next GET /api/teams shows the team. A test user who still owns a team is not deleted:\ndelete the team last (api/teams/[id].ts DELETE: sw.groups.delete). Group calls take\nabout a second, so raise the timeout:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect } from '@somewhere-cloud/cli/testing';\ntest.describe.configure({ timeout: 90_000 });\ntest('owner invites a second user by email', async ({ newUser }) => {\n const [owner, bob] = await Promise.all([newUser(), newUser()]);\n const { id } = await (await owner.request.post('/api/teams', { data: { name: 'Shared team' } })).json();\n expect((await owner.request.post(`/api/teams/${id}/invitations`, { data: { email: bob.email } })).ok()).toBeTruthy();\n const { teams } = await (await bob.request.get('/api/teams')).json();\n expect(teams).toContainEqual(expect.objectContaining({ id, role: 'member' }));\n expect((await owner.request.delete(`/api/teams/${id}`)).status()).toBe(204);\n});\n```\n";
|
|
1
|
+
export declare const AGENT_WORKFLOW = "## Build, deploy, test\n\nEnough to start a typical app: declare access and use the browser client; docs are for exceptions.\n\n| Requirement | Declaration below |\n| --- | --- |\n| Each user sees only their own rows | notes: owner() |\n| Team: owner invites members; members read/write; creator or team owner deletes | tasks: anyOf(owner(), group()); sw.groups endpoints below |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain (or grantableBy) |\n| Public pages from private drafts | pages: conditional publicRead |\n| Share one record read-only | shared_notes/note_shares: read-only grant() |\n\ndb/schema.ts is declaration only: imports, constants/spreads, default schema;\nno helpers/expressions. id() is random text; owner() stamps user_id. client.read\nincludes the key. Inside anyOf(), owner() takes only column/read: it stamps the\ncreator, not create/delete options; group() gates placement (non-member create is\nrefused); inside anyOf an operation missing from roles allows no group role. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, group, anyOf, parent, appRole, boolean, grant } from 'somewhere/db';\nexport default schema({\n notes: table({ id: id(), title: text() }, { scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'], delete: true },\n }),\n tasks: table({ id: id(), team_id: text(), title: text() }, {\n scope: anyOf(owner(), group({ column: 'team_id', roles: { read: ['owner', 'admin', 'member'],\n create: ['owner', 'admin', 'member'], update: ['owner', 'admin', 'member'], delete: ['owner'] } })),\n client: { read: ['id', 'team_id', 'title'], create: ['team_id', 'title'], update: ['title'], delete: true },\n }),\n tickets: table({ id: id(), subject: text() }, {\n scope: anyOf(owner(), appRole({ roles: { read: ['staff'], create: ['staff'], update: ['staff'] } })),\n client: { read: true, create: ['subject'], update: ['subject'] },\n }),\n messages: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: parent({ via: 'ticket_id' }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n staff_notes: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: appRole({ roles: { read: ['staff'], create: ['staff'] } }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n pages: table({ id: id(), title: text(), published: boolean({ default: false }) }, {\n scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'],\n publicRead: { where: { published: true } } },\n }),\n note_shares: table({ id: id(), grantee_id: text(), note_id: text({ references: 'shared_notes', onDelete: 'cascade' }) }, {\n scope: owner(), unique: [['note_id', 'grantee_id']],\n }),\n shared_notes: table({ id: id(), title: text() }, {\n scope: anyOf(owner(), grant({ table: 'note_shares', grantee: 'grantee_id', row: 'note_id', operations: ['read'] })),\n client: { read: ['id', 'title'], create: ['title'], update: ['title'] },\n }),\n}, { appRoles: { staff: { emailDomain: 'staff.example' } } });\n```\n\nWho is staff is your app's decision; the platform enforces what the role may do.\nFirst choice, as above: emailDomain. The role holds once the person verifies an address\nat that domain; no grant code. An email ending alone proves nothing: anyone can sign up\nas anyone@your-domain without owning that mailbox. Without verification, grant only from\nsomething the visitor cannot choose, such as an invitation your app issued, checked inside\nthe sign-up route: single use, bound to one account, its link delivered only to that person:\nsomewhere docs sw.auth --section server-assigned-app-roles-setroles.\nmessages use parent(): owner() would hide staff replies from the customer.\nA staff reply is a messages row, and creating a parent() child needs create on the parent\nfor that person: its owner, or a role listed under the parent's create. Read or update is\nnot enough. So tickets lists create: ['staff']; without it every staff reply is refused\n(403 POLICY_AUTHORITY_REQUIRED).\nPublish pages in an owner-checked endpoint. Share with caller-scoped\nsw.db.insert('note_shares', { grantee_id, note_id }); it checks row ownership.\nBrowser calls THROW, not { error }; catch below.\nBrowser list: max 100, paginate after; no order (sort locally or in an endpoint).\n\n```ts\nimport { data } from 'somewhere:data';\nexport async function save(title: string) {\n try { await data.notes.create({ title }); return null; }\n catch (e) { return e instanceof Error ? e.message : 'Save failed'; }\n}\nexport const list = (after?: string) => data.notes.list({ limit: 100, after });\n```\n\nTeams are built-in groups: the platform keeps the team, invitations, roster, removal,\nleaving, last owner. Starting a team needs a signed-in user; joining needs a verified\nemail (a password sign-up joins once it enters its emailed code). The browser cannot call\nsw.groups: pass each call through an endpoint. A parent() child's delete follows the task\n(creator or team owner), so \"comment author or team owner deletes\" is an endpoint.\nStaff making others staff: appRoles { staff: { grantableBy: ['staff'] } } and\nsw.groups.appRoles.grant(request, userId, 'staff') in an endpoint (never to oneself).\nComplete apps and specs: somewhere docs sw.groups --section team-example or staff-example.\n\n```ts\n// api/teams.ts \u2014 GET my teams (completes invitations to me); POST starts one I own\nconst refusal = (e: { code: string; message: string; status: number }) =>\n Response.json({ error: e.code, message: e.message }, { status: e.status });\nexport const GET = sw.endpoint({ auth: 'required', handler: async ({ request }, sw) => {\n const page = await sw.groups.list(request, { limit: 100 });\n return page.error ? refusal(page.error) : { teams: page.data.items, next_cursor: page.data.next_cursor };\n} });\nexport default sw.endpoint({ auth: 'required', body: { name: 'string' }, handler: async ({ request, body }, sw) => {\n const made = await sw.groups.create(request, { name: body.name });\n return made.error ? refusal(made.error) : { id: made.data.id };\n} });\n```\n\n```ts\n// api/teams/[id]/invitations.ts \u2014 owners invite; others 403; a member's address 409 ALREADY_MEMBER\nexport default sw.endpoint({ auth: 'required', body: { email: 'string' }, handler: async ({ request, params, body }, sw) => {\n const sent = await sw.groups.invite(request, params.id, { email: body.email, role: 'member', redirect_uri: '/' });\n return sent.error ? Response.json({ error: sent.error.code }, { status: sent.error.status }) : { delivery: sent.data.delivery };\n} });\n```\n\nSame shape: sw.groups.get/members(request, id), remove(request, id, userId), leave(request, id)\n(last owner: 409 LAST_OWNER), delete(request, id) by owners.\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state.\nGrant ledgers use owner() without browser writes. Undeclarable: arbitrary predicates\n(e.g. expiry) or per-role writable fields (split tables or check that write).\n\nBuild src/pages/HomePage.tsx; routes src/App.tsx + src/routes.ts; auth src/auth/hooks.ts.\nAuth is wired: keep api/auth/[...path].ts; src/config.ts controls providers.\napi/notes/[id]/sub.ts \u2192 params.id; underscore files are helpers. POST: default export;\nGET/DELETE: named exports.\n\n```ts\nexport const GET = sw.endpoint({ auth: 'required', handler: async (_, sw) => sw.db.from('notes', { limit: 100 }) });\n```\n\nsw.db applies caller scopes; sw.db.server bypasses them: authorize first.\nCaller-scoped sw.db.insert needs no client.create grant: client limits only the browser.\nReads: from(table, { where, columns, order: [['id', 'asc']], limit, offset }).\nFilter: { id: { in: ids } }; unique: [['a', 'b']] in schema.\nWrites: insert(table, values), update(table, { where, set }), remove(table, { where }).\ntx takes an ARRAY of write intents, never a callback; pre-generate related IDs.\n\nBrowser: fetch(path, { method: 'POST', credentials: 'same-origin',\nheaders: { 'content-type': 'application/json' }, body: JSON.stringify(values) }).\nAccess cookies refresh automatically. Cookie-auth POST/PATCH/DELETE from scripts\nneed Origin equal to the app URL.\n\nTest with an ordinary Playwright script: the journeys you changed and your access boundaries.\nRun it only after a successful deploy: npx @somewhere-cloud/cli deploy && node tests/app-check.mjs\n(the starter's short example; one result file, and the exit code is the verdict).\nKeep each run short:\n- Short waits: page.setDefaultTimeout(5_000) on every page; a deployed app answers in under\n a second. Never sleep for a fixed time: wait for the thing itself (the text, the response).\n- Stop at the first failure and print what the page showed (page.url(), the visible error\n text). Checks after a failure only wait out their timeouts. app.check() does both.\n- After a fix, rerun only the checks that failed: node tests/app-check.mjs --failed.\n Keep setup (sign-ups, rows a check needs) outside app.check() so a rerun still has it.\nCall the data endpoint as a signed-in person: app.data(page, { table, operation, id, values })\n(the raw request: somewhere docs declared-data --section calling-the-data-endpoint-directly).\nHelpers from @somewhere-cloud/cli/script (import or require): openAppTest() then app.signUp/signIn/signOut(page)\nthrough your form, app.data(page, { table, operation, id, values, where }) as that person,\napp.expectRefused(page, request, { allowed: ownerPage }), captureResponses, dataReady, launchOptions.\nA rebuilt sign-in form keeps data-sw-auth=\"email\", \"password\", \"sign-up\", \"sign-in\" on its controls,\nor pass app.signUp(page, { form: { email, password, signUp, signIn } }) with your own selectors.\nDeploy raw source, no frontend build; type errors stop upload.\nEmail-domain role: app.signUp(page, { domain: 'staff.example' }), then app.verify(page, person).\nThe complete team spec, with removal and leaving: somewhere docs sw.groups --section team-example.\nDiagnose with somewhere errors and somewhere logs.\n\nOn demand:\n- Server paging: `somewhere docs sw.db --section server-read-paging`\n\n## Testing shared access\n\nWith the team endpoints above, the owner invites a fixture by email; test users are verified,\nso its next GET /api/teams shows the team. A test user who still owns a team is not deleted:\ndelete the team last (api/teams/[id].ts DELETE: sw.groups.delete). Group calls take\nabout a second, so raise the timeout:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect } from '@somewhere-cloud/cli/testing';\ntest.describe.configure({ timeout: 90_000 });\ntest('owner invites a second user by email', async ({ newUser }) => {\n const [owner, bob] = await Promise.all([newUser(), newUser()]);\n const { id } = await (await owner.request.post('/api/teams', { data: { name: 'Shared team' } })).json();\n expect((await owner.request.post(`/api/teams/${id}/invitations`, { data: { email: bob.email } })).ok()).toBeTruthy();\n const { teams } = await (await bob.request.get('/api/teams')).json();\n expect(teams).toContainEqual(expect.objectContaining({ id, role: 'member' }));\n expect((await owner.request.delete(`/api/teams/${id}`)).status()).toBe(204);\n});\n```\n";
|
|
2
2
|
export declare const SKILLS_POINTER = "Task-specific skills: `.agents/skills/`. Inspect/update with somewhere skills status/update.";
|
|
3
3
|
export declare const DECLARED_ACCESS_POINTER = "";
|
|
4
4
|
/** One line telling agents the app's data and code can leave:
|
|
@@ -9,6 +9,6 @@ export declare const PORTABILITY_POINTER = "Data/code export limits: `somewhere
|
|
|
9
9
|
export declare const MCP_POINTER = "Use this app from Claude as its signed-in user (MCP tools): `somewhere docs sw.endpoint --section mcp-tools-for-claude`.";
|
|
10
10
|
/** One line on what a preview cannot do today, so no agent learns it by failing.
|
|
11
11
|
* Rewrite it when previews gain these (the full list: docs dev-environments). */
|
|
12
|
-
export declare const PREVIEW_POINTER = "somewhere preview runs your change on a copy of production data with its own sign-in: a preview starts with no users (sign up in it or `somewhere preview user-add`), its sign-in mail is captured (`somewhere preview mail`), and rows private to a production user stay hidden from preview users.
|
|
13
|
-
export declare const INIT_AGENTS_MD = "# somewhere.cloud project contract\n## Build, deploy, test\n\nEnough to start a typical app: declare access and use the browser client; docs are for exceptions.\n\n| Requirement | Declaration below |\n| --- | --- |\n| Each user sees only their own rows | notes: owner() |\n| Team: owner invites members; members read/write; creator or team owner deletes | tasks: anyOf(owner(), group()); sw.groups endpoints below |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain (or grantableBy) |\n| Public pages from private drafts | pages: conditional publicRead |\n| Share one record read-only | shared_notes/note_shares: read-only grant() |\n\ndb/schema.ts is declaration only: imports, constants/spreads, default schema;\nno helpers/expressions. id() is random text; owner() stamps user_id. client.read\nincludes the key. Inside anyOf(), owner() takes only column/read: it stamps the\ncreator, not create/delete options; group() gates placement (non-member create is\nrefused); inside anyOf an operation missing from roles allows no group role. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, group, anyOf, parent, appRole, boolean, grant } from 'somewhere/db';\nexport default schema({\n notes: table({ id: id(), title: text() }, { scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'], delete: true },\n }),\n tasks: table({ id: id(), team_id: text(), title: text() }, {\n scope: anyOf(owner(), group({ column: 'team_id', roles: { read: ['owner', 'admin', 'member'],\n create: ['owner', 'admin', 'member'], update: ['owner', 'admin', 'member'], delete: ['owner'] } })),\n client: { read: ['id', 'team_id', 'title'], create: ['team_id', 'title'], update: ['title'], delete: true },\n }),\n tickets: table({ id: id(), subject: text() }, {\n scope: anyOf(owner(), appRole({ roles: { read: ['staff'], create: ['staff'], update: ['staff'] } })),\n client: { read: true, create: ['subject'], update: ['subject'] },\n }),\n messages: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: parent({ via: 'ticket_id' }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n staff_notes: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: appRole({ roles: { read: ['staff'], create: ['staff'] } }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n pages: table({ id: id(), title: text(), published: boolean({ default: false }) }, {\n scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'],\n publicRead: { where: { published: true } } },\n }),\n note_shares: table({ id: id(), grantee_id: text(), note_id: text({ references: 'shared_notes', onDelete: 'cascade' }) }, {\n scope: owner(), unique: [['note_id', 'grantee_id']],\n }),\n shared_notes: table({ id: id(), title: text() }, {\n scope: anyOf(owner(), grant({ table: 'note_shares', grantee: 'grantee_id', row: 'note_id', operations: ['read'] })),\n client: { read: ['id', 'title'], create: ['title'], update: ['title'] },\n }),\n}, { appRoles: { staff: { emailDomain: 'staff.example' } } });\n```\n\nWho is staff is your app's decision; the platform enforces what the role may do.\nFirst choice, as above: emailDomain. The role holds once the person verifies an address\nat that domain; no grant code. An email ending alone proves nothing: anyone can sign up\nas anyone@your-domain without owning that mailbox. Without verification, grant only from\nsomething the visitor cannot choose, such as an invitation your app issued, checked inside\nthe sign-up route: single use, bound to one account, its link delivered only to that person:\nsomewhere docs sw.auth --section server-assigned-app-roles-setroles.\nmessages use parent(): owner() would hide staff replies from the customer.\nPublish pages in an owner-checked endpoint. Share with caller-scoped\nsw.db.insert('note_shares', { grantee_id, note_id }); it checks row ownership.\nBrowser calls THROW, not { error }; catch below.\nBrowser list: max 100, paginate after; no order (sort locally or in an endpoint).\n\n```ts\nimport { data } from 'somewhere:data';\nexport async function save(title: string) {\n try { await data.notes.create({ title }); return null; }\n catch (e) { return e instanceof Error ? e.message : 'Save failed'; }\n}\nexport const list = (after?: string) => data.notes.list({ limit: 100, after });\n```\n\nTeams are built-in groups: the platform keeps the team, invitations, roster, removal,\nleaving, last owner. Starting a team needs a signed-in user; joining needs a verified\nemail (a password sign-up joins once it enters its emailed code). The browser cannot call\nsw.groups: pass each call through an endpoint. A parent() child's delete follows the task\n(creator or team owner), so \"comment author or team owner deletes\" is an endpoint.\nStaff making others staff: appRoles { staff: { grantableBy: ['staff'] } } and\nsw.groups.appRoles.grant(request, userId, 'staff') in an endpoint (never to oneself).\nComplete apps and specs: somewhere docs sw.groups --section team-example or staff-example.\n\n```ts\n// api/teams.ts \u2014 GET my teams (completes invitations to me); POST starts one I own\nconst refusal = (e: { code: string; message: string; status: number }) =>\n Response.json({ error: e.code, message: e.message }, { status: e.status });\nexport const GET = sw.endpoint({ auth: 'required', handler: async ({ request }, sw) => {\n const page = await sw.groups.list(request, { limit: 100 });\n return page.error ? refusal(page.error) : { teams: page.data.items, next_cursor: page.data.next_cursor };\n} });\nexport default sw.endpoint({ auth: 'required', body: { name: 'string' }, handler: async ({ request, body }, sw) => {\n const made = await sw.groups.create(request, { name: body.name });\n return made.error ? refusal(made.error) : { id: made.data.id };\n} });\n```\n\n```ts\n// api/teams/[id]/invitations.ts \u2014 owners invite; others 403; a member's address 409 ALREADY_MEMBER\nexport default sw.endpoint({ auth: 'required', body: { email: 'string' }, handler: async ({ request, params, body }, sw) => {\n const sent = await sw.groups.invite(request, params.id, { email: body.email, role: 'member', redirect_uri: '/' });\n return sent.error ? Response.json({ error: sent.error.code }, { status: sent.error.status }) : { delivery: sent.data.delivery };\n} });\n```\n\nSame shape: sw.groups.get/members(request, id), remove(request, id, userId), leave(request, id)\n(last owner: 409 LAST_OWNER), delete(request, id) by owners.\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state.\nGrant ledgers use owner() without browser writes. Undeclarable: arbitrary predicates\n(e.g. expiry) or per-role writable fields (split tables or check that write).\n\nBuild src/pages/HomePage.tsx; routes src/App.tsx + src/routes.ts; auth src/auth/hooks.ts.\nAuth is wired: keep api/auth/[...path].ts; src/config.ts controls providers.\napi/notes/[id]/sub.ts \u2192 params.id; underscore files are helpers. POST: default export;\nGET/DELETE: named exports.\n\n```ts\nexport const GET = sw.endpoint({ auth: 'required', handler: async (_, sw) => sw.db.from('notes', { limit: 100 }) });\n```\n\nsw.db applies caller scopes; sw.db.server bypasses them: authorize first.\nCaller-scoped sw.db.insert needs no client.create grant: client limits only the browser.\nReads: from(table, { where, columns, order: [['id', 'asc']], limit, offset }).\nFilter: { id: { in: ids } }; unique: [['a', 'b']] in schema.\nWrites: insert(table, values), update(table, { where, set }), remove(table, { where }).\ntx takes an ARRAY of write intents, never a callback; pre-generate related IDs.\n\nBrowser: fetch(path, { method: 'POST', credentials: 'same-origin',\nheaders: { 'content-type': 'application/json' }, body: JSON.stringify(values) }).\nAccess cookies refresh automatically. Cookie-auth POST/PATCH/DELETE from scripts\nneed Origin equal to the app URL.\n\nTest with an ordinary Playwright script: the journeys you changed and your access boundaries.\nRun it only after a successful deploy: npx @somewhere-cloud/cli deploy && node tests/app-check.mjs\n(the starter's short example; one result file, and the exit code is the verdict). Rerun only to answer a question.\nHelpers from @somewhere-cloud/cli/script (import or require): openAppTest() then app.signUp/signIn/signOut(page)\nthrough your form, app.data(page, { table, operation, id, values, where }) as that person,\napp.expectRefused(page, request, { allowed: ownerPage }), captureResponses, dataReady, launchOptions.\nA rebuilt sign-in form keeps data-sw-auth=\"email\", \"password\", \"sign-up\", \"sign-in\" on its controls,\nor pass app.signUp(page, { form: { email, password, signUp, signIn } }) with your own selectors.\nDeploy raw source, no frontend build; type errors stop upload.\nEmail-domain role: app.signUp(page, { domain: 'staff.example' }), then app.verify(page, person).\nThe complete team spec, with removal and leaving: somewhere docs sw.groups --section team-example.\nDiagnose with somewhere errors and somewhere logs.\n\nOn demand:\n- Server paging: `somewhere docs sw.db --section server-read-paging`\n\n## Testing shared access\n\nWith the team endpoints above, the owner invites a fixture by email; test users are verified,\nso its next GET /api/teams shows the team. A test user who still owns a team is not deleted:\ndelete the team last (api/teams/[id].ts DELETE: sw.groups.delete). Group calls take\nabout a second, so raise the timeout:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect } from '@somewhere-cloud/cli/testing';\ntest.describe.configure({ timeout: 90_000 });\ntest('owner invites a second user by email', async ({ newUser }) => {\n const [owner, bob] = await Promise.all([newUser(), newUser()]);\n const { id } = await (await owner.request.post('/api/teams', { data: { name: 'Shared team' } })).json();\n expect((await owner.request.post(`/api/teams/${id}/invitations`, { data: { email: bob.email } })).ok()).toBeTruthy();\n const { teams } = await (await bob.request.get('/api/teams')).json();\n expect(teams).toContainEqual(expect.objectContaining({ id, role: 'member' }));\n expect((await owner.request.delete(`/api/teams/${id}`)).status()).toBe(204);\n});\n```\n\nTask-specific skills: `.agents/skills/`. Inspect/update with somewhere skills status/update.\nData/code export limits: `somewhere docs portability`.\nUse this app from Claude as its signed-in user (MCP tools): `somewhere docs sw.endpoint --section mcp-tools-for-claude`.\nsomewhere preview runs your change on a copy of production data with its own sign-in: a preview starts with no users (sign up in it or `somewhere preview user-add`), its sign-in mail is captured (`somewhere preview mail`), and rows private to a production user stay hidden from preview users. Teams and roles, server user lookup, jobs/cron handlers and somewhere test do not work in a preview yet: check those in production after promoting (`somewhere docs dev-environments`).\n";
|
|
12
|
+
export declare const PREVIEW_POINTER = "somewhere preview runs your change on a copy of production data with its own sign-in: a preview starts with no users (sign up in it or `somewhere preview user-add`), its sign-in mail is captured (`somewhere preview mail`), and rows private to a production user stay hidden from preview users. Server user lookup, roles and built-in teams work in a preview (its own users, its own copy; team invitations are captured); jobs/cron handlers do not yet: check those in production after promoting (`somewhere docs dev-environments`). Test your change in the preview before you promote it: `somewhere test --preview`.";
|
|
13
|
+
export declare const INIT_AGENTS_MD = "# somewhere.cloud project contract\n## Build, deploy, test\n\nEnough to start a typical app: declare access and use the browser client; docs are for exceptions.\n\n| Requirement | Declaration below |\n| --- | --- |\n| Each user sees only their own rows | notes: owner() |\n| Team: owner invites members; members read/write; creator or team owner deletes | tasks: anyOf(owner(), group()); sw.groups endpoints below |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain (or grantableBy) |\n| Public pages from private drafts | pages: conditional publicRead |\n| Share one record read-only | shared_notes/note_shares: read-only grant() |\n\ndb/schema.ts is declaration only: imports, constants/spreads, default schema;\nno helpers/expressions. id() is random text; owner() stamps user_id. client.read\nincludes the key. Inside anyOf(), owner() takes only column/read: it stamps the\ncreator, not create/delete options; group() gates placement (non-member create is\nrefused); inside anyOf an operation missing from roles allows no group role. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, group, anyOf, parent, appRole, boolean, grant } from 'somewhere/db';\nexport default schema({\n notes: table({ id: id(), title: text() }, { scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'], delete: true },\n }),\n tasks: table({ id: id(), team_id: text(), title: text() }, {\n scope: anyOf(owner(), group({ column: 'team_id', roles: { read: ['owner', 'admin', 'member'],\n create: ['owner', 'admin', 'member'], update: ['owner', 'admin', 'member'], delete: ['owner'] } })),\n client: { read: ['id', 'team_id', 'title'], create: ['team_id', 'title'], update: ['title'], delete: true },\n }),\n tickets: table({ id: id(), subject: text() }, {\n scope: anyOf(owner(), appRole({ roles: { read: ['staff'], create: ['staff'], update: ['staff'] } })),\n client: { read: true, create: ['subject'], update: ['subject'] },\n }),\n messages: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: parent({ via: 'ticket_id' }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n staff_notes: table({ id: id(), ticket_id: text({ references: 'tickets' }), body: text() }, {\n scope: appRole({ roles: { read: ['staff'], create: ['staff'] } }),\n client: { read: true, create: ['ticket_id', 'body'] },\n }),\n pages: table({ id: id(), title: text(), published: boolean({ default: false }) }, {\n scope: owner(), client: { read: ['id', 'title'], create: ['title'], update: ['title'],\n publicRead: { where: { published: true } } },\n }),\n note_shares: table({ id: id(), grantee_id: text(), note_id: text({ references: 'shared_notes', onDelete: 'cascade' }) }, {\n scope: owner(), unique: [['note_id', 'grantee_id']],\n }),\n shared_notes: table({ id: id(), title: text() }, {\n scope: anyOf(owner(), grant({ table: 'note_shares', grantee: 'grantee_id', row: 'note_id', operations: ['read'] })),\n client: { read: ['id', 'title'], create: ['title'], update: ['title'] },\n }),\n}, { appRoles: { staff: { emailDomain: 'staff.example' } } });\n```\n\nWho is staff is your app's decision; the platform enforces what the role may do.\nFirst choice, as above: emailDomain. The role holds once the person verifies an address\nat that domain; no grant code. An email ending alone proves nothing: anyone can sign up\nas anyone@your-domain without owning that mailbox. Without verification, grant only from\nsomething the visitor cannot choose, such as an invitation your app issued, checked inside\nthe sign-up route: single use, bound to one account, its link delivered only to that person:\nsomewhere docs sw.auth --section server-assigned-app-roles-setroles.\nmessages use parent(): owner() would hide staff replies from the customer.\nA staff reply is a messages row, and creating a parent() child needs create on the parent\nfor that person: its owner, or a role listed under the parent's create. Read or update is\nnot enough. So tickets lists create: ['staff']; without it every staff reply is refused\n(403 POLICY_AUTHORITY_REQUIRED).\nPublish pages in an owner-checked endpoint. Share with caller-scoped\nsw.db.insert('note_shares', { grantee_id, note_id }); it checks row ownership.\nBrowser calls THROW, not { error }; catch below.\nBrowser list: max 100, paginate after; no order (sort locally or in an endpoint).\n\n```ts\nimport { data } from 'somewhere:data';\nexport async function save(title: string) {\n try { await data.notes.create({ title }); return null; }\n catch (e) { return e instanceof Error ? e.message : 'Save failed'; }\n}\nexport const list = (after?: string) => data.notes.list({ limit: 100, after });\n```\n\nTeams are built-in groups: the platform keeps the team, invitations, roster, removal,\nleaving, last owner. Starting a team needs a signed-in user; joining needs a verified\nemail (a password sign-up joins once it enters its emailed code). The browser cannot call\nsw.groups: pass each call through an endpoint. A parent() child's delete follows the task\n(creator or team owner), so \"comment author or team owner deletes\" is an endpoint.\nStaff making others staff: appRoles { staff: { grantableBy: ['staff'] } } and\nsw.groups.appRoles.grant(request, userId, 'staff') in an endpoint (never to oneself).\nComplete apps and specs: somewhere docs sw.groups --section team-example or staff-example.\n\n```ts\n// api/teams.ts \u2014 GET my teams (completes invitations to me); POST starts one I own\nconst refusal = (e: { code: string; message: string; status: number }) =>\n Response.json({ error: e.code, message: e.message }, { status: e.status });\nexport const GET = sw.endpoint({ auth: 'required', handler: async ({ request }, sw) => {\n const page = await sw.groups.list(request, { limit: 100 });\n return page.error ? refusal(page.error) : { teams: page.data.items, next_cursor: page.data.next_cursor };\n} });\nexport default sw.endpoint({ auth: 'required', body: { name: 'string' }, handler: async ({ request, body }, sw) => {\n const made = await sw.groups.create(request, { name: body.name });\n return made.error ? refusal(made.error) : { id: made.data.id };\n} });\n```\n\n```ts\n// api/teams/[id]/invitations.ts \u2014 owners invite; others 403; a member's address 409 ALREADY_MEMBER\nexport default sw.endpoint({ auth: 'required', body: { email: 'string' }, handler: async ({ request, params, body }, sw) => {\n const sent = await sw.groups.invite(request, params.id, { email: body.email, role: 'member', redirect_uri: '/' });\n return sent.error ? Response.json({ error: sent.error.code }, { status: sent.error.status }) : { delivery: sent.data.delivery };\n} });\n```\n\nSame shape: sw.groups.get/members(request, id), remove(request, id, userId), leave(request, id)\n(last owner: 409 LAST_OWNER), delete(request, id) by owners.\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state.\nGrant ledgers use owner() without browser writes. Undeclarable: arbitrary predicates\n(e.g. expiry) or per-role writable fields (split tables or check that write).\n\nBuild src/pages/HomePage.tsx; routes src/App.tsx + src/routes.ts; auth src/auth/hooks.ts.\nAuth is wired: keep api/auth/[...path].ts; src/config.ts controls providers.\napi/notes/[id]/sub.ts \u2192 params.id; underscore files are helpers. POST: default export;\nGET/DELETE: named exports.\n\n```ts\nexport const GET = sw.endpoint({ auth: 'required', handler: async (_, sw) => sw.db.from('notes', { limit: 100 }) });\n```\n\nsw.db applies caller scopes; sw.db.server bypasses them: authorize first.\nCaller-scoped sw.db.insert needs no client.create grant: client limits only the browser.\nReads: from(table, { where, columns, order: [['id', 'asc']], limit, offset }).\nFilter: { id: { in: ids } }; unique: [['a', 'b']] in schema.\nWrites: insert(table, values), update(table, { where, set }), remove(table, { where }).\ntx takes an ARRAY of write intents, never a callback; pre-generate related IDs.\n\nBrowser: fetch(path, { method: 'POST', credentials: 'same-origin',\nheaders: { 'content-type': 'application/json' }, body: JSON.stringify(values) }).\nAccess cookies refresh automatically. Cookie-auth POST/PATCH/DELETE from scripts\nneed Origin equal to the app URL.\n\nTest with an ordinary Playwright script: the journeys you changed and your access boundaries.\nRun it only after a successful deploy: npx @somewhere-cloud/cli deploy && node tests/app-check.mjs\n(the starter's short example; one result file, and the exit code is the verdict).\nKeep each run short:\n- Short waits: page.setDefaultTimeout(5_000) on every page; a deployed app answers in under\n a second. Never sleep for a fixed time: wait for the thing itself (the text, the response).\n- Stop at the first failure and print what the page showed (page.url(), the visible error\n text). Checks after a failure only wait out their timeouts. app.check() does both.\n- After a fix, rerun only the checks that failed: node tests/app-check.mjs --failed.\n Keep setup (sign-ups, rows a check needs) outside app.check() so a rerun still has it.\nCall the data endpoint as a signed-in person: app.data(page, { table, operation, id, values })\n(the raw request: somewhere docs declared-data --section calling-the-data-endpoint-directly).\nHelpers from @somewhere-cloud/cli/script (import or require): openAppTest() then app.signUp/signIn/signOut(page)\nthrough your form, app.data(page, { table, operation, id, values, where }) as that person,\napp.expectRefused(page, request, { allowed: ownerPage }), captureResponses, dataReady, launchOptions.\nA rebuilt sign-in form keeps data-sw-auth=\"email\", \"password\", \"sign-up\", \"sign-in\" on its controls,\nor pass app.signUp(page, { form: { email, password, signUp, signIn } }) with your own selectors.\nDeploy raw source, no frontend build; type errors stop upload.\nEmail-domain role: app.signUp(page, { domain: 'staff.example' }), then app.verify(page, person).\nThe complete team spec, with removal and leaving: somewhere docs sw.groups --section team-example.\nDiagnose with somewhere errors and somewhere logs.\n\nOn demand:\n- Server paging: `somewhere docs sw.db --section server-read-paging`\n\n## Testing shared access\n\nWith the team endpoints above, the owner invites a fixture by email; test users are verified,\nso its next GET /api/teams shows the team. A test user who still owns a team is not deleted:\ndelete the team last (api/teams/[id].ts DELETE: sw.groups.delete). Group calls take\nabout a second, so raise the timeout:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect } from '@somewhere-cloud/cli/testing';\ntest.describe.configure({ timeout: 90_000 });\ntest('owner invites a second user by email', async ({ newUser }) => {\n const [owner, bob] = await Promise.all([newUser(), newUser()]);\n const { id } = await (await owner.request.post('/api/teams', { data: { name: 'Shared team' } })).json();\n expect((await owner.request.post(`/api/teams/${id}/invitations`, { data: { email: bob.email } })).ok()).toBeTruthy();\n const { teams } = await (await bob.request.get('/api/teams')).json();\n expect(teams).toContainEqual(expect.objectContaining({ id, role: 'member' }));\n expect((await owner.request.delete(`/api/teams/${id}`)).status()).toBe(204);\n});\n```\n\nTask-specific skills: `.agents/skills/`. Inspect/update with somewhere skills status/update.\nData/code export limits: `somewhere docs portability`.\nUse this app from Claude as its signed-in user (MCP tools): `somewhere docs sw.endpoint --section mcp-tools-for-claude`.\nsomewhere preview runs your change on a copy of production data with its own sign-in: a preview starts with no users (sign up in it or `somewhere preview user-add`), its sign-in mail is captured (`somewhere preview mail`), and rows private to a production user stay hidden from preview users. Server user lookup, roles and built-in teams work in a preview (its own users, its own copy; team invitations are captured); jobs/cron handlers do not yet: check those in production after promoting (`somewhere docs dev-environments`). Test your change in the preview before you promote it: `somewhere test --preview`.\n";
|
|
14
14
|
export declare const INIT_CLAUDE_MD = "Read AGENTS.md for project instructions.\n";
|
|
@@ -64,6 +64,10 @@ something the visitor cannot choose, such as an invitation your app issued, chec
|
|
|
64
64
|
the sign-up route: single use, bound to one account, its link delivered only to that person:
|
|
65
65
|
somewhere docs sw.auth --section server-assigned-app-roles-setroles.
|
|
66
66
|
messages use parent(): owner() would hide staff replies from the customer.
|
|
67
|
+
A staff reply is a messages row, and creating a parent() child needs create on the parent
|
|
68
|
+
for that person: its owner, or a role listed under the parent's create. Read or update is
|
|
69
|
+
not enough. So tickets lists create: ['staff']; without it every staff reply is refused
|
|
70
|
+
(403 POLICY_AUTHORITY_REQUIRED).
|
|
67
71
|
Publish pages in an owner-checked endpoint. Share with caller-scoped
|
|
68
72
|
sw.db.insert('note_shares', { grantee_id, note_id }); it checks row ownership.
|
|
69
73
|
Browser calls THROW, not { error }; catch below.
|
|
@@ -140,7 +144,16 @@ need Origin equal to the app URL.
|
|
|
140
144
|
|
|
141
145
|
Test with an ordinary Playwright script: the journeys you changed and your access boundaries.
|
|
142
146
|
Run it only after a successful deploy: npx @somewhere-cloud/cli deploy && node tests/app-check.mjs
|
|
143
|
-
(the starter's short example; one result file, and the exit code is the verdict).
|
|
147
|
+
(the starter's short example; one result file, and the exit code is the verdict).
|
|
148
|
+
Keep each run short:
|
|
149
|
+
- Short waits: page.setDefaultTimeout(5_000) on every page; a deployed app answers in under
|
|
150
|
+
a second. Never sleep for a fixed time: wait for the thing itself (the text, the response).
|
|
151
|
+
- Stop at the first failure and print what the page showed (page.url(), the visible error
|
|
152
|
+
text). Checks after a failure only wait out their timeouts. app.check() does both.
|
|
153
|
+
- After a fix, rerun only the checks that failed: node tests/app-check.mjs --failed.
|
|
154
|
+
Keep setup (sign-ups, rows a check needs) outside app.check() so a rerun still has it.
|
|
155
|
+
Call the data endpoint as a signed-in person: app.data(page, { table, operation, id, values })
|
|
156
|
+
(the raw request: somewhere docs declared-data --section calling-the-data-endpoint-directly).
|
|
144
157
|
Helpers from @somewhere-cloud/cli/script (import or require): openAppTest() then app.signUp/signIn/signOut(page)
|
|
145
158
|
through your form, app.data(page, { table, operation, id, values, where }) as that person,
|
|
146
159
|
app.expectRefused(page, request, { allowed: ownerPage }), captureResponses, dataReady, launchOptions.
|
|
@@ -185,7 +198,7 @@ export const PORTABILITY_POINTER = 'Data/code export limits: `somewhere docs por
|
|
|
185
198
|
export const MCP_POINTER = 'Use this app from Claude as its signed-in user (MCP tools): `somewhere docs sw.endpoint --section mcp-tools-for-claude`.';
|
|
186
199
|
/** One line on what a preview cannot do today, so no agent learns it by failing.
|
|
187
200
|
* Rewrite it when previews gain these (the full list: docs dev-environments). */
|
|
188
|
-
export const PREVIEW_POINTER = 'somewhere preview runs your change on a copy of production data with its own sign-in: a preview starts with no users (sign up in it or `somewhere preview user-add`), its sign-in mail is captured (`somewhere preview mail`), and rows private to a production user stay hidden from preview users.
|
|
201
|
+
export const PREVIEW_POINTER = 'somewhere preview runs your change on a copy of production data with its own sign-in: a preview starts with no users (sign up in it or `somewhere preview user-add`), its sign-in mail is captured (`somewhere preview mail`), and rows private to a production user stay hidden from preview users. Server user lookup, roles and built-in teams work in a preview (its own users, its own copy; team invitations are captured); jobs/cron handlers do not yet: check those in production after promoting (`somewhere docs dev-environments`). Test your change in the preview before you promote it: `somewhere test --preview`.';
|
|
189
202
|
export const INIT_AGENTS_MD = `# somewhere.cloud project contract\n${AGENT_WORKFLOW}\n${SKILLS_POINTER}\n${PORTABILITY_POINTER}\n${MCP_POINTER}\n${PREVIEW_POINTER}\n`;
|
|
190
203
|
export const INIT_CLAUDE_MD = 'Read AGENTS.md for project instructions.\n';
|
|
191
204
|
//# sourceMappingURL=init-agent-guide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-agent-guide.js","sourceRoot":"","sources":["../../src/lib/init-agent-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,2EAA2E;AAC3E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"init-agent-guide.js","sourceRoot":"","sources":["../../src/lib/init-agent-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,2EAA2E;AAC3E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0L7B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,2BAA2B,UAAU,0DAA0D,CAAC;AAE9H,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;+EAE+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,wDAAwD,CAAC;AAE5F,6EAA6E;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG,0HAA0H,CAAC;AAEtJ;kFACkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG,omBAAomB,CAAC;AAEpoB,MAAM,CAAC,MAAM,cAAc,GAAG,uCAAuC,cAAc,KAAK,cAAc,KAAK,mBAAmB,KAAK,WAAW,KAAK,eAAe,IAAI,CAAC;AACvK,MAAM,CAAC,MAAM,cAAc,GAAG,4CAA4C,CAAC"}
|
|
@@ -5,6 +5,8 @@ const SCRIPT = (privateData) => `// tests/app-check.mjs — an ordinary Playwrig
|
|
|
5
5
|
// what you built. Run it after a successful deploy, never after a refused one:
|
|
6
6
|
// npx somewhere deploy && node tests/app-check.mjs
|
|
7
7
|
// It writes its result once to .somewhere/app-check.json; the exit code is the verdict.
|
|
8
|
+
// It stops at the first failed check and prints the page's URL and visible error text.
|
|
9
|
+
// After a fix, rerun only what failed: node tests/app-check.mjs --failed (keep setup outside app.check).
|
|
8
10
|
// From a .cjs script: const { openAppTest } = require('@somewhere-cloud/cli/script');
|
|
9
11
|
import { chromium } from '@playwright/test';
|
|
10
12
|
import { openAppTest${privateData ? ', captureResponses, dataReady' : ''} } from '@somewhere-cloud/cli/script';
|
|
@@ -15,6 +17,7 @@ const browser = await chromium.launch(app.launchOptions());
|
|
|
15
17
|
// deleted by exact id in finish()).
|
|
16
18
|
const person = async () => {
|
|
17
19
|
const page = await browser.newPage({ baseURL: app.origin });
|
|
20
|
+
page.setDefaultTimeout(5_000); // a deployed app answers in well under a second; never sleep, wait for the thing itself
|
|
18
21
|
return { page, account: await app.signUp(page) };
|
|
19
22
|
};
|
|
20
23
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-test-template.js","sourceRoot":"","sources":["../../src/lib/init-test-template.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,qGAAqG;AACrG,wEAAwE;AAExE,MAAM,MAAM,GAAG,CAAC,WAAoB,EAAE,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"init-test-template.js","sourceRoot":"","sources":["../../src/lib/init-test-template.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,qGAAqG;AACrG,wEAAwE;AAExE,MAAM,MAAM,GAAG,CAAC,WAAoB,EAAE,EAAE,CAAC;;;;;;;;sBAQnB,WAAW,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;EAkBtE,WAAW,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;CAef,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;CAcL,CAAC;AAEF,kGAAkG;AAClG,MAAM,UAAU,YAAY,CAAC,UAAqC,EAAE;IAClE,OAAO,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { APIRequestContext, APIResponse, Page, TestType, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions } from '@playwright/test';
|
|
2
2
|
import { ready, type FormHost, type FormControl, type Attempt, type Person, type FormSteps, type CodeSteps, type SignUpOptions, type SignInOptions, type FormAdapter } from './form-auth.js';
|
|
3
|
+
import { type TestControl } from './test-control.js';
|
|
3
4
|
export type { Person, FormSteps, CodeSteps, SignUpOptions, SignInOptions, FormAdapter };
|
|
4
5
|
import type { TestInfo } from '@playwright/test';
|
|
5
6
|
import type { DataRequest } from '../testing.js';
|
|
@@ -14,6 +15,9 @@ export interface TestUser {
|
|
|
14
15
|
export interface NewUserOptions {
|
|
15
16
|
role?: string;
|
|
16
17
|
}
|
|
18
|
+
interface WorkerFixtures {
|
|
19
|
+
_preview: TestControl | null;
|
|
20
|
+
}
|
|
17
21
|
interface Fixtures {
|
|
18
22
|
_evidence: void;
|
|
19
23
|
anonymous: APIRequestContext;
|
|
@@ -31,7 +35,7 @@ interface Fixtures {
|
|
|
31
35
|
form?: FormAdapter;
|
|
32
36
|
}) => Promise<void>;
|
|
33
37
|
}
|
|
34
|
-
type RunnerTest = TestType<PlaywrightTestArgs & PlaywrightTestOptions & Fixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions>;
|
|
38
|
+
type RunnerTest = TestType<PlaywrightTestArgs & PlaywrightTestOptions & Fixtures, PlaywrightWorkerArgs & PlaywrightWorkerOptions & WorkerFixtures>;
|
|
35
39
|
export declare const test: RunnerTest;
|
|
36
40
|
export declare const expect: typeof import('@playwright/test').expect;
|
|
37
41
|
type Person_ = Page | {
|
|
@@ -62,13 +66,16 @@ export declare function data(client: APIRequestContext, table: string, request:
|
|
|
62
66
|
export { ready };
|
|
63
67
|
declare class FormRun implements FormHost {
|
|
64
68
|
readonly info: TestInfo;
|
|
69
|
+
private readonly preview;
|
|
65
70
|
readonly pages: Set<Page>;
|
|
66
71
|
readonly attempts: Attempt[];
|
|
67
72
|
private loading?;
|
|
73
|
+
private readonly prepared;
|
|
68
74
|
readonly root: string;
|
|
69
|
-
constructor(info: TestInfo);
|
|
75
|
+
constructor(info: TestInfo, preview: TestControl | null);
|
|
70
76
|
timed<T>(name: string, work: () => Promise<T>): Promise<T>;
|
|
71
77
|
control(): Promise<FormControl>;
|
|
78
|
+
prepare(page: Page): Promise<void>;
|
|
72
79
|
/** The page's own request client, with the app Origin and the data contract, for data()/expectRefused(). */
|
|
73
80
|
attach(page: Page): Promise<void>;
|
|
74
81
|
/** Email codes travel by real mail paths; give each auth step room inside the test's timeout. */
|