Skip to content

Conversation

@borisno2
Copy link
Member

@borisno2 borisno2 commented Dec 26, 2025

Summary

Add support for access control function shorthand in list configurations. Users can now use a single function that applies to all operations instead of the verbose object form.

Changes

New Types

  • ListAccessControl<T> - Union type accepting either a function or operation object
  • ListConfigInput<TTypeInfo> - Input type for list() function with flexible access control

Runtime

  • list() function normalizes access shorthand to operation object form at runtime
  • Backwards compatible - existing object form still works

Usage Example

// Instead of this:
Post: list({
  fields: { title: text() },
  access: {
    operation: {
      query: isAuthenticated,
      create: isAuthenticated,
      update: isAuthenticated,
      delete: isAuthenticated,
    },
  },
})

// You can now write:
Post: list({
  fields: { title: text() },
  access: isAuthenticated,
})

Test plan

  • All existing tests pass (396 tests)
  • Added test for access control shorthand normalization
  • Build passes
  • Lint passes

Fixes #285

🤖 Generated with Claude Code

@changeset-bot
Copy link

changeset-bot bot commented Dec 26, 2025

🦋 Changeset detected

Latest commit: 8e31de1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@opensaas/stack-core Minor
@opensaas/stack-auth Minor
@opensaas/stack-cli Minor
@opensaas/stack-rag Minor
@opensaas/stack-storage Minor
@opensaas/stack-tiptap Minor
@opensaas/stack-ui Minor
@opensaas/stack-storage-s3 Minor
@opensaas/stack-storage-vercel Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
stack-docs Ready Ready Preview, Comment Dec 26, 2025 4:14am

- Add `ListAccessControl<T>` type - union accepting function or object form
- Add `ListConfigInput<TTypeInfo>` type - input type for `list()` with flexible access
- `list()` function normalizes access shorthand to operation object form
- Export new types: ListConfigInput, ListAccessControl

Fixes #285

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@borisno2 borisno2 force-pushed the fix/list-config-types-285-288 branch from dfb592e to b3358b5 Compare December 26, 2025 04:04
@borisno2 borisno2 changed the title Add isSingleton, graphql config, and access control shorthand to ListConfig Add access control function shorthand to ListConfig Dec 26, 2025
@borisno2 borisno2 enabled auto-merge (squash) December 26, 2025 04:17
@borisno2 borisno2 merged commit ed25cc5 into main Dec 26, 2025
6 checks passed
@github-actions
Copy link
Contributor

Coverage Report for Core Package Coverage (./packages/core)

Status Category Percentage Covered / Total
🔵 Lines 86.97% 454 / 522
🔵 Statements 86.21% 463 / 537
🔵 Functions 98.61% 71 / 72
🔵 Branches 75.56% 334 / 442
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for UI Package Coverage (./packages/ui)

Status Category Percentage Covered / Total
🔵 Lines 76.03% 92 / 121
🔵 Statements 75.39% 95 / 126
🔵 Functions 75.6% 31 / 41
🔵 Branches 65.78% 75 / 114
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for CLI Package Coverage (./packages/cli)

Status Category Percentage Covered / Total
🔵 Lines 74.14% 872 / 1176
🔵 Statements 73.51% 902 / 1227
🔵 Functions 81.29% 113 / 139
🔵 Branches 62.5% 385 / 616
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Auth Package Coverage (./packages/auth)

Status Category Percentage Covered / Total
🔵 Lines 64.49% 89 / 138
🔵 Statements 61.03% 94 / 154
🔵 Functions 74.46% 35 / 47
🔵 Branches 62.79% 54 / 86
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Storage Package Coverage (./packages/storage)

Status Category Percentage Covered / Total
🔵 Lines 42.94% 73 / 170
🔵 Statements 43.27% 74 / 171
🔵 Functions 45.45% 15 / 33
🔵 Branches 40.13% 61 / 152
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for RAG Package Coverage (./packages/rag)

Status Category Percentage Covered / Total
🔵 Lines 47.97% 355 / 740
🔵 Statements 48.14% 377 / 783
🔵 Functions 54.26% 70 / 129
🔵 Branches 42.55% 180 / 423
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)

Status Category Percentage Covered / Total
🔵 Lines 100% 40 / 40
🔵 Statements 100% 40 / 40
🔵 Functions 100% 9 / 9
🔵 Branches 100% 19 / 19
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)

Status Category Percentage Covered / Total
🔵 Lines 100% 38 / 38
🔵 Statements 100% 38 / 38
🔵 Functions 100% 8 / 8
🔵 Branches 100% 22 / 22
File CoverageNo changed files found.
Generated in workflow #796 for commit 8e31de1 by the Vitest Coverage Report Action

@github-actions github-actions bot mentioned this pull request Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List-level access control shorthand not supported in types

2 participants