import { describe, expect, it } from 'vitest'
import * as content from './index.js'

describe('@platform-modules/content public barrel', () => {
  it('exports the full read+write contract + types + errors + schema', () => {
    for (const name of [
      'list',
      'getBySlug',
      'getById',
      'put',
      'publish',
      'schedule',
      'promoteScheduled',
      'unpublish',
      'trash',
      'restore',
      'remove',
      'setVisibility',
      'contentVisibilityMigrationSql',
      'createContentSearchProvider',
      'contentSearchMigrationSql',
      'normalizeContentInput',
      'assertCanModify',
      'assertCanPublish',
      'ContentValidationError',
      'ContentNotFoundError',
      'ContentConflictError',
      'ContentAuthzError',
      'contentEntries',
      'contentSchema',
    ]) {
      expect(content, `missing export: ${name}`).toHaveProperty(name)
    }
  })

  it('does NOT re-export the feed projection from the core barrel (it is a ./feed subpath)', () => {
    expect(content).not.toHaveProperty('toFeed')
  })
})
