Skip to content

Commit 21aea1a

Browse files
committed
test(rest): pin the import template's column rule, workbook and route, and the export's pre-change bytes
Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 31c87c7 commit 21aea1a

6 files changed

Lines changed: 987 additions & 5 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
'@objectstack/rest': minor
3+
---
4+
5+
feat(rest): `GET /api/v1/data/:object/export?template=true` answers an xlsx import template for the object (#18386)
6+
7+
Clause-②: yes (widening)
8+
9+
The export door takes one more query parameter, `template`. `template=true`
10+
answers an `.xlsx` workbook with no data rows; `template=false`, or no
11+
`template` parameter, answers the export exactly as before, byte for byte.
12+
13+
- **Columns.** The fields an import stores: every field of the object except
14+
those marked `system`, `hidden` or `readonly`, and `formula`, `summary` and
15+
`autonumber` fields, in the order the object declares them. The seven columns
16+
the platform adds to every object (`organization_id`, `created_at`,
17+
`created_by`, `updated_at`, `updated_by`, `owner_id`,
18+
`owning_business_unit_id`) are never template columns. A field the caller's
19+
field-level security does not let them read is left out. An explicit
20+
`?fields=` list is used as sent.
21+
- **First sheet.** The header row, with ` *` after each field that is required
22+
and has no default value, and one example row to replace or delete. Select,
23+
radio and boolean columns carry a dropdown.
24+
- **Second sheet.** One row per column: the field's API name, its type, whether
25+
it is required, and the values the import accepts for it.
26+
- **Language.** The sheets are in Chinese for a `zh` request locale
27+
(`?locale=` or `Accept-Language`) and in English otherwise.
28+
29+
The same two permission checks as the export apply: an object that does not
30+
expose export answers `405`, and a caller without the export permission answers
31+
`403`. `template` with a value other than `true` or `false`, a `format` other
32+
than `xlsx`, or any of `limit`, `page`, `filter`, `search`, `searchFields`,
33+
`orderby` or `header` beside `template=true`, answers `400 VALIDATION_ERROR`.

0 commit comments

Comments
 (0)