@somewhere-cloud/cli 0.38.84 → 0.38.86
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 +176 -7
- package/dist/commands/deploy.js +25 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/test.js +13 -99
- package/dist/commands/test.js.map +1 -1
- package/dist/lib/deploy-tests.d.ts +27 -0
- package/dist/lib/deploy-tests.js +49 -0
- package/dist/lib/deploy-tests.js.map +1 -0
- package/dist/lib/form-accounts.d.ts +2 -2
- package/dist/lib/form-accounts.js +8 -5
- package/dist/lib/form-accounts.js.map +1 -1
- package/dist/lib/init-agent-guide.d.ts +2 -2
- package/dist/lib/init-agent-guide.js +6 -1
- package/dist/lib/init-agent-guide.js.map +1 -1
- package/dist/lib/init-feature-template.js +5 -5
- package/dist/lib/init-feature-template.js.map +1 -1
- package/dist/lib/init-green-template.js +3 -0
- package/dist/lib/init-green-template.js.map +1 -1
- package/dist/lib/init-test-template.d.ts +4 -1
- package/dist/lib/init-test-template.js +131 -42
- package/dist/lib/init-test-template.js.map +1 -1
- package/dist/lib/init-ui-kit.d.ts +1 -1
- package/dist/lib/init-ui-kit.js +21 -3
- package/dist/lib/init-ui-kit.js.map +1 -1
- package/dist/lib/playwright-fixtures.d.ts +8 -1
- package/dist/lib/playwright-fixtures.js +46 -29
- package/dist/lib/playwright-fixtures.js.map +1 -1
- package/dist/lib/test-diagnostics.js +2 -1
- package/dist/lib/test-diagnostics.js.map +1 -1
- package/dist/lib/test-ledger.d.ts +73 -0
- package/dist/lib/test-ledger.js +261 -0
- package/dist/lib/test-ledger.js.map +1 -0
- package/dist/lib/test-reporter.d.ts +2 -0
- package/dist/lib/test-reporter.js +74 -6
- package/dist/lib/test-reporter.js.map +1 -1
- package/dist/lib/test-run.d.ts +35 -0
- package/dist/lib/test-run.js +136 -0
- package/dist/lib/test-run.js.map +1 -0
- package/dist/lib/test-target.d.ts +4 -1
- package/dist/lib/test-target.js +12 -3
- package/dist/lib/test-target.js.map +1 -1
- package/dist/lib/test-timeline.d.ts +10 -0
- package/dist/lib/test-timeline.js +50 -0
- package/dist/lib/test-timeline.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/testing.ts +1 -1
|
@@ -88,14 +88,16 @@ export function recordId(path, id) {
|
|
|
88
88
|
}
|
|
89
89
|
export function forgetRecord(path) { rmSync(path, { force: true }); }
|
|
90
90
|
/** Delete one account this run created, by exact id, with the developer delete. A 404 means it
|
|
91
|
-
* is already gone. Returns
|
|
91
|
+
* is already gone. Returns null when deleted, or what the platform answered when it was not. */
|
|
92
92
|
export async function deleteAccount(client, projectId, id) {
|
|
93
93
|
try {
|
|
94
94
|
await client.call('DELETE', `/auth/users/${encodeURIComponent(id)}`, undefined, { project_id: projectId });
|
|
95
|
-
return
|
|
95
|
+
return null;
|
|
96
96
|
}
|
|
97
97
|
catch (error) {
|
|
98
|
-
|
|
98
|
+
if (error instanceof CliApiError && error.statusCode === 404)
|
|
99
|
+
return null;
|
|
100
|
+
return error instanceof CliApiError ? `HTTP ${error.statusCode ?? '?'} ${error.code}: ${error.message.slice(0, 200)}` : String(error).slice(0, 200);
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
function alive(pid) {
|
|
@@ -136,12 +138,13 @@ export async function sweepAccounts(client, root, projectId) {
|
|
|
136
138
|
forgetRecord(path);
|
|
137
139
|
continue;
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
const refused = await deleteAccount(client, projectId, record.id);
|
|
142
|
+
if (refused === null) {
|
|
140
143
|
result.deleted.push(record.id);
|
|
141
144
|
forgetRecord(path);
|
|
142
145
|
}
|
|
143
146
|
else
|
|
144
|
-
result.failed.push(record.email);
|
|
147
|
+
result.failed.push(`${record.email} (${refused})`);
|
|
145
148
|
}
|
|
146
149
|
return result;
|
|
147
150
|
}
|
|
@@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a,CAAC,MAAmB,EAAE,IAAY;IAC7D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,aAAa,MAAM,CAAC,OAAO,CAAC,MAAM,0DAA0D,CAAC,CAAC;IAC3I,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,sBAAsB,MAAM,CAAC,MAAM,CAAC,MAAM,6BAA6B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAC7L,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,mIAAmI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;IACzQ,OAAO,KAAK,CAAC;AACf,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 adds members; members read/write; creator rights | teams/team_members/tasks: owner() + member(); role-owner delete branch |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain |\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; member() gates placement (non-member create is\nrefused), while creators or the allowed branch can delete. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, member, anyOf, serverOnly, 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 teams: table({ id: id(), name: text(), owner_id: text() }, {\n scope: member({ group: 'id', membership: 'team_members', member_user: 'user_id', member_group: 'team_id' }),\n client: { read: ['id', 'name'] },\n }),\n team_members: table({ id: id(), team_id: text(), user_id: text(), role: text() }, {\n scope: serverOnly(), unique: [['team_id', 'user_id']],\n }),\n tasks: table({ id: id(), team_id: text({ references: 'teams' }), title: text() }, {\n scope: anyOf(owner(), member({ group: 'team_id', membership: 'team_members',\n member_user: 'user_id', member_group: 'team_id', operations: ['read', 'create', 'update'] }),\n member({ group: 'team_id', membership: 'team_members', member_user: 'user_id',\n member_group: 'team_id', where: { role: 'owner' }, operations: ['delete'] })),\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: somewhere 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 without verification: own membership table + member(); sw.groups and domain\nroles need VERIFIED emails. Members read/create/update tasks; creators or team owners delete while members.\nRestrictions narrow operations, not grant read.\nComment author or team owner deletes: declare it as tasks do (owner() plus member() where role owner, delete).\nCreate the team and its owner membership atomically:\n\n```ts\n// api/teams.ts\nexport default sw.endpoint({\n auth: 'required', body: { name: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const id = crypto.randomUUID();\n await sw.db.server.tx([\n { op: 'insert', table: 'teams', values: { id, name: body.name, owner_id: user.id } },\n { op: 'insert', table: 'team_members', values: { id: crypto.randomUUID(), team_id: id, user_id: user.id, role: 'owner' } },\n ]);\n return { id, email: user.email };\n },\n});\n```\n\n```ts\n// api/teams/[id]/members.ts \u2014 only the team owner adds a member\nexport default sw.endpoint({\n auth: 'required', body: { email: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const { data: teams } = await sw.db.from('teams', { where: { id: params.id, owner_id: user.id }, limit: 1 });\n if (!teams[0]) return Response.json({ error: 'Team owner required' }, { status: 403 });\n const { users: [target] } = await sw.auth.server.listUsers({ emails: [body.email] });\n if (!target) return Response.json({ error: 'Account not found' }, { status: 404 });\n await sw.db.server.insert('team_members', {\n id: crypto.randomUUID(), team_id: params.id, user_id: target.id, role: 'member',\n }, { onConflict: 'ignore' });\n return { ok: true };\n },\n});\n```\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state and protected membership ledgers.\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\nPublish: npx @somewhere-cloud/cli deploy, then somewhere test for the rules you changed.\nOne somewhere test run drives the UI and calls the API: signUp(page) uses your sign-up form\n(then signOut, signIn with its password, verify with the emailed code), newUser() acts as\nseveral people, and ready(page, 'signed-in' | 'signed-out') waits for the session check.\nYou do not need a separate browser script.\nDeploy raw source, no frontend build; type errors stop upload.\nnewUser() gives a signed-in page/API client; call N times (owner, member, outsider).\nnewUser() takes no chosen email. Test users are verified and visible to this project's server user lookup.\nEmail-domain role: signUp(page, { domain: 'staff.example' }), then verify(page, person); newPage() for a second person.\nRefusals: await expectRefused(person, 'notes', { operation: 'update', id, values }, { allowed: owner }) or\nexpectRefused(person, 'POST /api/x', body, { allowed }). allowed is someone the same request succeeds for;\nan empty list, a null get or a 404 counts as refused only then. person/allowed: page, newUser() or anonymous.\nsomewhere test --phone runs every test again at 390x844.\nFor the complete owner-adds-member-by-email test and its endpoints, run\nsomewhere docs test and follow Two users sharing through the app.\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 teams and membership endpoints above, the owner adds a fixture by email\nand that fixture reads the shared team row:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect, data } from '@somewhere-cloud/cli/testing';\ntest('owner adds a second user by email', async ({ newUser }) => {\n const owner = await newUser();\n const bob = await newUser();\n const name = `Shared team ${crypto.randomUUID()}`;\n const created = await owner.request.post('/api/teams', { data: { name } });\n expect(created.ok()).toBeTruthy();\n const { id } = await created.json();\n const added = await owner.request.post(`/api/teams/${id}/members`, { data: { email: bob.email } });\n expect(added.ok()).toBeTruthy();\n const response = await data(bob.request, 'teams', { operation: 'get', id });\n expect(response.ok()).toBeTruthy();\n expect((await response.json()).data).toMatchObject({ id, name });\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 adds members; members read/write; creator rights | teams/team_members/tasks: owner() + member(); role-owner delete branch |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain |\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; member() gates placement (non-member create is\nrefused), while creators or the allowed branch can delete. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, member, anyOf, serverOnly, 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 teams: table({ id: id(), name: text(), owner_id: text() }, {\n scope: member({ group: 'id', membership: 'team_members', member_user: 'user_id', member_group: 'team_id' }),\n client: { read: ['id', 'name'] },\n }),\n team_members: table({ id: id(), team_id: text(), user_id: text(), role: text() }, {\n scope: serverOnly(), unique: [['team_id', 'user_id']],\n }),\n tasks: table({ id: id(), team_id: text({ references: 'teams' }), title: text() }, {\n scope: anyOf(owner(), member({ group: 'team_id', membership: 'team_members',\n member_user: 'user_id', member_group: 'team_id', operations: ['read', 'create', 'update'] }),\n member({ group: 'team_id', membership: 'team_members', member_user: 'user_id',\n member_group: 'team_id', where: { role: 'owner' }, operations: ['delete'] })),\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: somewhere 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 without verification: own membership table + member(); sw.groups and domain\nroles need VERIFIED emails. Members read/create/update tasks; creators or team owners delete while members.\nRestrictions narrow operations, not grant read.\nComment author or team owner deletes: declare it as tasks do (owner() plus member() where role owner, delete).\nCreate the team and its owner membership atomically:\n\n```ts\n// api/teams.ts\nexport default sw.endpoint({\n auth: 'required', body: { name: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const id = crypto.randomUUID();\n await sw.db.server.tx([\n { op: 'insert', table: 'teams', values: { id, name: body.name, owner_id: user.id } },\n { op: 'insert', table: 'team_members', values: { id: crypto.randomUUID(), team_id: id, user_id: user.id, role: 'owner' } },\n ]);\n return { id, email: user.email };\n },\n});\n```\n\n```ts\n// api/teams/[id]/members.ts \u2014 only the team owner adds a member\nexport default sw.endpoint({\n auth: 'required', body: { email: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const { data: teams } = await sw.db.from('teams', { where: { id: params.id, owner_id: user.id }, limit: 1 });\n if (!teams[0]) return Response.json({ error: 'Team owner required' }, { status: 403 });\n const { users: [target] } = await sw.auth.server.listUsers({ emails: [body.email] });\n if (!target) return Response.json({ error: 'Account not found' }, { status: 404 });\n await sw.db.server.insert('team_members', {\n id: crypto.randomUUID(), team_id: params.id, user_id: target.id, role: 'member',\n }, { onConflict: 'ignore' });\n return { ok: true };\n },\n});\n```\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state and protected membership ledgers.\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\nPublish: npx @somewhere-cloud/cli deploy, then somewhere test for the rules you changed.\nOne somewhere test run drives the UI and calls the API: signUp(page) uses your sign-up form\n(then signOut, signIn with its password, verify with the emailed code), newUser() acts as\nseveral people, and ready(page, 'signed-in' | 'signed-out') waits for the session check.\nYou do not need a separate browser script.\nStart from the starter's tests/account, phone and access specs: one journey per test, its own people.\nOne somewhere test runs every spec, old and new together; somewhere deploy --test deploys, then runs them once.\nAfter fixing a test, run only what failed: somewhere test --failed (passed results on this release are kept).\nDo not rerun a suite that is already green on this release.\nDeploy raw source, no frontend build; type errors stop upload.\nnewUser() gives a signed-in page/API client; make people at once: await Promise.all([newUser(), newUser()]).\nnewUser({ role: 'staff' }) holds a role declared in appRoles, granted with your developer key.\nnewUser() takes no chosen email. Test users are verified and visible to this project's server user lookup.\nEmail-domain role: signUp(page, { domain: 'staff.example' }), then verify(page, person); newPage() for a second person.\nRefusals: await expectRefused(person, 'notes', { operation: 'update', id, values }, { allowed: owner }) or\nexpectRefused(person, 'POST /api/x', body, { allowed }). allowed is someone the same request succeeds for;\nan empty list, a null get or a 404 counts as refused only then. person/allowed: page, newUser() or anonymous.\nsomewhere test --phone runs every test again at 390x844.\nFor the complete owner-adds-member-by-email test and its endpoints, run\nsomewhere docs test and follow Two users sharing through the app.\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 teams and membership endpoints above, the owner adds a fixture by email\nand that fixture reads the shared team row:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect, data } from '@somewhere-cloud/cli/testing';\ntest('owner adds a second user by email', async ({ newUser }) => {\n const owner = await newUser();\n const bob = await newUser();\n const name = `Shared team ${crypto.randomUUID()}`;\n const created = await owner.request.post('/api/teams', { data: { name } });\n expect(created.ok()).toBeTruthy();\n const { id } = await created.json();\n const added = await owner.request.post(`/api/teams/${id}/members`, { data: { email: bob.email } });\n expect(added.ok()).toBeTruthy();\n const response = await data(bob.request, 'teams', { operation: 'get', id });\n expect(response.ok()).toBeTruthy();\n expect((await response.json()).data).toMatchObject({ id, name });\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:
|
|
@@ -7,5 +7,5 @@ export declare const DECLARED_ACCESS_POINTER = "";
|
|
|
7
7
|
export declare const PORTABILITY_POINTER = "Data/code export limits: `somewhere docs portability`.";
|
|
8
8
|
/** One line: using the app from Claude as its signed-in user (MCP tools). */
|
|
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
|
-
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 adds members; members read/write; creator rights | teams/team_members/tasks: owner() + member(); role-owner delete branch |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain |\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; member() gates placement (non-member create is\nrefused), while creators or the allowed branch can delete. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, member, anyOf, serverOnly, 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 teams: table({ id: id(), name: text(), owner_id: text() }, {\n scope: member({ group: 'id', membership: 'team_members', member_user: 'user_id', member_group: 'team_id' }),\n client: { read: ['id', 'name'] },\n }),\n team_members: table({ id: id(), team_id: text(), user_id: text(), role: text() }, {\n scope: serverOnly(), unique: [['team_id', 'user_id']],\n }),\n tasks: table({ id: id(), team_id: text({ references: 'teams' }), title: text() }, {\n scope: anyOf(owner(), member({ group: 'team_id', membership: 'team_members',\n member_user: 'user_id', member_group: 'team_id', operations: ['read', 'create', 'update'] }),\n member({ group: 'team_id', membership: 'team_members', member_user: 'user_id',\n member_group: 'team_id', where: { role: 'owner' }, operations: ['delete'] })),\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: somewhere 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 without verification: own membership table + member(); sw.groups and domain\nroles need VERIFIED emails. Members read/create/update tasks; creators or team owners delete while members.\nRestrictions narrow operations, not grant read.\nComment author or team owner deletes: declare it as tasks do (owner() plus member() where role owner, delete).\nCreate the team and its owner membership atomically:\n\n```ts\n// api/teams.ts\nexport default sw.endpoint({\n auth: 'required', body: { name: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const id = crypto.randomUUID();\n await sw.db.server.tx([\n { op: 'insert', table: 'teams', values: { id, name: body.name, owner_id: user.id } },\n { op: 'insert', table: 'team_members', values: { id: crypto.randomUUID(), team_id: id, user_id: user.id, role: 'owner' } },\n ]);\n return { id, email: user.email };\n },\n});\n```\n\n```ts\n// api/teams/[id]/members.ts \u2014 only the team owner adds a member\nexport default sw.endpoint({\n auth: 'required', body: { email: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const { data: teams } = await sw.db.from('teams', { where: { id: params.id, owner_id: user.id }, limit: 1 });\n if (!teams[0]) return Response.json({ error: 'Team owner required' }, { status: 403 });\n const { users: [target] } = await sw.auth.server.listUsers({ emails: [body.email] });\n if (!target) return Response.json({ error: 'Account not found' }, { status: 404 });\n await sw.db.server.insert('team_members', {\n id: crypto.randomUUID(), team_id: params.id, user_id: target.id, role: 'member',\n }, { onConflict: 'ignore' });\n return { ok: true };\n },\n});\n```\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state and protected membership ledgers.\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\nPublish: npx @somewhere-cloud/cli deploy, then somewhere test for the rules you changed.\nOne somewhere test run drives the UI and calls the API: signUp(page) uses your sign-up form\n(then signOut, signIn with its password, verify with the emailed code), newUser() acts as\nseveral people, and ready(page, 'signed-in' | 'signed-out') waits for the session check.\nYou do not need a separate browser script.\nDeploy raw source, no frontend build; type errors stop upload.\nnewUser() gives a signed-in page/API client; call N times (owner, member, outsider).\nnewUser() takes no chosen email. Test users are verified and visible to this project's server user lookup.\nEmail-domain role: signUp(page, { domain: 'staff.example' }), then verify(page, person); newPage() for a second person.\nRefusals: await expectRefused(person, 'notes', { operation: 'update', id, values }, { allowed: owner }) or\nexpectRefused(person, 'POST /api/x', body, { allowed }). allowed is someone the same request succeeds for;\nan empty list, a null get or a 404 counts as refused only then. person/allowed: page, newUser() or anonymous.\nsomewhere test --phone runs every test again at 390x844.\nFor the complete owner-adds-member-by-email test and its endpoints, run\nsomewhere docs test and follow Two users sharing through the app.\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 teams and membership endpoints above, the owner adds a fixture by email\nand that fixture reads the shared team row:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect, data } from '@somewhere-cloud/cli/testing';\ntest('owner adds a second user by email', async ({ newUser }) => {\n const owner = await newUser();\n const bob = await newUser();\n const name = `Shared team ${crypto.randomUUID()}`;\n const created = await owner.request.post('/api/teams', { data: { name } });\n expect(created.ok()).toBeTruthy();\n const { id } = await created.json();\n const added = await owner.request.post(`/api/teams/${id}/members`, { data: { email: bob.email } });\n expect(added.ok()).toBeTruthy();\n const response = await data(bob.request, 'teams', { operation: 'get', id });\n expect(response.ok()).toBeTruthy();\n expect((await response.json()).data).toMatchObject({ id, name });\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`.\n";
|
|
10
|
+
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 adds members; members read/write; creator rights | teams/team_members/tasks: owner() + member(); role-owner delete branch |\n| Owner/staff record with staff-only child notes | tickets: owner() or appRole(); parent() thread; staff-only notes; staff by verified emailDomain |\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; member() gates placement (non-member create is\nrefused), while creators or the allowed branch can delete. Other fields: timestamp({ default: 'now' }), text({ nullable: true });\nindexes: [['team_id']].\n\n```ts\nimport { schema, table, id, text, owner, member, anyOf, serverOnly, 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 teams: table({ id: id(), name: text(), owner_id: text() }, {\n scope: member({ group: 'id', membership: 'team_members', member_user: 'user_id', member_group: 'team_id' }),\n client: { read: ['id', 'name'] },\n }),\n team_members: table({ id: id(), team_id: text(), user_id: text(), role: text() }, {\n scope: serverOnly(), unique: [['team_id', 'user_id']],\n }),\n tasks: table({ id: id(), team_id: text({ references: 'teams' }), title: text() }, {\n scope: anyOf(owner(), member({ group: 'team_id', membership: 'team_members',\n member_user: 'user_id', member_group: 'team_id', operations: ['read', 'create', 'update'] }),\n member({ group: 'team_id', membership: 'team_members', member_user: 'user_id',\n member_group: 'team_id', where: { role: 'owner' }, operations: ['delete'] })),\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: somewhere 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 without verification: own membership table + member(); sw.groups and domain\nroles need VERIFIED emails. Members read/create/update tasks; creators or team owners delete while members.\nRestrictions narrow operations, not grant read.\nComment author or team owner deletes: declare it as tasks do (owner() plus member() where role owner, delete).\nCreate the team and its owner membership atomically:\n\n```ts\n// api/teams.ts\nexport default sw.endpoint({\n auth: 'required', body: { name: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const id = crypto.randomUUID();\n await sw.db.server.tx([\n { op: 'insert', table: 'teams', values: { id, name: body.name, owner_id: user.id } },\n { op: 'insert', table: 'team_members', values: { id: crypto.randomUUID(), team_id: id, user_id: user.id, role: 'owner' } },\n ]);\n return { id, email: user.email };\n },\n});\n```\n\n```ts\n// api/teams/[id]/members.ts \u2014 only the team owner adds a member\nexport default sw.endpoint({\n auth: 'required', body: { email: 'string' },\n handler: async ({ user, params, body }, sw) => {\n const { data: teams } = await sw.db.from('teams', { where: { id: params.id, owner_id: user.id }, limit: 1 });\n if (!teams[0]) return Response.json({ error: 'Team owner required' }, { status: 403 });\n const { users: [target] } = await sw.auth.server.listUsers({ emails: [body.email] });\n if (!target) return Response.json({ error: 'Account not found' }, { status: 404 });\n await sw.db.server.insert('team_members', {\n id: crypto.randomUUID(), team_id: params.id, user_id: target.id, role: 'member',\n }, { onConflict: 'ignore' });\n return { ok: true };\n },\n});\n```\n\nDo not hand-write access to app-read/write data: declare who may read/write it.\nserverOnly() fits job/import/audit/counter state and protected membership ledgers.\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\nPublish: npx @somewhere-cloud/cli deploy, then somewhere test for the rules you changed.\nOne somewhere test run drives the UI and calls the API: signUp(page) uses your sign-up form\n(then signOut, signIn with its password, verify with the emailed code), newUser() acts as\nseveral people, and ready(page, 'signed-in' | 'signed-out') waits for the session check.\nYou do not need a separate browser script.\nStart from the starter's tests/account, phone and access specs: one journey per test, its own people.\nOne somewhere test runs every spec, old and new together; somewhere deploy --test deploys, then runs them once.\nAfter fixing a test, run only what failed: somewhere test --failed (passed results on this release are kept).\nDo not rerun a suite that is already green on this release.\nDeploy raw source, no frontend build; type errors stop upload.\nnewUser() gives a signed-in page/API client; make people at once: await Promise.all([newUser(), newUser()]).\nnewUser({ role: 'staff' }) holds a role declared in appRoles, granted with your developer key.\nnewUser() takes no chosen email. Test users are verified and visible to this project's server user lookup.\nEmail-domain role: signUp(page, { domain: 'staff.example' }), then verify(page, person); newPage() for a second person.\nRefusals: await expectRefused(person, 'notes', { operation: 'update', id, values }, { allowed: owner }) or\nexpectRefused(person, 'POST /api/x', body, { allowed }). allowed is someone the same request succeeds for;\nan empty list, a null get or a 404 counts as refused only then. person/allowed: page, newUser() or anonymous.\nsomewhere test --phone runs every test again at 390x844.\nFor the complete owner-adds-member-by-email test and its endpoints, run\nsomewhere docs test and follow Two users sharing through the app.\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 teams and membership endpoints above, the owner adds a fixture by email\nand that fixture reads the shared team row:\n\n```ts\n// tests/team.spec.ts\nimport { test, expect, data } from '@somewhere-cloud/cli/testing';\ntest('owner adds a second user by email', async ({ newUser }) => {\n const owner = await newUser();\n const bob = await newUser();\n const name = `Shared team ${crypto.randomUUID()}`;\n const created = await owner.request.post('/api/teams', { data: { name } });\n expect(created.ok()).toBeTruthy();\n const { id } = await created.json();\n const added = await owner.request.post(`/api/teams/${id}/members`, { data: { email: bob.email } });\n expect(added.ok()).toBeTruthy();\n const response = await data(bob.request, 'teams', { operation: 'get', id });\n expect(response.ok()).toBeTruthy();\n expect((await response.json()).data).toMatchObject({ id, name });\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`.\n";
|
|
11
11
|
export declare const INIT_CLAUDE_MD = "Read AGENTS.md for project instructions.\n";
|
|
@@ -155,8 +155,13 @@ One somewhere test run drives the UI and calls the API: signUp(page) uses your s
|
|
|
155
155
|
(then signOut, signIn with its password, verify with the emailed code), newUser() acts as
|
|
156
156
|
several people, and ready(page, 'signed-in' | 'signed-out') waits for the session check.
|
|
157
157
|
You do not need a separate browser script.
|
|
158
|
+
Start from the starter's tests/account, phone and access specs: one journey per test, its own people.
|
|
159
|
+
One somewhere test runs every spec, old and new together; somewhere deploy --test deploys, then runs them once.
|
|
160
|
+
After fixing a test, run only what failed: somewhere test --failed (passed results on this release are kept).
|
|
161
|
+
Do not rerun a suite that is already green on this release.
|
|
158
162
|
Deploy raw source, no frontend build; type errors stop upload.
|
|
159
|
-
newUser() gives a signed-in page/API client;
|
|
163
|
+
newUser() gives a signed-in page/API client; make people at once: await Promise.all([newUser(), newUser()]).
|
|
164
|
+
newUser({ role: 'staff' }) holds a role declared in appRoles, granted with your developer key.
|
|
160
165
|
newUser() takes no chosen email. Test users are verified and visible to this project's server user lookup.
|
|
161
166
|
Email-domain role: signUp(page, { domain: 'staff.example' }), then verify(page, person); newPage() for a second person.
|
|
162
167
|
Refusals: await expectRefused(person, 'notes', { operation: 'update', id, values }, { allowed: owner }) or
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoM7B,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,MAAM,CAAC,MAAM,cAAc,GAAG,uCAAuC,cAAc,KAAK,cAAc,KAAK,mBAAmB,KAAK,WAAW,IAAI,CAAC;AACnJ,MAAM,CAAC,MAAM,cAAc,GAAG,4CAA4C,CAAC"}
|
|
@@ -3193,13 +3193,13 @@ export function createFeatureTemplate(selection, options) {
|
|
|
3193
3193
|
const agent = selection.modules.includes('agent');
|
|
3194
3194
|
const magicLink = selection.modules.includes('magic-link');
|
|
3195
3195
|
const files = [
|
|
3196
|
-
...starterTests(privateData),
|
|
3196
|
+
...starterTests({ privateData }),
|
|
3197
3197
|
{ path: '.gitignore', content: 'node_modules\ndist\nbuild\n.env\n# Generated from db/schema.ts by somewhere typecheck, dev and deploy.\n__somewhere_data.d.ts\n__somewhere_files.d.ts\n' },
|
|
3198
3198
|
{ path: 'AGENTS.md', content: INIT_AGENTS_MD.replace(/## Getting started[^]*?After edits:/, `## Testing
|
|
3199
|
-
|
|
3200
|
-
Each test
|
|
3201
|
-
Run somewhere test
|
|
3202
|
-
After a
|
|
3199
|
+
tests/account, phone and access specs are working journeys: adapt them, one journey per test.
|
|
3200
|
+
Each test makes its own people at once (Promise.all of newUser()) and unique row values.
|
|
3201
|
+
Run somewhere test (or somewhere deploy --test): every spec, old and new, in one run.
|
|
3202
|
+
After fixing a test, run only what failed: somewhere test --failed. Never rerun a green suite on one release.
|
|
3203
3203
|
A pass means the checks you wrote passed; say which requirements they do not cover.
|
|
3204
3204
|
Use ready(page) for starter session readiness, or an explicit locator.
|
|
3205
3205
|
Test users are removed afterwards; rows, files and mail they created remain.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-feature-template.js","sourceRoot":"","sources":["../../src/lib/init-feature-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAW5I,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;+BAeU,WAAW;;;;;;;;;;;CAWzC,CAAC;AAEF,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;CAchB,CAAC;AAEF,SAAS,SAAS,CAAC,OAAe;IAChC,6EAA6E;IAC7E,MAAM,KAAK,GAAG,OAAO,CAAC,OAA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AAE,OAAO,EAAE,eAAe,EAAE,EACxD,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,EAAE,EACjE,EAAE,IAAI,EAAE,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,EAC5D,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAClE,EAAE,IAAI,EAAE,qCAAqC,EAAE,OAAO,EAAE,uBAAuB,EAAE,EACjF,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,qBAAqB,EAAE,EACvG,EAAE,IAAI,EAAE,+BAA+B,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAC5E,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CLI_VERSION } from './version.js';
|
|
2
2
|
import { INIT_AGENTS_MD, INIT_CLAUDE_MD } from './init-agent-guide.js';
|
|
3
3
|
import { ASSET_TYPES_FILE } from './init-asset-types.js';
|
|
4
|
+
import { starterTests } from './init-test-template.js';
|
|
4
5
|
const PACKAGE_JSON = `{
|
|
5
6
|
"name": "somewhere-starter",
|
|
6
7
|
"private": true,
|
|
@@ -17,6 +18,7 @@ const PACKAGE_JSON = `{
|
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"@somewhere-cloud/cli": "${CLI_VERSION}",
|
|
21
|
+
"@playwright/test": "1.65.0",
|
|
20
22
|
"@types/react": "19.2.2",
|
|
21
23
|
"@types/react-dom": "19.2.2",
|
|
22
24
|
"typescript": "5.9.3",
|
|
@@ -167,6 +169,7 @@ Deploy the raw source. The platform compiles it; do not create or deploy a
|
|
|
167
169
|
`;
|
|
168
170
|
export function createGreenTemplate() {
|
|
169
171
|
return [
|
|
172
|
+
...starterTests({ minimal: true }),
|
|
170
173
|
{ path: '.gitignore', content: 'node_modules\ndist\nbuild\n.env\n# Generated from db/schema.ts by somewhere typecheck, dev and deploy.\n__somewhere_data.d.ts\n__somewhere_files.d.ts\n' },
|
|
171
174
|
{ path: 'AGENTS.md', content: INIT_AGENTS_MD },
|
|
172
175
|
{ path: 'CLAUDE.md', content: INIT_CLAUDE_MD },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-green-template.js","sourceRoot":"","sources":["../../src/lib/init-green-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"init-green-template.js","sourceRoot":"","sources":["../../src/lib/init-green-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;+BAeU,WAAW;;;;;;;;;;;CAWzC,CAAC;AAEF,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;CAchB,CAAC;AAEF,MAAM,SAAS,GAAG;;;CAGjB,CAAC;AAEF,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AAEF,MAAM,GAAG,GAAG;;;;;;;;;CASX,CAAC;AAEF,MAAM,OAAO,GAAG;;;;;;;CAOf,CAAC;AAEF,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBX,CAAC;AAEF,MAAM,IAAI,GAAG;;;;;;;;;;CAUZ,CAAC;AAEF,MAAM,MAAM,GAAG;;;;;;;;;;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ts instead of writing from nothing.
|
|
2
|
+
// Each one makes its own people (at the same time, with Promise.all), shares nothing with the others,
|
|
3
|
+
// runs alone or in any order, and waits on what the app does, never on a fixed sleep.
|
|
4
|
+
const FORM_ACCOUNT = `import { test, expect } from '@somewhere-cloud/cli/testing';
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
// A visitor signs up through the app's own form, signs out and signs back in.
|
|
7
|
+
test('sign up, sign out and sign back in', async ({ page, signUp, signOut, signIn }) => {
|
|
4
8
|
const person = await signUp(page);
|
|
5
9
|
await expect(page.getByText(person.email)).toBeVisible();
|
|
6
10
|
await signOut(page);
|
|
7
11
|
await signIn(page, person);
|
|
8
12
|
await expect(page.getByText(person.email)).toBeVisible();
|
|
9
13
|
});
|
|
14
|
+
`;
|
|
15
|
+
// The minimal starter has no sign-in screens yet: these steps call its auth route from the page.
|
|
16
|
+
// Once the app has a form, drop the steps (starter form) or replace them with the form's own steps.
|
|
17
|
+
const ROUTE_ACCOUNT = `import { test, expect, type FormSteps } from '@somewhere-cloud/cli/testing';
|
|
18
|
+
|
|
19
|
+
// This app has no sign-in screens yet, so these steps use its auth route from the page.
|
|
20
|
+
// When you add a form, replace them with your form's steps: fill, submit.
|
|
21
|
+
const viaAuthRoute = (path: string): FormSteps => async (page, { email, password }) => {
|
|
22
|
+
if (page.url() === 'about:blank') await page.goto('/');
|
|
23
|
+
await page.evaluate(async ([path, body]) => {
|
|
24
|
+
const response = await fetch(path, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
|
|
25
|
+
await response.text(); // read the answer, as a form would
|
|
26
|
+
}, [path, { email, password }] as const);
|
|
27
|
+
};
|
|
28
|
+
const signedInAs = async (page: import('@playwright/test').Page) => (await (await page.request.get('/api/auth/me')).json()).user;
|
|
10
29
|
|
|
11
|
-
test('
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
expect(
|
|
15
|
-
expect(
|
|
16
|
-
await
|
|
17
|
-
await
|
|
18
|
-
expect((await user.request.post('/api/auth/logout', { data: {} })).status()).toBe(200);
|
|
19
|
-
expect((await (await user.request.get('/api/auth/me')).json()).user).toBeNull();
|
|
20
|
-
await user.page.reload();
|
|
21
|
-
await ready(user.page, 'signed-out');
|
|
30
|
+
test('sign up, sign out and sign back in', async ({ page, signUp, signOut, signIn }) => {
|
|
31
|
+
const person = await signUp(page, { steps: viaAuthRoute('/api/auth/signup') });
|
|
32
|
+
expect((await signedInAs(page)).email).toBe(person.email);
|
|
33
|
+
await signOut(page, { steps: async page => { expect((await page.request.post('/api/auth/logout', { data: {} })).ok()).toBe(true); } });
|
|
34
|
+
expect(await signedInAs(page)).toBeNull();
|
|
35
|
+
await signIn(page, person, { steps: viaAuthRoute('/api/auth/login') });
|
|
36
|
+
expect((await signedInAs(page)).email).toBe(person.email);
|
|
22
37
|
});
|
|
23
38
|
`;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
expect((await hidden.json()).data).toBeNull();
|
|
47
|
-
await expectRefused(await data(outsider.request, 'notes', { operation: 'update', id: row.id, values: { title: 'changed' } }), 404, 'DATA_NOT_FOUND');
|
|
48
|
-
const unchanged = await data(owner.request, 'notes', { operation: 'get', id: row.id });
|
|
49
|
-
expect(unchanged.status()).toBe(200);
|
|
50
|
-
expect((await unchanged.json()).data.title).toBe(updatedTitle);
|
|
39
|
+
// Nothing scrolls sideways at phone width: not the page, and not a table or panel inside it.
|
|
40
|
+
const SIDEWAYS = `async function scrollsSideways(page: import('@playwright/test').Page) {
|
|
41
|
+
return page.evaluate(() => [document.documentElement, ...document.querySelectorAll('body *')]
|
|
42
|
+
.filter((el) => el.scrollWidth > el.clientWidth + 1
|
|
43
|
+
&& (el === document.documentElement || ['auto', 'scroll'].includes(getComputedStyle(el).overflowX)))
|
|
44
|
+
.map((el) => el.tagName.toLowerCase() + (typeof el.className === 'string' && el.className ? '.' + el.className.split(' ')[0] : '')));
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
const FORM_PHONE = (privateData) => `import { test, expect } from '@somewhere-cloud/cli/testing';
|
|
48
|
+
|
|
49
|
+
// One pass at phone width. Adapt: do the app's main action here, as a person on a phone would.
|
|
50
|
+
test.use({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true });
|
|
51
|
+
${SIDEWAYS}
|
|
52
|
+
test('phone: ${privateData ? 'sign up, add a note and sign out' : 'sign up and sign out'}', async ({ page, signUp, signOut }) => {
|
|
53
|
+
const person = await signUp(page);
|
|
54
|
+
await expect(page.getByText(person.email)).toBeVisible();
|
|
55
|
+
expect(await scrollsSideways(page), 'these scroll sideways at 390 px').toEqual([]);
|
|
56
|
+
${privateData ? ` const title = 'phone ' + crypto.randomUUID();
|
|
57
|
+
await page.getByLabel('Title').fill(title);
|
|
58
|
+
await page.getByRole('button', { name: 'Add note' }).click();
|
|
59
|
+
await expect(page.getByRole('heading', { name: title })).toBeVisible();
|
|
60
|
+
` : ''} await signOut(page);
|
|
51
61
|
});
|
|
52
62
|
`;
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
const ROUTE_PHONE = `import { test, expect } from '@somewhere-cloud/cli/testing';
|
|
64
|
+
|
|
65
|
+
// One pass at phone width. Adapt: do the app's main action here, as a person on a phone would.
|
|
66
|
+
test.use({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true });
|
|
67
|
+
${SIDEWAYS}
|
|
68
|
+
test('phone: the page shows the greeting from its function', async ({ page }) => {
|
|
69
|
+
await page.goto('/');
|
|
70
|
+
await expect(page.getByText('Your full-stack app is ready.')).toBeVisible();
|
|
71
|
+
expect(await scrollsSideways(page), 'these scroll sideways at 390 px').toEqual([]);
|
|
72
|
+
});
|
|
73
|
+
`;
|
|
74
|
+
// Two people, one role-holder: the access journeys. In the private-data starter the first one runs
|
|
75
|
+
// against its notes; elsewhere both say exactly what to fill in and are skipped until then.
|
|
76
|
+
const ACCESS = (variant) => `import { test, expect, data, expectRefused } from '@somewhere-cloud/cli/testing';
|
|
77
|
+
|
|
78
|
+
// Adapt: a table whose rows belong to the person who made them, values to create one, and a change.
|
|
79
|
+
const OWNED = ${variant === 'notes'
|
|
80
|
+
? `{ table: 'notes', values: { title: 'private ' + crypto.randomUUID() }, change: { title: 'changed' } }`
|
|
81
|
+
: `{ table: '', values: {} as Record<string, unknown>, change: {} as Record<string, unknown> }`};
|
|
82
|
+
// Adapt: a role from appRoles in db/schema.ts, a table only that role may use, and values to create a row.
|
|
83
|
+
const ROLE = { role: '', table: '', values: {} as Record<string, unknown> };
|
|
84
|
+
|
|
85
|
+
test('one person cannot see or change another person\\'s rows', async ({ newUser }) => {
|
|
86
|
+
test.skip(!OWNED.table, 'Fill in OWNED at the top of tests/access.spec.ts');
|
|
87
|
+
const [owner, other] = await Promise.all([newUser(), newUser()]);
|
|
88
|
+
${variant === 'notes' ? ` // The owner adds the row through the app's own form.
|
|
89
|
+
await owner.page.goto('/');
|
|
90
|
+
await owner.page.getByLabel('Title').fill(OWNED.values.title);
|
|
91
|
+
await owner.page.getByRole('button', { name: 'Add note' }).click();
|
|
92
|
+
await expect(owner.page.getByRole('heading', { name: OWNED.values.title })).toBeVisible();
|
|
93
|
+
const listed = await data(owner.request, OWNED.table, { operation: 'list', where: { title: OWNED.values.title } });
|
|
94
|
+
const { id } = (await listed.json()).data[0];
|
|
95
|
+
// The other person's own list loads without it.
|
|
96
|
+
await other.page.goto('/');
|
|
97
|
+
await expect(other.page.getByText('No notes yet.')).toBeVisible();
|
|
98
|
+
` : ` const created = await data(owner.request, OWNED.table, { operation: 'create', values: OWNED.values });
|
|
99
|
+
expect(created.status()).toBe(200);
|
|
100
|
+
const { id } = (await created.json()).data;
|
|
101
|
+
`} // Every way the other person could reach the row is refused; the owner is the positive control.
|
|
102
|
+
await Promise.all([
|
|
103
|
+
expectRefused(other, OWNED.table, { operation: 'get', id }, { allowed: owner }),
|
|
104
|
+
expectRefused(other, OWNED.table, { operation: 'list', where: { id } }, { allowed: owner }),
|
|
105
|
+
expectRefused(other, OWNED.table, { operation: 'update', id, values: OWNED.change }, { allowed: owner }),
|
|
106
|
+
expectRefused(other, OWNED.table, { operation: 'delete', id }, { allowed: owner }),
|
|
107
|
+
]);
|
|
108
|
+
// Nothing they tried changed it.
|
|
109
|
+
const after = await data(owner.request, OWNED.table, { operation: 'get', id });
|
|
110
|
+
expect((await after.json()).data).toMatchObject(OWNED.values);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test('a role-holder may use what a non-holder is refused', async ({ newUser }) => {
|
|
114
|
+
test.skip(!ROLE.role, 'Fill in ROLE at the top of tests/access.spec.ts');
|
|
115
|
+
const [holder, person] = await Promise.all([newUser({ role: ROLE.role }), newUser()]);
|
|
116
|
+
const created = await data(holder.request, ROLE.table, { operation: 'create', values: ROLE.values });
|
|
117
|
+
expect(created.status()).toBe(200);
|
|
118
|
+
const { id } = (await created.json()).data;
|
|
119
|
+
await Promise.all([
|
|
120
|
+
expectRefused(person, ROLE.table, { operation: 'get', id }, { allowed: holder }),
|
|
121
|
+
expectRefused(person, ROLE.table, { operation: 'create', values: ROLE.values }, { allowed: holder }),
|
|
122
|
+
expectRefused(person, ROLE.table, { operation: 'delete', id }, { allowed: holder }),
|
|
123
|
+
]);
|
|
124
|
+
expect((await (await data(holder.request, ROLE.table, { operation: 'get', id })).json()).data).toMatchObject(ROLE.values);
|
|
125
|
+
});
|
|
126
|
+
${variant === 'minimal' ? `
|
|
127
|
+
test('visitors cannot read the server-only greetings table', async ({ anonymous }) => {
|
|
128
|
+
await expectRefused(anonymous, 'greetings', { operation: 'list' });
|
|
129
|
+
});
|
|
130
|
+
` : ''}`;
|
|
131
|
+
export function starterTests(options = {}) {
|
|
132
|
+
if (options.minimal) {
|
|
133
|
+
return [
|
|
134
|
+
{ path: 'tests/account.spec.ts', content: ROUTE_ACCOUNT },
|
|
135
|
+
{ path: 'tests/phone.spec.ts', content: ROUTE_PHONE },
|
|
136
|
+
{ path: 'tests/access.spec.ts', content: ACCESS('minimal') },
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
return [
|
|
140
|
+
{ path: 'tests/account.spec.ts', content: FORM_ACCOUNT },
|
|
141
|
+
{ path: 'tests/phone.spec.ts', content: FORM_PHONE(Boolean(options.privateData)) },
|
|
142
|
+
{ path: 'tests/access.spec.ts', content: ACCESS(options.privateData ? 'notes' : 'none') },
|
|
143
|
+
];
|
|
55
144
|
}
|
|
56
145
|
//# sourceMappingURL=init-test-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-test-template.js","sourceRoot":"","sources":["../../src/lib/init-test-template.ts"],"names":[],"mappings":"AAEA,MAAM,
|
|
1
|
+
{"version":3,"file":"init-test-template.js","sourceRoot":"","sources":["../../src/lib/init-test-template.ts"],"names":[],"mappings":"AAEA,oGAAoG;AACpG,sGAAsG;AACtG,sFAAsF;AAEtF,MAAM,YAAY,GAAG;;;;;;;;;;CAUpB,CAAC;AAEF,iGAAiG;AACjG,oGAAoG;AACpG,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBrB,CAAC;AAEF,6FAA6F;AAC7F,MAAM,QAAQ,GAAG;;;;;;CAMhB,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,WAAoB,EAAE,EAAE,CAAC;;;;EAI3C,QAAQ;eACK,WAAW,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,sBAAsB;;;;EAItF,WAAW,CAAC,CAAC,CAAC;;;;CAIf,CAAC,CAAC,CAAC,EAAE;;CAEL,CAAC;AAEF,MAAM,WAAW,GAAG;;;;EAIlB,QAAQ;;;;;;CAMT,CAAC;AAEF,mGAAmG;A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