@somewhere-cloud/cli 0.38.76 → 0.38.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/commands/check.js +0 -15
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/deploy.js +4 -8
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/test.js +1 -1
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/typecheck.js +2 -2
- package/dist/commands/typecheck.js.map +1 -1
- package/dist/lib/declared-data.d.ts +0 -2
- package/dist/lib/declared-data.js +0 -7
- package/dist/lib/declared-data.js.map +1 -1
- package/dist/lib/init-agent-guide.d.ts +2 -2
- package/dist/lib/init-agent-guide.js +2 -2
- package/dist/lib/init-feature-template.js +2 -2
- package/dist/lib/role-method-hints.d.ts +1 -1
- package/dist/lib/role-method-hints.js +17 -9
- package/dist/lib/role-method-hints.js.map +1 -1
- package/dist/lib/runtime-refusals.d.ts +1 -1
- package/dist/lib/runtime-refusals.js +1 -1
- package/dist/lib/runtime-refusals.js.map +1 -1
- package/dist/lib/test-reporter.js +5 -2
- package/dist/lib/test-reporter.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/runtime/DECLARED-DATA-VENDOR.json +3 -3
- package/runtime/PLATFORM-SOURCE.json +1 -1
- package/runtime/SOURCE-LINT-VENDOR.json +2 -2
- package/runtime/declared-data.cjs +2 -12
- package/runtime/source-lint.cjs +8 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/commands/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,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AAc,CAAC,IAAI,CAAC,CAAC;qBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAAE,MAAM,CAAC,IAAI,CAAC,CAAC;YAAC,CAAC;QACjP,CAAC,CAAC;QACF,cAAc,CAAC,SAAS,CAAC,CAAC;QAC1B,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -14,7 +14,7 @@ export function registerTypecheck(program) {
|
|
|
14
14
|
program
|
|
15
15
|
.command('typecheck [dir]')
|
|
16
16
|
.description('Check a source project with `tsc --noEmit`. ' +
|
|
17
|
-
'Reports TypeScript errors with file:line before deploy and exits 1 when there are any; `somewhere deploy` stops on type errors
|
|
17
|
+
'Reports TypeScript errors with file:line before deploy and exits 1 when there are any; `somewhere deploy` stops on type errors. ' +
|
|
18
18
|
'Requires a local tsconfig.json; add one for a new app, or run `somewhere pull` for an existing deployed app. ' +
|
|
19
19
|
'It never installs the project\'s dependencies: if the project declares type packages that are not installed, it says so and stops; run npm install first. ' +
|
|
20
20
|
'Without TypeScript in the project it fetches TypeScript with npx (network; npm caches it) and says so on stderr. Every run stops after SOMEWHERE_TYPECHECK_TIMEOUT_MS (default 300000). ' +
|
|
@@ -150,7 +150,7 @@ export function reportTypecheck(result) {
|
|
|
150
150
|
}
|
|
151
151
|
const undefinedSymbols = result.errors.filter((e) => e.code === 'TS2304');
|
|
152
152
|
const n = result.errors.length;
|
|
153
|
-
error(`${bold(String(n))} type error${n === 1 ? '' : 's'} ${dim(`(via ${result.via} tsc)`)} — exit 1. \`somewhere deploy\` stops before upload
|
|
153
|
+
error(`${bold(String(n))} type error${n === 1 ? '' : 's'} ${dim(`(via ${result.via} tsc)`)} — exit 1. \`somewhere deploy\` stops before upload.`);
|
|
154
154
|
if (undefinedSymbols.length) {
|
|
155
155
|
warn(`${undefinedSymbols.length} undefined symbol${undefinedSymbols.length === 1 ? '' : 's'} (likely a dropped import) — exactly the bug that 500s production.`);
|
|
156
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typecheck.js","sourceRoot":"","sources":["../../src/commands/typecheck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,cAAc,EAAE,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AAC3J,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,YAAY,EAAE,uBAAuB,EAAwB,MAAM,qBAAqB,CAAC;AACpL,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE3E,MAAM,CAAC,MAAM,yBAAyB,GACpC,4IAA4I,CAAC;AAE/I,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,OAAO;SACJ,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CACV,8CAA8C;QAC5C,
|
|
1
|
+
{"version":3,"file":"typecheck.js","sourceRoot":"","sources":["../../src/commands/typecheck.ts"],"names":[],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AE,CAAC,KAAK,GAAG,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACjC,2EAA2E;IAC3E,8EAA8E;IAC9E,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,2EAA2E,CAAC,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -47,6 +47,4 @@ export declare function declaredDataPlugin(projectDir: string): {
|
|
|
47
47
|
configureServer(server: DataDevServer): void;
|
|
48
48
|
closeBundle(): void;
|
|
49
49
|
};
|
|
50
|
-
/** Advisory from the canonical schema parser, not source-text guesses. */
|
|
51
|
-
export declare function declaredAccessNotice(files: Record<string, string>): string | undefined;
|
|
52
50
|
export {};
|
|
@@ -145,11 +145,4 @@ export function declaredDataPlugin(projectDir) {
|
|
|
145
145
|
closeBundle() { cleanup?.(); },
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
/** Advisory from the canonical schema parser, not source-text guesses. */
|
|
149
|
-
export function declaredAccessNotice(files) {
|
|
150
|
-
const generator = require('../../runtime/declared-data.cjs');
|
|
151
|
-
return generator.allTablesServerOnlyWithoutClient(files)
|
|
152
|
-
? 'Access is entirely hand-written in this app; declare ordinary app data instead: somewhere docs declared-data --section declare-a-table-and-use-it'
|
|
153
|
-
: undefined;
|
|
154
|
-
}
|
|
155
148
|
//# sourceMappingURL=declared-data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declared-data.js","sourceRoot":"","sources":["../../src/lib/declared-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,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K,CAAC,CAAC,CAAC;gBAAC,CAAC;gBAC5G,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;gBACjE,IAAI,MAAM;oBAAE,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBACxD,IAAI,OAAO;oBAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,MAAM,EAAE,yBAAyB,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;;oBAC5J,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;YAC/C,CAAC,CAAC;YACF,KAAK,MAAM,KAAK,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;gBAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACnF,OAAO,GAAG,GAAG,EAAE,GAAG,KAAK,MAAM,KAAK,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;gBAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3G,CAAC;QACD,WAAW,KAAK,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
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; POST setup below |\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: { assignedBy: 'server' } } });\n```\n\nPOST role setup once after sign-up/profile completion, not GET/every request:\ncookie-authenticated GET cannot mutate roles.\nCheck admin here, or your own assignment rule.\nmessages use parent(): owner() would hide staff replies from the customer.\nUse emailDomain for staff at your verified domain; assignedBy: 'server' when the\napp decides (promotion, payment, invitation). An email ending proves identity only\nwhen verified; assigning a role anyway is your app's decision, whose permissions the platform enforces.\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 deletion stays a small endpoint.\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\n```ts\n// api/complete-profile.ts \u2014 POST once when an admin assigns staff after sign-up\nexport default sw.endpoint({\n auth: 'required', body: { userId: 'string' },\n handler: async ({ request, body }, sw) => {\n await sw.auth.requireUser(request, { role: 'admin' });\n await sw.auth.server.setRoles(body.userId, { add: ['staff'] });\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.\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: somewhere typecheck \u2192 npx @somewhere-cloud/cli deploy \u2192 somewhere verify \u2192 somewhere test.\nDeploy raw source, no frontend build. Type errors stop upload; override: somewhere deploy --allow-type-errors.\nnewUser() gives a signed-in page/API client; call N times (owner, member, outsider).\nNo chosen email argument: assign roles/memberships through your app's authorized POST setup.\nTest users are verified and visible to this project's server user lookup.\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; POST setup below |\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: { assignedBy: 'server' } } });\n```\n\nPOST role setup once after sign-up/profile completion, not GET/every request:\ncookie-authenticated GET cannot mutate roles.\nCheck admin here, or your own assignment rule.\nmessages use parent(): owner() would hide staff replies from the customer.\nUse emailDomain for staff at your verified domain; assignedBy: 'server' when the\napp decides (promotion, payment, invitation). An email ending proves identity only\nwhen verified; assigning a role anyway is your app's decision, whose permissions the platform enforces.\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 deletion stays a small endpoint.\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\n```ts\n// api/complete-profile.ts \u2014 POST once when an admin assigns staff after sign-up\nexport default sw.endpoint({\n auth: 'required', body: { userId: 'string' },\n handler: async ({ request, body }, sw) => {\n await sw.auth.requireUser(request, { role: 'admin' });\n await sw.auth.server.setRoles(body.userId, { add: ['staff'] });\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.\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.\nDeploy raw source, no frontend build; type errors stop upload.\nnewUser() gives a signed-in page/API client; call N times (owner, member, outsider).\nNo chosen email argument: assign roles/memberships through your app's authorized POST setup.\nTest users are verified and visible to this project's server user lookup.\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:
|
|
5
5
|
* an evaluating agent concluded the platform had no exits. Kept outside
|
|
6
6
|
* AGENT_WORKFLOW, which is a byte mirror of the platform's agent workflow. */
|
|
7
7
|
export declare const PORTABILITY_POINTER = "Data/code export limits: `somewhere docs portability`.";
|
|
8
|
-
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; POST setup below |\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: { assignedBy: 'server' } } });\n```\n\nPOST role setup once after sign-up/profile completion, not GET/every request:\ncookie-authenticated GET cannot mutate roles.\nCheck admin here, or your own assignment rule.\nmessages use parent(): owner() would hide staff replies from the customer.\nUse emailDomain for staff at your verified domain; assignedBy: 'server' when the\napp decides (promotion, payment, invitation). An email ending proves identity only\nwhen verified; assigning a role anyway is your app's decision, whose permissions the platform enforces.\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 deletion stays a small endpoint.\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\n```ts\n// api/complete-profile.ts \u2014 POST once when an admin assigns staff after sign-up\nexport default sw.endpoint({\n auth: 'required', body: { userId: 'string' },\n handler: async ({ request, body }, sw) => {\n await sw.auth.requireUser(request, { role: 'admin' });\n await sw.auth.server.setRoles(body.userId, { add: ['staff'] });\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.\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: somewhere typecheck \u2192 npx @somewhere-cloud/cli deploy \u2192 somewhere verify \u2192 somewhere test.\nDeploy raw source, no frontend build. Type errors stop upload; override: somewhere deploy --allow-type-errors.\nnewUser() gives a signed-in page/API client; call N times (owner, member, outsider).\nNo chosen email argument: assign roles/memberships through your app's authorized POST setup.\nTest users are verified and visible to this project's server user lookup.\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`.\n";
|
|
8
|
+
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; POST setup below |\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: { assignedBy: 'server' } } });\n```\n\nPOST role setup once after sign-up/profile completion, not GET/every request:\ncookie-authenticated GET cannot mutate roles.\nCheck admin here, or your own assignment rule.\nmessages use parent(): owner() would hide staff replies from the customer.\nUse emailDomain for staff at your verified domain; assignedBy: 'server' when the\napp decides (promotion, payment, invitation). An email ending proves identity only\nwhen verified; assigning a role anyway is your app's decision, whose permissions the platform enforces.\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 deletion stays a small endpoint.\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\n```ts\n// api/complete-profile.ts \u2014 POST once when an admin assigns staff after sign-up\nexport default sw.endpoint({\n auth: 'required', body: { userId: 'string' },\n handler: async ({ request, body }, sw) => {\n await sw.auth.requireUser(request, { role: 'admin' });\n await sw.auth.server.setRoles(body.userId, { add: ['staff'] });\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.\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.\nDeploy raw source, no frontend build; type errors stop upload.\nnewUser() gives a signed-in page/API client; call N times (owner, member, outsider).\nNo chosen email argument: assign roles/memberships through your app's authorized POST setup.\nTest users are verified and visible to this project's server user lookup.\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`.\n";
|
|
9
9
|
export declare const INIT_CLAUDE_MD = "Read AGENTS.md for project instructions.\n";
|
|
@@ -161,8 +161,8 @@ headers: { 'content-type': 'application/json' }, body: JSON.stringify(values) })
|
|
|
161
161
|
Access cookies refresh automatically. Cookie-auth POST/PATCH/DELETE from scripts
|
|
162
162
|
need Origin equal to the app URL.
|
|
163
163
|
|
|
164
|
-
Publish:
|
|
165
|
-
Deploy raw source, no frontend build
|
|
164
|
+
Publish: npx @somewhere-cloud/cli deploy, then somewhere test for the rules you changed.
|
|
165
|
+
Deploy raw source, no frontend build; type errors stop upload.
|
|
166
166
|
newUser() gives a signed-in page/API client; call N times (owner, member, outsider).
|
|
167
167
|
No chosen email argument: assign roles/memberships through your app's authorized POST setup.
|
|
168
168
|
Test users are verified and visible to this project's server user lookup.
|
|
@@ -3053,8 +3053,8 @@ export function createFeatureTemplate(selection, options) {
|
|
|
3053
3053
|
Write tests/*.spec.ts importing test, expect from @somewhere-cloud/cli/testing.
|
|
3054
3054
|
Each test creates its own users with newUser() and unique row values.
|
|
3055
3055
|
Run somewhere test against the linked production app (five workers).
|
|
3056
|
-
After a failure, fix it and run somewhere test --failed
|
|
3057
|
-
|
|
3056
|
+
After a failure, fix it and run somewhere test --failed.
|
|
3057
|
+
A pass means the checks you wrote passed; say which requirements they do not cover.
|
|
3058
3058
|
Use ready(page) for starter session readiness, or an explicit locator.
|
|
3059
3059
|
Test users are removed afterwards; rows, files and mail they created remain.
|
|
3060
3060
|
Managed users bypass signup/onboarding; test those separately if you customize them.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Removed role-method names, and setRoles in explicit GET-only routes; not an authorization analysis. */
|
|
2
2
|
export declare function roleMethodHints(projectDir: string): string[];
|
|
@@ -2,8 +2,8 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { join, relative } from 'node:path';
|
|
3
3
|
import ts from 'typescript';
|
|
4
4
|
const METHODS = new Set(['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS']);
|
|
5
|
-
const
|
|
6
|
-
/**
|
|
5
|
+
const REMOVED_ROLE_METHODS = { grantRole: 'add', revokeRole: 'remove' };
|
|
6
|
+
/** Removed role-method names, and setRoles in explicit GET-only routes; not an authorization analysis. */
|
|
7
7
|
export function roleMethodHints(projectDir) {
|
|
8
8
|
const api = join(projectDir, 'api');
|
|
9
9
|
if (!existsSync(api))
|
|
@@ -46,20 +46,28 @@ export function roleMethodHints(projectDir) {
|
|
|
46
46
|
exports.add(statement.name.text);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
if (unknown || methods.length !== 1 || methods[0] !== 'GET')
|
|
51
|
-
continue;
|
|
49
|
+
const rel = relative(projectDir, path).replaceAll('\\', '/');
|
|
52
50
|
let write;
|
|
51
|
+
const removed = new Set();
|
|
53
52
|
function walk(node) {
|
|
54
53
|
if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression)
|
|
55
|
-
&&
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
&& node.expression.expression.getText(file) === 'sw.auth.server') {
|
|
55
|
+
const name = node.expression.name.text;
|
|
56
|
+
if (name === 'setRoles')
|
|
57
|
+
write ??= name;
|
|
58
|
+
if (name in REMOVED_ROLE_METHODS)
|
|
59
|
+
removed.add(name);
|
|
60
|
+
}
|
|
58
61
|
ts.forEachChild(node, walk);
|
|
59
62
|
}
|
|
60
63
|
walk(file);
|
|
64
|
+
for (const name of removed)
|
|
65
|
+
hints.push(`hint: ${rel}: sw.auth.server.${name} was removed; call sw.auth.server.setRoles(userId, { ${REMOVED_ROLE_METHODS[name]}: [role] }).`);
|
|
66
|
+
const methods = [...exports].filter(name => METHODS.has(name));
|
|
67
|
+
if (unknown || methods.length !== 1 || methods[0] !== 'GET')
|
|
68
|
+
continue;
|
|
61
69
|
if (write)
|
|
62
|
-
hints.push(`hint: ${
|
|
70
|
+
hints.push(`hint: ${rel}: ${write} is called in a GET-only route; use a POST setup handler once after sign-up/profile completion (cookie GET cannot change roles).`);
|
|
63
71
|
}
|
|
64
72
|
}
|
|
65
73
|
visitDir(api);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role-method-hints.js","sourceRoot":"","sources":["../../src/lib/role-method-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AACtF,MAAM,
|
|
1
|
+
{"version":3,"file":"role-method-hints.js","sourceRoot":"","sources":["../../src/lib/role-method-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,OAAO,G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tE,IAAI,KAAK;gBAAE,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,KAAK,kIAAkI,CAAC,CAAC;QAClL,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Fixed platform text for completion telemetry that deliberately stores codes only. */
|
|
2
|
-
export declare const ROLE_CHANGE_METHOD_MESSAGE = "Role changes require POST, PUT, PATCH or DELETE when signed in by cookie; move setRoles
|
|
2
|
+
export declare const ROLE_CHANGE_METHOD_MESSAGE = "Role changes require POST, PUT, PATCH or DELETE when signed in by cookie; move setRoles to a POST setup handler.";
|
|
3
3
|
export declare function runtimeRefusalMessage(code: string | null | undefined): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Fixed platform text for completion telemetry that deliberately stores codes only. */
|
|
2
|
-
export const ROLE_CHANGE_METHOD_MESSAGE = 'Role changes require POST, PUT, PATCH or DELETE when signed in by cookie; move setRoles
|
|
2
|
+
export const ROLE_CHANGE_METHOD_MESSAGE = 'Role changes require POST, PUT, PATCH or DELETE when signed in by cookie; move setRoles to a POST setup handler.';
|
|
3
3
|
export function runtimeRefusalMessage(code) {
|
|
4
4
|
return code === 'ROLE_CHANGE_METHOD_NOT_ALLOWED' ? ROLE_CHANGE_METHOD_MESSAGE : undefined;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-refusals.js","sourceRoot":"","sources":["../../src/lib/runtime-refusals.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,
|
|
1
|
+
{"version":3,"file":"runtime-refusals.js","sourceRoot":"","sources":["../../src/lib/runtime-refusals.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,kHAAkH,CAAC;AAC7J,MAAM,UAAU,qBAAqB,CAAC,IAA+B;IACnE,OAAO,IAAI,KAAK,gCAAgC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5F,CAAC"}
|
|
@@ -39,8 +39,11 @@ export default class TestReporter {
|
|
|
39
39
|
}
|
|
40
40
|
const report = { passed, failed, skipped, expectedFailures, setupDiagnostics: this.setupDiagnostics, notRun: Math.max(0, this.total - this.entries.length), setupErrors: this.errors, target: process.env.SW_TEST_ORIGIN, release: releases.size > 1 ? 'release changed during run' : [...releases][0] ?? 'release unavailable (no access map)', browser: process.env.SW_TEST_BROWSER, duration: result.duration, browserProbeMs: Number(process.env.SW_TEST_BROWSER_LAUNCH_MS), subset: process.env.SW_TEST_SUBSET === 'true', tests: this.entries };
|
|
41
41
|
writePrivateFile(process.env.SW_TEST_RESULTS, JSON.stringify(report) + '\n');
|
|
42
|
-
console.log(process.env.SW_TEST_JSON === 'true' ? JSON.stringify(report) : `${report.subset ? 'SUBSET (
|
|
43
|
-
|
|
42
|
+
console.log(process.env.SW_TEST_JSON === 'true' ? JSON.stringify(report) : `${report.subset ? 'SUBSET (last failures only): ' : 'FULL: '}${passed} passed, ${failed} failed, ${expectedFailures} expected failures, ${this.errors} setup errors, ${skipped} skipped, ${report.notRun} not run · ${report.target} · ${report.release} · ${report.browser} · ${(result.duration / 1000).toFixed(1)} s`);
|
|
43
|
+
const status = result.status === 'passed' && failed === 0 && this.errors === 0 && passed > 0 ? 'passed' : 'failed';
|
|
44
|
+
if (status === 'passed' && process.env.SW_TEST_JSON !== 'true')
|
|
45
|
+
console.log('The checks you wrote passed; say which requirements they do not cover.');
|
|
46
|
+
return { status };
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
//# sourceMappingURL=test-reporter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-reporter.js","sourceRoot":"","sources":["../../src/lib/test-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,E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
"": {
|
|
8
8
|
"name": "@somewhere-cloud/cli",
|
|
9
|
-
"version": "0.38.
|
|
9
|
+
"version": "0.38.77",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@modelcontextprotocol/sdk",
|
|
12
12
|
"chokidar",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@somewhere-cloud/cli",
|
|
3
|
-
"version": "0.38.
|
|
4
|
-
"description": "CLI for somewhere.cloud
|
|
3
|
+
"version": "0.38.77",
|
|
4
|
+
"description": "CLI for somewhere.cloud — auth, projects, deploy, pull, promote, db, logs, env, MCP bridge.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"somewhere",
|
|
7
7
|
"somewhere.cloud",
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"shared/d1-session.ts": "2ae29b74bba68016c86d25fa2a58f8c2fce4aca8fe57fafc253d380c47a3c0ab",
|
|
7
7
|
"shared/types/placeholder-identity.ts": "089a46e2474a21193d3611eddd9c94b6bbe62441b3039ed80fc8499bada447ca",
|
|
8
8
|
"worker/containers/compile/checker-contract.cjs": "c6d4ebc9ec058b3562655cc4f18dc1cea7e4492eb35b7f0fd0d87e974c26b492",
|
|
9
|
-
"worker/containers/compile/consumer-contract.cjs": "
|
|
9
|
+
"worker/containers/compile/consumer-contract.cjs": "686579acd07dd99d478c49b71887a780097870117d13f28bb05aa44d4e0e64a1",
|
|
10
10
|
"worker/containers/compile/declared-data-contract.cjs": "cd63f117c495d24a1346df95858f162ad09b3fea3654a6ad8cef8ec612482092",
|
|
11
11
|
"worker/containers/compile/generated-declarations-render.cjs": "7ffdb34645cc9eccac6eba39dc86b646a41c4de8a1a038d2b5b46f42df9f1157",
|
|
12
12
|
"worker/containers/compile/generated-declarations.cjs": "6e9902e054c5c784fd9b3c3fafc1869e79954100a45014e1132247cd82833ec4",
|
|
13
13
|
"worker/containers/compile/groups-types.cjs": "7c22b4bb96c9391005d434852600dc02bc8a6bbb99d78d2b8e3eb152f7b72c58",
|
|
14
|
-
"worker/containers/compile/runtime-types.cjs": "
|
|
14
|
+
"worker/containers/compile/runtime-types.cjs": "3852b7ef651dd91198e1710e114339fb03768dc6a89c9862a4714ca0ab3403eb",
|
|
15
15
|
"worker/containers/compile/schema-types.cjs": "aeb2debb8b5b14de780304ec305add32067a8e0ed693cdd29f8c79c8a3cc0928",
|
|
16
16
|
"worker/containers/compile/typed-data.cjs": "1c8bec853fbee4ffd34c651076a4e1f4d8b18c0c2be5e99e31df7c9283207627",
|
|
17
17
|
"worker/containers/compile/typed-files.cjs": "a0b1818afbc7673f84583c76436a3b3ca1d1fdf63d8d8db138b36646103f0708",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"worker/src/utils/telegram-attempt-receipts.ts": "a9ba55ae71f63ada44a105f1ceae04b0491bda0d6e77e5762db2dbecdd2981dd",
|
|
59
59
|
"worker/src/utils/telegram.ts": "dfbc9e756b44b445b3c3504c90a1094a94e6f9853ff9c0e0a84fba0e8c4518da"
|
|
60
60
|
},
|
|
61
|
-
"sha256": "
|
|
61
|
+
"sha256": "08dfcb2e2b99b386ce366692f2908cb4c57e7b1babfd2cb5cfb0c984fdc2a334"
|
|
62
62
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"source_files": {
|
|
4
4
|
"worker/containers/compile/function-route.cjs": "e7faf1104ba95e27921901b4619bd98aa6a2be47cc10af00097fd4957744606b",
|
|
5
5
|
"worker/node_modules/acorn/dist/acorn.mjs": "b4c8c70200e72bae33cf1085e0ecb1e792c1b6924ed50cab817caf14f51bb249",
|
|
6
|
-
"worker/src/security/browser-secret-scan.ts": "
|
|
6
|
+
"worker/src/security/browser-secret-scan.ts": "96e789beeae1dbf31c4669a4e662630f6a6dee291fead0016ac1d2a589f5ef1a",
|
|
7
7
|
"worker/src/services/jobs/limits.ts": "9ba371e4635a3b469cea721fb9eba20e69757d8a771d6ab181837f39b8280103",
|
|
8
8
|
"worker/src/services/source-lint-email.ts": "14fe435da59d10a6bbcbec62faceae00e60a4802ec8e18aedad38fd546a6dc94",
|
|
9
9
|
"worker/src/services/source-lint-ownership.ts": "baaf0edcc6fa72dee26c231ae87951758f313602a2f54d70afc89e0d36b35925",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"worker/src/utils/managed-groups/errors.ts": "18d952edd7f46bb7e459d4e6678226f4bd6e040ab40073ee5a8d0802be2f3721",
|
|
33
33
|
"worker/src/utils/managed-groups/policy.ts": "2c5b48479a2925bea9a820022c63ca5fa827e2ff5531fe1ab6c0b058b7212b39"
|
|
34
34
|
},
|
|
35
|
-
"sha256": "
|
|
35
|
+
"sha256": "2c4516e8564155f4ece1f1b111e6d79fafec2514276c0941386a165c7b556296",
|
|
36
36
|
"fixtures_sha256": "908827d1430f4af5a83cae59ed476abc51dc9648757eac0089fe6e6db95f66c5"
|
|
37
37
|
}
|
|
@@ -1522,8 +1522,6 @@ interface SomewhereServerRoleChanges { user_id: string; results: Array<{ user_id
|
|
|
1522
1522
|
interface SomewhereRuntimeAuthServer {
|
|
1523
1523
|
/** Deployed production functions only. Validate the caller before assigning roles. */
|
|
1524
1524
|
setRoles(userId: string, changes: { add?: readonly string[]; remove?: readonly string[] }): Promise<SomewhereServerRoleChanges>;
|
|
1525
|
-
grantRole(userId: string, role: string): Promise<SomewhereServerRoleChanges>;
|
|
1526
|
-
revokeRole(userId: string, role: string): Promise<SomewhereServerRoleChanges>;
|
|
1527
1525
|
listUsers(options?: { ids: readonly string[]; emails?: never; limit?: never; cursor?: never } | { emails: readonly string[]; ids?: never; limit?: never; cursor?: never } | { ids?: never; emails?: never; limit?: number; cursor?: string }): Promise<{ users: SomewhereAuthDirectoryUser[]; next_cursor: string | null }>;
|
|
1528
1526
|
}
|
|
1529
1527
|
interface SomewhereRuntimeAuthModeration {
|
|
@@ -4476,8 +4474,8 @@ var require_consumer_contract = __commonJS({
|
|
|
4476
4474
|
"worker/containers/compile/consumer-contract.cjs"(exports2, module2) {
|
|
4477
4475
|
"use strict";
|
|
4478
4476
|
var CONSUMER_CONTRACT2 = Object.freeze({
|
|
4479
|
-
version:
|
|
4480
|
-
digest: "
|
|
4477
|
+
version: 15,
|
|
4478
|
+
digest: "1e7d89a9beeb6a433b3e40769a236ea1f716918c257b49f3754d7d1c79d9f528"
|
|
4481
4479
|
});
|
|
4482
4480
|
var MEMBERSHIPS = "memberships: table({ id: id(), team_id: text(), member_id: text() }, { scope: owner(), client: { read: true } }),";
|
|
4483
4481
|
var SHARES = "shares: table({ id: id(), grantee_id: text() }, { scope: owner(), client: { read: true, create: ['grantee_id'], delete: true }, unique: [['user_id', 'grantee_id']] }),";
|
|
@@ -4587,7 +4585,6 @@ __export(declared_data_vendor_entry_exports, {
|
|
|
4587
4585
|
FILES_DECLARATION_FILE: () => import_typed_files2.CLIENT_FILE,
|
|
4588
4586
|
RUNTIME_CONTEXT_DECLARATION: () => import_runtime_types3.RUNTIME_CONTEXT_DECLARATION,
|
|
4589
4587
|
SCHEMA_DECLARATION: () => import_schema_types.SCHEMA_DECLARATION,
|
|
4590
|
-
allTablesServerOnlyWithoutClient: () => allTablesServerOnlyWithoutClient,
|
|
4591
4588
|
checkerContract: () => checkerContract,
|
|
4592
4589
|
consumerContractComponents: () => import_consumer_contract.consumerContractComponents,
|
|
4593
4590
|
consumerContractFingerprint: () => import_consumer_contract.consumerContractFingerprint,
|
|
@@ -8307,12 +8304,6 @@ function isRuntimeEndpointGlobal(diag, functions) {
|
|
|
8307
8304
|
|
|
8308
8305
|
|
|
8309
8306
|
var import_consumer_contract = __toESM(require_consumer_contract());
|
|
8310
|
-
function allTablesServerOnlyWithoutClient(files) {
|
|
8311
|
-
const source = files["db/schema.ts"];
|
|
8312
|
-
if (source === void 0) return false;
|
|
8313
|
-
const parsed = extractSchemaTs(source);
|
|
8314
|
-
return parsed.ok && parsed.declaration.tables.length > 0 && parsed.declaration.tables.every((table) => table.scope.kind === "server_only" && table.client === void 0);
|
|
8315
|
-
}
|
|
8316
8307
|
function generateFromFiles(files) {
|
|
8317
8308
|
const authority = clientAuthorityFromSource(files);
|
|
8318
8309
|
return authority ? (0, import_typed_data.generateDataClient)(authority) : void 0;
|
|
@@ -8338,7 +8329,6 @@ function filesDeclarationFromFiles(files) {
|
|
|
8338
8329
|
FILES_DECLARATION_FILE,
|
|
8339
8330
|
RUNTIME_CONTEXT_DECLARATION,
|
|
8340
8331
|
SCHEMA_DECLARATION,
|
|
8341
|
-
allTablesServerOnlyWithoutClient,
|
|
8342
8332
|
checkerContract,
|
|
8343
8333
|
consumerContractComponents,
|
|
8344
8334
|
consumerContractFingerprint,
|
package/runtime/source-lint.cjs
CHANGED
|
@@ -469,9 +469,14 @@ function resolveImport(fromPath, specifier, files) {
|
|
|
469
469
|
];
|
|
470
470
|
return candidates.find((candidate) => typeof files[candidate] === "string") ?? null;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function resolveConventionalAlias(specifier, files) {
|
|
473
|
+
const rest = /^[@~]\/(.+)$/.exec(specifier)?.[1];
|
|
474
|
+
if (!rest) return null;
|
|
475
|
+
return resolveImport("", `/src/${rest}`, files) ?? resolveImport("", `/${rest}`, files);
|
|
476
|
+
}
|
|
477
|
+
function browserReachableFiles(files, options = {}) {
|
|
473
478
|
const reachable = new Set();
|
|
474
|
-
const queue = [];
|
|
479
|
+
const queue = [...options.entries ?? []];
|
|
475
480
|
const htmlPaths = Object.keys(files).filter((path) => HTML_PATH.test(path));
|
|
476
481
|
for (const path of htmlPaths) {
|
|
477
482
|
reachable.add(path);
|
|
@@ -493,7 +498,7 @@ function browserReachableFiles(files) {
|
|
|
493
498
|
if (!path || reachable.has(path) || typeof files[path] !== "string") continue;
|
|
494
499
|
reachable.add(path);
|
|
495
500
|
for (const specifier of importSpecifiers(files[path])) {
|
|
496
|
-
const resolved = resolveImport(path, specifier, files);
|
|
501
|
+
const resolved = resolveImport(path, specifier, files) ?? (options.conventionalAliases ? resolveConventionalAlias(specifier, files) : null);
|
|
497
502
|
if (resolved && !reachable.has(resolved)) queue.push(resolved);
|
|
498
503
|
}
|
|
499
504
|
}
|