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

describe('public surface', () => {
  it('exports the documented symbols', () => {
    for (const name of [
      'defineFieldGroup', 'resolveGroups', 'typedValues',
      'getEntityValues', 'setEntityValues', 'deleteEntityValues',
      'createGroup', 'updateGroup', 'deleteGroup', 'listGroups',
      'queryEntities', 'validateValues',
      'assertCanEditFields', 'assertCanManageGroups',
      'fieldsMigrationSql', 'fieldValues', 'fieldGroups', 'fieldsSchema',
      'FieldValidationError', 'FieldGroupConflictError', 'FieldAuthorizationError', 'FieldStoreError',
      'isFieldValidationError', 'isFieldGroupConflictError', 'isFieldAuthorizationError', 'isFieldStoreError',
      'FIELD_TYPES', 'isMultipleCapable',
    ]) expect(api).toHaveProperty(name)
  })
})
