Skip to content

Regen JS client for Field Definition Admin endpoints (PRD 6.3.A)#49

Merged
bzajzon-laserfiche merged 5 commits into
mainfrom
bzajzon/field-definition-admin
May 29, 2026
Merged

Regen JS client for Field Definition Admin endpoints (PRD 6.3.A)#49
bzajzon-laserfiche merged 5 commits into
mainfrom
bzajzon/field-definition-admin

Conversation

@bzajzon-laserfiche
Copy link
Copy Markdown
Contributor

Summary

Regenerates @laserfiche/lf-repository-api-client-v2 to pick up the 9 new Field Definition Admin endpoints introduced by the server PR for PRD §6.3.A (REQ-ADMIN-001..004 + REQ-ADMIN-004B). Companion PR for site-api-repository (TFS), US #666940.

New surface on IFieldDefinitionsClient:

  • createFieldDefinition / updateFieldDefinition / deleteFieldDefinition
  • getFieldListValues / replaceFieldListValues
  • getFieldContainingTemplates / getFieldAssignedEntryCount
  • getFieldProperties / updateFieldProperties

Plus new DTOs:

  • CreateFieldDefinitionRequest / UpdateFieldDefinitionRequest
  • ReplaceListValuesRequest / ListValuesResponse
  • AssignedEntryCountResponse
  • FieldPropertiesResponse / UpdateFieldPropertiesRequest

Five additive writable flags on FieldDefinition: isIndexed, isIndexedForReporting, warnIfBlank, hideListValues, autoExtract.

Test plan

  • Build clean (npm run build)
  • TypeScript typecheck clean (tsc --noEmit -p tsconfig.json)
  • 8/8 vitest integration tests pass against a local server with the companion server PR's branch (FieldDefinitionAdmin.test.ts):
    • String lifecycle (Create/Update/Delete)
    • List field Replace round-trip (with independent GET re-reads)
    • GetContainingTemplates empty case
    • GetAssignedEntryCount zero case
    • Extended Properties Create/Get/Update round-trip
    • All 8 non-Blob FieldType enum values round-tripped
    • GET Properties on a fresh field documents LFS-internal entries (empirically 0 on dev-CA)
    • Server-side 400 validations surface with status: 400

Notes for reviewers

  • .env APISERVER_REPOSITORY_API_BASE_URL must have no trailing slash (per Trap 2 in .claude/skills/regen-js-client/SKILL.md); session-level discovery lf-cli-test-key1-style keys for the integration tests work fine.
  • Companion PRs:
    • site-api-repository TFS PR #171879
    • lf-repository-api-client-dotnet #202

Related: PRD notes/PRD - Repository REST API V2 Surface Expansion.md §6.3.A, TFS US #666940

Regenerates v2 client + swagger snapshot to pick up the 7 admin
endpoints introduced by site-api-repository PR for US #666940
(CreateFieldDefinition, UpdateFieldDefinition, DeleteFieldDefinition,
GetFieldListValues, ReplaceFieldListValues, GetFieldContainingTemplates,
GetFieldAssignedEntryCount) plus the 5 additive writable flags on
FieldDefinition (IsIndexed, IsIndexedForReporting, WarnIfBlank,
HideListValues, AutoExtract) and the new DTOs (CreateFieldDefinitionRequest,
UpdateFieldDefinitionRequest, ReplaceListValuesRequest, ListValuesResponse,
AssignedEntryCountResponse). Adds FieldDefinitionAdmin.test.ts mirroring
the dotnet integration tests: CRUD lifecycle, list-values round-trip,
GetContainingTemplates empty, GetAssignedEntryCount zero.
Codex pre-PR review flagged that the test asserted only on the PUT
response body. Same-request reads can mask a missing Save() on the
server's RA SetItemList path (Trap 4 in the add-v2-endpoint skill).
Adds a fresh getFieldListValues call after each replaceFieldListValues,
mirroring the dotnet client-side change.
…rties

Picks up the 2 new admin endpoints on the server (PRD 6.3.A
REQ-ADMIN-004B): getFieldProperties / updateFieldProperties on
IFieldDefinitionsClient, plus the new optional properties field on
CreateFieldDefinitionRequest. The bag holds the WebDAV keys the
Cloud admin UI uses for list-field sort/add-blank/add-Other/display-as.

Adds "Extended properties — create / get / update round-trip" integration
test: create with initial properties, getFieldProperties to verify,
updateFieldProperties { set, remove }, independent getFieldProperties
to confirm the partial update persisted.

5/5 vitest cases pass against the local server.
…trip

Mirrors the three dotnet coverage tests added during pre-PR review:

- All FieldTypes — create / describe / update round-trip: iterates
  over all 8 non-Blob FieldType enum values; per-type create with
  appropriate flags, independent GET, PATCH description, verify.
- GetFieldProperties — fresh field documents LFS-internal entries:
  surfaces what GetFieldProperties returns for a field with no
  caller-set properties. dev-CA returned 0 entries — closes Codex
  round-3 finding #4 with empirical evidence.
- Validation — round-trips as 400 problemDetails: server-side
  validations (length<1, listValues on non-list, properties empty
  key, duplicate set+remove) surface as rejections with status 400
  through the JS client.

8/8 vitest cases pass against the local server.
Comment thread packages/lf-repository-api-client-v2/generate-client/swagger.json Outdated
Comment thread packages/lf-repository-api-client-v2/index.ts Outdated
The 6.3.A regen was run against the local dev server, baking
http://localhost:11211/repository into the committed swagger `servers`
and every generated client's default baseUrl. Restore the production
URL https://api.laserfiche.com/repository to match origin/main and
prior releases.

Context: the dotnet client bakes no URL at all (baseUrl is factory-
supplied at runtime); the JS NSwag generator derives the constructor
default from swagger.servers[0], so the regen source environment leaked
into the published artifact. API surface is unchanged — only the
fallback baseUrl string and the swagger `servers` entry.

Addresses review comments on #49 (swagger.json servers, index.ts baseUrl).
@bzajzon-laserfiche bzajzon-laserfiche merged commit 1fa1130 into main May 29, 2026
10 checks passed
bzajzon-laserfiche added a commit that referenced this pull request May 30, 2026
…onsolidated)

Single regen off the deployed swagger bringing the JS client up to the full V2
surface, superseding the conflicting per-batch client PRs. 6.3.A (#49) already on main.

Surface added since main:
- Field Definition destructive ops (MergeFields, ChangeFieldType) — PRD 6.3.B
- Template Definition admin (CRUD + Properties + Field management) — PRD 6.3.C
- Entry introspection on GET Entry: opt-in includeChildInfo (flat childInfo object
  { hasChildren, childCount, folderCount, documentCount, shortcutCount }) +
  includeTotalSize — REQ-DOC-002

Committed swagger.json + index.ts normalized to production URLs (api.laserfiche.com /
signin.laserfiche.com). Integration tests for 6.3.B/6.3.C/REQ-DOC-002 brought onto this
branch; the childInfo test asserts the flat single-object shape. Entry discriminator
override applied (Trap 1); multipart tests stay SKIP_UNDER_JSDOM-gated (Trap 3).
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.

2 participants