@terminalfour/terminalfour-js 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/LICENSE.md +106 -0
  2. package/README.md +169 -0
  3. package/dist/cjs/element-resolver.d.ts +115 -0
  4. package/dist/cjs/element-resolver.d.ts.map +1 -0
  5. package/dist/cjs/element-resolver.js +391 -0
  6. package/dist/cjs/element-resolver.js.map +1 -0
  7. package/dist/cjs/errors.d.ts +21 -0
  8. package/dist/cjs/errors.d.ts.map +1 -0
  9. package/dist/cjs/errors.js +21 -0
  10. package/dist/cjs/errors.js.map +1 -0
  11. package/dist/cjs/handlebars.d.ts +123 -0
  12. package/dist/cjs/handlebars.d.ts.map +1 -0
  13. package/dist/cjs/handlebars.js +306 -0
  14. package/dist/cjs/handlebars.js.map +1 -0
  15. package/dist/cjs/http-client.d.ts +21 -0
  16. package/dist/cjs/http-client.d.ts.map +1 -0
  17. package/dist/cjs/http-client.js +126 -0
  18. package/dist/cjs/http-client.js.map +1 -0
  19. package/dist/cjs/index.d.ts +37 -0
  20. package/dist/cjs/index.d.ts.map +1 -0
  21. package/dist/cjs/index.js +55 -0
  22. package/dist/cjs/index.js.map +1 -0
  23. package/dist/cjs/media-category-ref.d.ts +78 -0
  24. package/dist/cjs/media-category-ref.d.ts.map +1 -0
  25. package/dist/cjs/media-category-ref.js +184 -0
  26. package/dist/cjs/media-category-ref.js.map +1 -0
  27. package/dist/cjs/media-library.d.ts +30 -0
  28. package/dist/cjs/media-library.d.ts.map +1 -0
  29. package/dist/cjs/media-library.js +77 -0
  30. package/dist/cjs/media-library.js.map +1 -0
  31. package/dist/cjs/models/content-item.d.ts +80 -0
  32. package/dist/cjs/models/content-item.d.ts.map +1 -0
  33. package/dist/cjs/models/content-item.js +682 -0
  34. package/dist/cjs/models/content-item.js.map +1 -0
  35. package/dist/cjs/models/media-category-item.d.ts +29 -0
  36. package/dist/cjs/models/media-category-item.d.ts.map +1 -0
  37. package/dist/cjs/models/media-category-item.js +33 -0
  38. package/dist/cjs/models/media-category-item.js.map +1 -0
  39. package/dist/cjs/models/media-item.d.ts +74 -0
  40. package/dist/cjs/models/media-item.d.ts.map +1 -0
  41. package/dist/cjs/models/media-item.js +188 -0
  42. package/dist/cjs/models/media-item.js.map +1 -0
  43. package/dist/cjs/models/section-item.d.ts +58 -0
  44. package/dist/cjs/models/section-item.d.ts.map +1 -0
  45. package/dist/cjs/models/section-item.js +166 -0
  46. package/dist/cjs/models/section-item.js.map +1 -0
  47. package/dist/cjs/package.json +1 -0
  48. package/dist/cjs/resources/channel-resource.d.ts +112 -0
  49. package/dist/cjs/resources/channel-resource.d.ts.map +1 -0
  50. package/dist/cjs/resources/channel-resource.js +107 -0
  51. package/dist/cjs/resources/channel-resource.js.map +1 -0
  52. package/dist/cjs/resources/content-resource.d.ts +50 -0
  53. package/dist/cjs/resources/content-resource.d.ts.map +1 -0
  54. package/dist/cjs/resources/content-resource.js +286 -0
  55. package/dist/cjs/resources/content-resource.js.map +1 -0
  56. package/dist/cjs/resources/content-type-resource.d.ts +283 -0
  57. package/dist/cjs/resources/content-type-resource.d.ts.map +1 -0
  58. package/dist/cjs/resources/content-type-resource.js +970 -0
  59. package/dist/cjs/resources/content-type-resource.js.map +1 -0
  60. package/dist/cjs/resources/group-resource.d.ts +96 -0
  61. package/dist/cjs/resources/group-resource.d.ts.map +1 -0
  62. package/dist/cjs/resources/group-resource.js +213 -0
  63. package/dist/cjs/resources/group-resource.js.map +1 -0
  64. package/dist/cjs/resources/list-resource.d.ts +111 -0
  65. package/dist/cjs/resources/list-resource.d.ts.map +1 -0
  66. package/dist/cjs/resources/list-resource.js +179 -0
  67. package/dist/cjs/resources/list-resource.js.map +1 -0
  68. package/dist/cjs/resources/media-resource.d.ts +69 -0
  69. package/dist/cjs/resources/media-resource.d.ts.map +1 -0
  70. package/dist/cjs/resources/media-resource.js +210 -0
  71. package/dist/cjs/resources/media-resource.js.map +1 -0
  72. package/dist/cjs/resources/media-type-resource.d.ts +70 -0
  73. package/dist/cjs/resources/media-type-resource.d.ts.map +1 -0
  74. package/dist/cjs/resources/media-type-resource.js +195 -0
  75. package/dist/cjs/resources/media-type-resource.js.map +1 -0
  76. package/dist/cjs/resources/navigation-resource.d.ts +664 -0
  77. package/dist/cjs/resources/navigation-resource.d.ts.map +1 -0
  78. package/dist/cjs/resources/navigation-resource.js +2349 -0
  79. package/dist/cjs/resources/navigation-resource.js.map +1 -0
  80. package/dist/cjs/resources/page-layout-resource.d.ts +83 -0
  81. package/dist/cjs/resources/page-layout-resource.d.ts.map +1 -0
  82. package/dist/cjs/resources/page-layout-resource.js +214 -0
  83. package/dist/cjs/resources/page-layout-resource.js.map +1 -0
  84. package/dist/cjs/resources/user-resource.d.ts +126 -0
  85. package/dist/cjs/resources/user-resource.d.ts.map +1 -0
  86. package/dist/cjs/resources/user-resource.js +317 -0
  87. package/dist/cjs/resources/user-resource.js.map +1 -0
  88. package/dist/cjs/section-ref.d.ts +185 -0
  89. package/dist/cjs/section-ref.d.ts.map +1 -0
  90. package/dist/cjs/section-ref.js +813 -0
  91. package/dist/cjs/section-ref.js.map +1 -0
  92. package/dist/cjs/site-structure.d.ts +18 -0
  93. package/dist/cjs/site-structure.d.ts.map +1 -0
  94. package/dist/cjs/site-structure.js +57 -0
  95. package/dist/cjs/site-structure.js.map +1 -0
  96. package/dist/cjs/t4-client.d.ts +121 -0
  97. package/dist/cjs/t4-client.d.ts.map +1 -0
  98. package/dist/cjs/t4-client.js +190 -0
  99. package/dist/cjs/t4-client.js.map +1 -0
  100. package/dist/cjs/type-registry.d.ts +31 -0
  101. package/dist/cjs/type-registry.d.ts.map +1 -0
  102. package/dist/cjs/type-registry.js +76 -0
  103. package/dist/cjs/type-registry.js.map +1 -0
  104. package/dist/cjs/types.d.ts +211 -0
  105. package/dist/cjs/types.d.ts.map +1 -0
  106. package/dist/cjs/types.js +3 -0
  107. package/dist/cjs/types.js.map +1 -0
  108. package/dist/cjs/utils.d.ts +147 -0
  109. package/dist/cjs/utils.d.ts.map +1 -0
  110. package/dist/cjs/utils.js +408 -0
  111. package/dist/cjs/utils.js.map +1 -0
  112. package/dist/esm/element-resolver.d.ts +115 -0
  113. package/dist/esm/element-resolver.d.ts.map +1 -0
  114. package/dist/esm/element-resolver.js +387 -0
  115. package/dist/esm/element-resolver.js.map +1 -0
  116. package/dist/esm/errors.d.ts +21 -0
  117. package/dist/esm/errors.d.ts.map +1 -0
  118. package/dist/esm/errors.js +17 -0
  119. package/dist/esm/errors.js.map +1 -0
  120. package/dist/esm/handlebars.d.ts +123 -0
  121. package/dist/esm/handlebars.d.ts.map +1 -0
  122. package/dist/esm/handlebars.js +300 -0
  123. package/dist/esm/handlebars.js.map +1 -0
  124. package/dist/esm/http-client.d.ts +21 -0
  125. package/dist/esm/http-client.d.ts.map +1 -0
  126. package/dist/esm/http-client.js +122 -0
  127. package/dist/esm/http-client.js.map +1 -0
  128. package/dist/esm/index.d.ts +37 -0
  129. package/dist/esm/index.d.ts.map +1 -0
  130. package/dist/esm/index.js +26 -0
  131. package/dist/esm/index.js.map +1 -0
  132. package/dist/esm/media-category-ref.d.ts +78 -0
  133. package/dist/esm/media-category-ref.d.ts.map +1 -0
  134. package/dist/esm/media-category-ref.js +180 -0
  135. package/dist/esm/media-category-ref.js.map +1 -0
  136. package/dist/esm/media-library.d.ts +30 -0
  137. package/dist/esm/media-library.d.ts.map +1 -0
  138. package/dist/esm/media-library.js +73 -0
  139. package/dist/esm/media-library.js.map +1 -0
  140. package/dist/esm/models/content-item.d.ts +80 -0
  141. package/dist/esm/models/content-item.d.ts.map +1 -0
  142. package/dist/esm/models/content-item.js +676 -0
  143. package/dist/esm/models/content-item.js.map +1 -0
  144. package/dist/esm/models/media-category-item.d.ts +29 -0
  145. package/dist/esm/models/media-category-item.d.ts.map +1 -0
  146. package/dist/esm/models/media-category-item.js +29 -0
  147. package/dist/esm/models/media-category-item.js.map +1 -0
  148. package/dist/esm/models/media-item.d.ts +74 -0
  149. package/dist/esm/models/media-item.d.ts.map +1 -0
  150. package/dist/esm/models/media-item.js +184 -0
  151. package/dist/esm/models/media-item.js.map +1 -0
  152. package/dist/esm/models/section-item.d.ts +58 -0
  153. package/dist/esm/models/section-item.d.ts.map +1 -0
  154. package/dist/esm/models/section-item.js +162 -0
  155. package/dist/esm/models/section-item.js.map +1 -0
  156. package/dist/esm/resources/channel-resource.d.ts +112 -0
  157. package/dist/esm/resources/channel-resource.d.ts.map +1 -0
  158. package/dist/esm/resources/channel-resource.js +102 -0
  159. package/dist/esm/resources/channel-resource.js.map +1 -0
  160. package/dist/esm/resources/content-resource.d.ts +50 -0
  161. package/dist/esm/resources/content-resource.d.ts.map +1 -0
  162. package/dist/esm/resources/content-resource.js +282 -0
  163. package/dist/esm/resources/content-resource.js.map +1 -0
  164. package/dist/esm/resources/content-type-resource.d.ts +283 -0
  165. package/dist/esm/resources/content-type-resource.d.ts.map +1 -0
  166. package/dist/esm/resources/content-type-resource.js +964 -0
  167. package/dist/esm/resources/content-type-resource.js.map +1 -0
  168. package/dist/esm/resources/group-resource.d.ts +96 -0
  169. package/dist/esm/resources/group-resource.d.ts.map +1 -0
  170. package/dist/esm/resources/group-resource.js +208 -0
  171. package/dist/esm/resources/group-resource.js.map +1 -0
  172. package/dist/esm/resources/list-resource.d.ts +111 -0
  173. package/dist/esm/resources/list-resource.d.ts.map +1 -0
  174. package/dist/esm/resources/list-resource.js +174 -0
  175. package/dist/esm/resources/list-resource.js.map +1 -0
  176. package/dist/esm/resources/media-resource.d.ts +69 -0
  177. package/dist/esm/resources/media-resource.d.ts.map +1 -0
  178. package/dist/esm/resources/media-resource.js +206 -0
  179. package/dist/esm/resources/media-resource.js.map +1 -0
  180. package/dist/esm/resources/media-type-resource.d.ts +70 -0
  181. package/dist/esm/resources/media-type-resource.d.ts.map +1 -0
  182. package/dist/esm/resources/media-type-resource.js +190 -0
  183. package/dist/esm/resources/media-type-resource.js.map +1 -0
  184. package/dist/esm/resources/navigation-resource.d.ts +664 -0
  185. package/dist/esm/resources/navigation-resource.d.ts.map +1 -0
  186. package/dist/esm/resources/navigation-resource.js +2344 -0
  187. package/dist/esm/resources/navigation-resource.js.map +1 -0
  188. package/dist/esm/resources/page-layout-resource.d.ts +83 -0
  189. package/dist/esm/resources/page-layout-resource.d.ts.map +1 -0
  190. package/dist/esm/resources/page-layout-resource.js +209 -0
  191. package/dist/esm/resources/page-layout-resource.js.map +1 -0
  192. package/dist/esm/resources/user-resource.d.ts +126 -0
  193. package/dist/esm/resources/user-resource.d.ts.map +1 -0
  194. package/dist/esm/resources/user-resource.js +312 -0
  195. package/dist/esm/resources/user-resource.js.map +1 -0
  196. package/dist/esm/section-ref.d.ts +185 -0
  197. package/dist/esm/section-ref.d.ts.map +1 -0
  198. package/dist/esm/section-ref.js +808 -0
  199. package/dist/esm/section-ref.js.map +1 -0
  200. package/dist/esm/site-structure.d.ts +18 -0
  201. package/dist/esm/site-structure.d.ts.map +1 -0
  202. package/dist/esm/site-structure.js +53 -0
  203. package/dist/esm/site-structure.js.map +1 -0
  204. package/dist/esm/t4-client.d.ts +121 -0
  205. package/dist/esm/t4-client.d.ts.map +1 -0
  206. package/dist/esm/t4-client.js +186 -0
  207. package/dist/esm/t4-client.js.map +1 -0
  208. package/dist/esm/type-registry.d.ts +31 -0
  209. package/dist/esm/type-registry.d.ts.map +1 -0
  210. package/dist/esm/type-registry.js +72 -0
  211. package/dist/esm/type-registry.js.map +1 -0
  212. package/dist/esm/types.d.ts +211 -0
  213. package/dist/esm/types.d.ts.map +1 -0
  214. package/dist/esm/types.js +2 -0
  215. package/dist/esm/types.js.map +1 -0
  216. package/dist/esm/utils.d.ts +147 -0
  217. package/dist/esm/utils.d.ts.map +1 -0
  218. package/dist/esm/utils.js +355 -0
  219. package/dist/esm/utils.js.map +1 -0
  220. package/docs/channels.md +62 -0
  221. package/docs/content-types.md +313 -0
  222. package/docs/content.md +199 -0
  223. package/docs/error-handling.md +86 -0
  224. package/docs/getting-started.md +146 -0
  225. package/docs/groups-and-users.md +167 -0
  226. package/docs/handlebars.md +145 -0
  227. package/docs/lists.md +98 -0
  228. package/docs/media-types.md +111 -0
  229. package/docs/media.md +169 -0
  230. package/docs/navigation/a-to-z.md +62 -0
  231. package/docs/navigation/breadcrumbs.md +67 -0
  232. package/docs/navigation/css-selector.md +53 -0
  233. package/docs/navigation/generate-file.md +48 -0
  234. package/docs/navigation/keyword-search.md +134 -0
  235. package/docs/navigation/language-switcher.md +37 -0
  236. package/docs/navigation/link-menu.md +105 -0
  237. package/docs/navigation/pagination.md +80 -0
  238. package/docs/navigation/previous-next-fulltext.md +43 -0
  239. package/docs/navigation/publish-to-one-file.md +93 -0
  240. package/docs/navigation/related-content.md +79 -0
  241. package/docs/navigation/related-section-branch.md +31 -0
  242. package/docs/navigation/return-to-index.md +35 -0
  243. package/docs/navigation/section-details.md +51 -0
  244. package/docs/navigation/section-iterator.md +33 -0
  245. package/docs/navigation/section-meta-info.md +39 -0
  246. package/docs/navigation/site-map.md +58 -0
  247. package/docs/navigation/top-content.md +80 -0
  248. package/docs/navigation/top-stories.md +47 -0
  249. package/docs/navigation.md +134 -0
  250. package/docs/page-layouts.md +71 -0
  251. package/docs/sections.md +224 -0
  252. package/docs/typescript.md +124 -0
  253. package/package.json +64 -0
@@ -0,0 +1,80 @@
1
+ # Pagination
2
+
3
+ Fetch content from a branch or section and split it across pages with navigation links.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/pagination-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'pagination',
12
+ name: 'Article Pagination',
13
+ properties: {
14
+ contentTypeId: 67,
15
+ fetchMethod: 'branch',
16
+ section: 233,
17
+ numToRecurse: 3,
18
+ contentItemsPerPage: 10,
19
+ maxContentItems: 100,
20
+ maxLinksPerPage: 5,
21
+ altLayoutName: 'text/json',
22
+ searchHiddenSections: true,
23
+ beforeHtml: '<nav>',
24
+ afterHtml: '</nav>',
25
+ beforePaginationHtml: '<ul>',
26
+ afterPaginationHtml: '</ul>',
27
+ betweenPaginationHtml: ' | ',
28
+ },
29
+ });
30
+ ```
31
+
32
+ ## Fetch method summary
33
+
34
+ | `fetchMethod` | `section` | `level` | `numToRecurse` |
35
+ |---|---|---|---|
36
+ | `'current'` | The SDK sets it to `0`. | The SDK sets it to `0`. | The SDK sets it to `0`. |
37
+ | `'current-branch'` | The SDK sets it to `0`. | The SDK sets it to `0`. | You can set it. |
38
+ | `'branch'` | Required and validated. | The SDK sets it to `0`. | You can set it. |
39
+ | `'branch-at-level'` | Required and validated. | You can set it. | You can set it. |
40
+ | `'section'` | Required and validated. | The SDK sets it to `0`. | The SDK sets it to `0`. |
41
+
42
+ ## Properties
43
+
44
+ ### Fetch scope
45
+
46
+ | Property | Type | Default | Description |
47
+ |---|---|---|---|
48
+ | `contentTypeId` | `number` | *required* | Content Type ID to paginate. |
49
+ | `fetchMethod` | `string` | `'current'` | Fetch scope: `'current'`, `'current-branch'`, `'branch'`, `'branch-at-level'`, or `'section'`. |
50
+ | `section` | `number` | `n/a` | Section ID for `'branch'`, `'branch-at-level'`, or `'section'`. |
51
+ | `level` | `number` | `0` | Level for `'branch-at-level'`. |
52
+ | `numToRecurse` | `number` | `0` | Recursion depth for `'current-branch'`, `'branch'`, or `'branch-at-level'`. |
53
+ | `searchHiddenSections` | `boolean` | `false` | Includes hidden sections in the search. |
54
+
55
+ ### Pagination and layout
56
+
57
+ | Property | Type | Default | Description |
58
+ |---|---|---|---|
59
+ | `contentItemsPerPage` | `number` | `0` | Items per page. `0` disables pagination. |
60
+ | `maxContentItems` | `number` | `0` | Maximum total items. `0` sets no limit. |
61
+ | `maxLinksPerPage` | `number` | `0` | Maximum pagination links. `0` shows all links. |
62
+ | `altLayoutName` | `string` | `''` | Alternative content layout name. |
63
+
64
+ ### Output HTML
65
+
66
+ | Property | Type | Default | Description |
67
+ |---|---|---|---|
68
+ | `beforeHtml` | `string` | `''` | HTML before content. |
69
+ | `afterHtml` | `string` | `''` | HTML after content. |
70
+ | `beforePaginationHtml` | `string` | `''` | HTML before pagination links. |
71
+ | `afterPaginationHtml` | `string` | `''` | HTML after pagination links. |
72
+ | `betweenPaginationHtml` | `string` | `''` | HTML between pagination links. |
73
+
74
+ ## Validation
75
+
76
+ - `contentTypeId` is required and validated.
77
+ - When provided, `altLayoutName` is validated against the content type's layouts.
78
+ - The SDK validates `section` when the selected fetch method requires it.
79
+
80
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,43 @@
1
+ # Previous/Next Fulltext Content
2
+
3
+ Link sequential fulltext content items within a section.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/previousnext-fulltext-content-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'previous-next-fulltext',
12
+ name: 'Article Nav',
13
+ properties: {
14
+ type: 'both',
15
+ altLayoutName: 'text/nav',
16
+ skipNonFulltextContent: true,
17
+ onlyLinkToContentWithNav: false,
18
+ sameContentTypeRestriction: true,
19
+ displayOnBoundary: false,
20
+ displayContentNameAsTitle: true,
21
+ previousHtml: '&laquo; Previous',
22
+ betweenHtml: ' | ',
23
+ nextHtml: 'Next &raquo;',
24
+ },
25
+ });
26
+ ```
27
+
28
+ ## Properties
29
+
30
+ | Property | Type | Default | Description |
31
+ |---|---|---|---|
32
+ | `type` | `string` | `'previous'` | Link direction: `'previous'`, `'next'`, or `'both'`. |
33
+ | `altLayoutName` | `string` | `''` | Alternative content layout name. |
34
+ | `skipNonFulltextContent` | `boolean` | `false` | Skips content without fulltext. |
35
+ | `onlyLinkToContentWithNav` | `boolean` | `false` | Links only to content that also has previous/next navigation. |
36
+ | `sameContentTypeRestriction` | `boolean` | `false` | Restricts links to the same content type. |
37
+ | `displayOnBoundary` | `boolean` | `false` | Displays links at the first and last boundaries. |
38
+ | `displayContentNameAsTitle` | `boolean` | `false` | Uses the content name as the link title. |
39
+ | `previousHtml` | `string` | `''` | HTML for the previous link. |
40
+ | `betweenHtml` | `string` | `''` | HTML between links. |
41
+ | `nextHtml` | `string` | `''` | HTML for the next link. |
42
+
43
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,93 @@
1
+ # Publish to One File
2
+
3
+ Draw all content below a section, including content from child sections, into one page.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/publish-to-one-file-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'publish-to-one-file',
12
+ name: 'All Content',
13
+ properties: {
14
+ contentTypeId: 38,
15
+ startSection: 'specific',
16
+ section: 7725,
17
+ showHiddenSections: true,
18
+ levelsToRecurse: 10,
19
+ beforeHtml: '<div>',
20
+ afterHtml: '</div>',
21
+ showSectionName: true,
22
+ showNameForHidden: true,
23
+ beforeSectionName: '<h3>',
24
+ afterSectionName: '</h3>',
25
+ surroundingPageLayout: 344,
26
+ altLayoutName: 'text/foo',
27
+ enableCaching: true,
28
+ pagination: true,
29
+ contentPerPage: 10,
30
+ beforePaginationHtml: '<div class="pagination">',
31
+ betweenPaginationHtml: '|',
32
+ afterPaginationHtml: '</div>',
33
+ },
34
+ });
35
+ ```
36
+
37
+ ## Properties
38
+
39
+ ### Common properties
40
+
41
+ | Property | Type | Default | Description |
42
+ |---|---|---|---|
43
+ | `contentTypeId` | `number \| null` | `null` | Content Type ID. `null` includes all content types. |
44
+ | `startSection` | `string` | `'current'` | Content source: `'current'`, `'specific'`, or `'element'`. |
45
+ | `showHiddenSections` | `boolean` | `false` | Includes hidden sections. |
46
+ | `levelsToRecurse` | `number` | `1` | Number of levels to recurse. |
47
+ | `beforeHtml` | `string` | `''` | HTML before content. |
48
+ | `afterHtml` | `string` | `''` | HTML after content. |
49
+ | `showSectionName` | `boolean` | `false` | Displays section names in the output. |
50
+ | `surroundingPageLayout` | `number` | `n/a` | Page Layout ID. |
51
+ | `altLayoutName` | `string` | `''` | Alternative content layout name. |
52
+ | `enableCaching` | `boolean` | `true` | Controls output caching. |
53
+ | `pagination` | `boolean` | `false` | Splits output across pages. |
54
+
55
+ ### When `startSection` is `'specific'`
56
+
57
+ | Property | Type | Description |
58
+ |---|---|---|
59
+ | `section` | `number` | Required section ID. |
60
+
61
+ ### When `startSection` is `'element'`
62
+
63
+ | Property | Type | Description |
64
+ |---|---|---|
65
+ | `startSectionElement` | `string` | Free-text content element name from which to derive the section. |
66
+
67
+ ### When `showSectionName` is `true`
68
+
69
+ | Property | Type | Default | Description |
70
+ |---|---|---|---|
71
+ | `showNameForHidden` | `boolean` | `false` | Shows names for hidden sections. |
72
+ | `beforeSectionName` | `string` | `''` | HTML before each section name. |
73
+ | `afterSectionName` | `string` | `''` | HTML after each section name. |
74
+
75
+ ### When `pagination` is `true`
76
+
77
+ | Property | Type | Default | Description |
78
+ |---|---|---|---|
79
+ | `contentPerPage` | `number` | `0` | Items per page. |
80
+ | `beforePaginationHtml` | `string` | `''` | HTML before pagination. |
81
+ | `betweenPaginationHtml` | `string` | `''` | HTML between pagination links. |
82
+ | `afterPaginationHtml` | `string` | `''` | HTML after pagination. |
83
+
84
+ ## Validation
85
+
86
+ - When `startSection` is `'specific'`, `section` is required and validated. Do not set it for other start-section modes.
87
+ - Set `startSectionElement` only when `startSection` is `'element'`.
88
+ - Set `showNameForHidden`, `beforeSectionName`, and `afterSectionName` only when `showSectionName` is `true`.
89
+ - Set `contentPerPage` and the pagination HTML fields only when `pagination` is `true`.
90
+ - The SDK validates `surroundingPageLayout` against page layouts.
91
+ - The SDK validates `contentTypeId` when it is not `null`.
92
+
93
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,79 @@
1
+ # Related Content
2
+
3
+ Fetch and display content from the current section, a specific section, or a named child section.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/related-content-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ // Current section
11
+ await t4.navigation.create({
12
+ type: 'related-content',
13
+ name: 'Related',
14
+ properties: { fetchMethod: 'current', title: 'Related Items' },
15
+ });
16
+
17
+ // Specific section
18
+ await t4.navigation.create({
19
+ type: 'related-content',
20
+ name: 'Related',
21
+ properties: {
22
+ fetchMethod: 'section',
23
+ section: 235,
24
+ altLayoutName: 'text/foo',
25
+ },
26
+ });
27
+
28
+ // Child section
29
+ await t4.navigation.create({
30
+ type: 'related-content',
31
+ name: 'Related',
32
+ properties: {
33
+ fetchMethod: 'child',
34
+ childSectionName: 'Related Child',
35
+ contentTypeIds: [67, 363],
36
+ display: 5,
37
+ recurseChildSection: true,
38
+ altLayoutName: 'text/foo',
39
+ },
40
+ });
41
+ ```
42
+
43
+ ## Properties
44
+
45
+ ### Common properties
46
+
47
+ | Property | Type | Default | Description |
48
+ |---|---|---|---|
49
+ | `fetchMethod` | `string` | `'current'` | Content source: `'current'`, `'section'`, or `'child'`. |
50
+ | `title` | `string` | `''` | Title text. |
51
+ | `altLayoutName` | `string` | `''` | Alternative content layout name. |
52
+ | `beforeHtml` | `string` | `''` | HTML before content. |
53
+ | `afterHtml` | `string` | `''` | HTML after content. |
54
+
55
+ ### When `fetchMethod` is `'section'`
56
+
57
+ | Property | Type | Description |
58
+ |---|---|---|
59
+ | `section` | `number` | Required section ID. |
60
+
61
+ ### When `fetchMethod` is `'child'`
62
+
63
+ | Property | Type | Default | Description |
64
+ |---|---|---|---|
65
+ | `childSectionName` | `string` | `''` | Child section name to search. |
66
+ | `contentTypeIds` | `number[]` | *required* | Content Type IDs by which to filter. |
67
+ | `display` | `number` | `0` | Number of items. `0` displays all items. |
68
+ | `recurseChildSection` | `boolean` | `false` | Searches recursively through child sections. |
69
+
70
+ ## Validation
71
+
72
+ - When `fetchMethod` is `'section'`, `section` is required and validated.
73
+ - When `fetchMethod` is `'child'`, `contentTypeIds` is required and validated.
74
+
75
+ ## Caching
76
+
77
+ Caching is enabled by default.
78
+
79
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,31 @@
1
+ # Related Section Branch
2
+
3
+ Link to a named child section across branches.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/related-section-branch-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'related-section-branch',
12
+ name: 'News Link',
13
+ properties: {
14
+ childSectionName: 'news',
15
+ linkText: 'View News',
16
+ },
17
+ });
18
+ ```
19
+
20
+ ## Properties
21
+
22
+ | Property | Type | Default | Description |
23
+ |---|---|---|---|
24
+ | `childSectionName` | `string` | `''` | Name of the child section to link to. |
25
+ | `linkText` | `string` | `''` | Displayed link text. |
26
+
27
+ ## Validation
28
+
29
+ No validation applies. Both fields are optional free-text strings.
30
+
31
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,35 @@
1
+ # Return to Index
2
+
3
+ Link from a fulltext content page back to its section index.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/return-to-index-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'return-to-index',
12
+ name: 'Back Link',
13
+ properties: {
14
+ linkText: 'Back to...',
15
+ appendSectionName: true,
16
+ scrollToContent: true,
17
+ linkTarget: '_blank',
18
+ },
19
+ });
20
+ ```
21
+
22
+ ## Properties
23
+
24
+ | Property | Type | Default | Description |
25
+ |---|---|---|---|
26
+ | `linkText` | `string` | `''` | Link text. |
27
+ | `appendSectionName` | `boolean` | `false` | Appends the section name to the link text. |
28
+ | `scrollToContent` | `boolean` | `false` | Scrolls to the content when clicked. |
29
+ | `linkTarget` | `string` | `''` | Link target attribute, such as `'_blank'`. |
30
+
31
+ ## Validation
32
+
33
+ All fields are optional.
34
+
35
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,51 @@
1
+ # Section Details
2
+
3
+ Output a section's ID, name, path, or link.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/section-details-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'section-details',
12
+ name: 'Show Section Path',
13
+ properties: {
14
+ detailMethod: 'section',
15
+ section: 233,
16
+ displayType: 'path',
17
+ },
18
+ });
19
+ ```
20
+
21
+ ## Properties
22
+
23
+ ### Common properties
24
+
25
+ | Property | Type | Default | Description |
26
+ |---|---|---|---|
27
+ | `detailMethod` | `string` | `'current'` | Section selector: `'current'`, `'level'`, or `'section'`. |
28
+ | `displayType` | `string` | `'id'` | Output value: `'id'`, `'name'`, `'path'`, or `'link'`. |
29
+
30
+ ### When `detailMethod` is `'level'`
31
+
32
+ | Property | Type | Default | Description |
33
+ |---|---|---|---|
34
+ | `level` | `number` | `0` | Section level. |
35
+
36
+ ### When `detailMethod` is `'section'`
37
+
38
+ | Property | Type | Default | Description |
39
+ |---|---|---|---|
40
+ | `section` | `number` | `n/a` | Required section ID. |
41
+
42
+ ## Validation
43
+
44
+ - Set `level` only when `detailMethod` is `'level'`.
45
+ - When `detailMethod` is `'section'`, `section` is required and validated. Do not set it for other methods.
46
+
47
+ ## Read behavior
48
+
49
+ The SDK hides fields that do not apply to the current method.
50
+
51
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,33 @@
1
+ # Section Iterator
2
+
3
+ Iterate over sections to output content from multiple sections, with configurable HTML around and between them.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/section-iterator-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'section-iterator',
12
+ name: 'My Iterator',
13
+ properties: {
14
+ beforeHtml: '<ul>',
15
+ betweenHtml: '<li>',
16
+ afterHtml: '</ul>',
17
+ },
18
+ });
19
+ ```
20
+
21
+ ## Properties
22
+
23
+ | Property | Type | Default | Description |
24
+ |---|---|---|---|
25
+ | `beforeHtml` | `string` | `''` | HTML before the output. |
26
+ | `betweenHtml` | `string` | `''` | HTML between sections. |
27
+ | `afterHtml` | `string` | `''` | HTML after the output. |
28
+
29
+ ## Validation
30
+
31
+ No validation applies. All fields are optional strings.
32
+
33
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,39 @@
1
+ # Section Meta Info
2
+
3
+ Output the value of one section metadata tag.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/section-meta-info-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'section-meta-info',
12
+ name: 'OG Description',
13
+ properties: {
14
+ metaType: 'og:description',
15
+ dateFormat: 'dd.MM.yyyy',
16
+ beforeHtml: '<meta content="',
17
+ afterHtml: '">',
18
+ },
19
+ });
20
+ ```
21
+
22
+ ## Properties
23
+
24
+ | Property | Type | Default | Description |
25
+ |---|---|---|---|
26
+ | `metaType` | `string` | *required* | Meta tag name, such as `'description'` or `'og:title'`. |
27
+ | `dateFormat` | `string` | `''` | Date format string, such as `'dd.MM.yyyy'`. |
28
+ | `beforeHtml` | `string` | `''` | HTML before the output. |
29
+ | `afterHtml` | `string` | `''` | HTML after the output. |
30
+
31
+ ## Validation
32
+
33
+ `metaType` is required and validated against the meta tag definitions from `GET /meta/level`.
34
+
35
+ ## Read behavior
36
+
37
+ The SDK resolves the numeric ID back to the metadata tag name.
38
+
39
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,58 @@
1
+ # Site Map
2
+
3
+ Output a hierarchical site map with optional content counts.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/site-map-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'site-map',
12
+ name: 'Full Site Map',
13
+ properties: {
14
+ startSection: 233,
15
+ levels: 5,
16
+ childSectionLinks: true,
17
+ enableContentCount: true,
18
+ contentTypeIds: [67, 363],
19
+ maxLevelsToCount: 10,
20
+ countRecursively: true,
21
+ htmlBeforeContentCount: '(',
22
+ htmlAfterContentCount: ')',
23
+ },
24
+ });
25
+ ```
26
+
27
+ ## Properties
28
+
29
+ ### Common properties
30
+
31
+ | Property | Type | Default | Description |
32
+ |---|---|---|---|
33
+ | `startSection` | `number` | `0` | Starting section ID. `0` starts at the channel root. |
34
+ | `levels` | `number` | `0` | Number of levels. `0` includes all levels. |
35
+ | `childSectionLinks` | `boolean` | `false` | Shows links to child sections. |
36
+ | `enableContentCount` | `boolean` | `false` | Adds content counts. |
37
+
38
+ ### When `enableContentCount` is `true`
39
+
40
+ | Property | Type | Default | Description |
41
+ |---|---|---|---|
42
+ | `contentTypeIds` | `number[]` | `[]` | Content Type IDs to count. An empty array includes all content types. |
43
+ | `maxLevelsToCount` | `number` | `''` | Maximum levels to recurse while counting. |
44
+ | `countRecursively` | `boolean` | `false` | Counts recursively through child sections. |
45
+ | `htmlBeforeContentCount` | `string` | `''` | HTML before the count. |
46
+ | `htmlAfterContentCount` | `string` | `''` | HTML after the count. |
47
+
48
+ ## Validation
49
+
50
+ - The SDK validates `startSection` when it is a positive number.
51
+ - The SDK validates every ID in `contentTypeIds` and requires each content type to exist.
52
+ - Content-count fields throw when set without `enableContentCount: true`.
53
+
54
+ ## Read behavior
55
+
56
+ The SDK hides content-count fields when `enableContentCount` is `false`.
57
+
58
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,80 @@
1
+ # Top Content
2
+
3
+ Display recent or relevant content from a section or branch, ordered by date or name.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/top-content-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'top-content',
12
+ name: 'Latest Articles',
13
+ properties: {
14
+ fetchMethod: 'section',
15
+ section: 237,
16
+ contentTypeIds: [67, 151],
17
+ channelId: 5,
18
+ upcomingContent: true,
19
+ dateElement: 'Date released',
20
+ ignoreDateOrdering: false,
21
+ numToDisplay: 5,
22
+ startAt: 10,
23
+ altLayoutName: 'text/foo',
24
+ title: 'Latest',
25
+ beforeHtml: '<ul>',
26
+ afterHtml: '</ul>',
27
+ },
28
+ });
29
+ ```
30
+
31
+ ## Properties
32
+
33
+ ### Common properties
34
+
35
+ | Property | Type | Default | Description |
36
+ |---|---|---|---|
37
+ | `fetchMethod` | `string` | `'current'` | Content source: `'current'`, `'current-branch'`, `'branch'`, or `'section'`. |
38
+ | `contentTypeIds` | `number[]` | `[]` | Content Type IDs by which to filter. An empty array includes all content types. |
39
+ | `channelId` | `number` | `0` | Channel ID. `0` applies no channel restriction. |
40
+
41
+ ### When `fetchMethod` is `'branch'` or `'section'`
42
+
43
+ | Property | Type | Default | Description |
44
+ |---|---|---|---|
45
+ | `section` | `number` | `n/a` | Required section ID. |
46
+
47
+ ### Ordering and filtering
48
+
49
+ | Property | Type | Default | Description |
50
+ |---|---|---|---|
51
+ | `upcomingContent` | `boolean` | `false` | Includes upcoming or future content. |
52
+ | `dateElement` | `string` | `''` | Date element name for ordering and filtering. |
53
+ | `ignoreDateOrdering` | `boolean` | `false` | Uses Terminalfour's section order instead of date order. |
54
+
55
+ ### Results and output
56
+
57
+ | Property | Type | Default | Description |
58
+ |---|---|---|---|
59
+ | `numToDisplay` | `number` | `0` | Number of items. `0` displays all items. |
60
+ | `startAt` | `number` | `0` | Skips this many items from the start. |
61
+ | `altLayoutName` | `string` | `''` | Alternative content layout name. |
62
+ | `title` | `string` | `''` | Title text. |
63
+ | `beforeHtml` | `string` | `''` | HTML before content. |
64
+ | `afterHtml` | `string` | `''` | HTML after content. |
65
+
66
+ ## Validation
67
+
68
+ - When `fetchMethod` is `'branch'` or `'section'`, `section` is required and validated. Do not set it for the other fetch methods.
69
+ - The SDK validates each ID in `contentTypeIds` and requires every content type to exist.
70
+ - The SDK validates `channelId` when it is a positive number.
71
+
72
+ ## Read behavior
73
+
74
+ The SDK hides `section` when the fetch method does not use it.
75
+
76
+ ## Caching
77
+
78
+ Caching is enabled by default.
79
+
80
+ [Back to Navigation](../navigation.md)
@@ -0,0 +1,47 @@
1
+ # Top Stories
2
+
3
+ Display content from one section with optional links to fulltext pages.
4
+
5
+ [Terminalfour Documentation](https://docs.terminalfour.com/documentation/navigation/create-a-new-navigation-object/top-stories-navigation-object/)
6
+
7
+ ## Create
8
+
9
+ ```typescript
10
+ await t4.navigation.create({
11
+ type: 'top-stories',
12
+ name: 'Latest News',
13
+ properties: {
14
+ section: 237,
15
+ numToShow: 10,
16
+ linkToFulltext: true,
17
+ title: 'Latest',
18
+ beforeMenuHtml: '<ul>',
19
+ afterMenuHtml: '</ul>',
20
+ beforeHtml: '<li>',
21
+ afterHtml: '</li>',
22
+ },
23
+ });
24
+ ```
25
+
26
+ ## Properties
27
+
28
+ | Property | Type | Default | Description |
29
+ |---|---|---|---|
30
+ | `section` | `number` | *required* | Section ID. |
31
+ | `numToShow` | `number` | `0` | Number of items. `0` displays all items. |
32
+ | `linkToFulltext` | `boolean` | `false` | Links items to their fulltext pages. |
33
+ | `title` | `string` | `''` | Title text. |
34
+ | `beforeMenuHtml` | `string` | `''` | HTML before the menu. |
35
+ | `afterMenuHtml` | `string` | `''` | HTML after the menu. |
36
+ | `beforeHtml` | `string` | `''` | HTML before each item. |
37
+ | `afterHtml` | `string` | `''` | HTML after each item. |
38
+
39
+ ## Validation
40
+
41
+ `section` is required and validated.
42
+
43
+ ## Caching
44
+
45
+ Caching is enabled by default.
46
+
47
+ [Back to Navigation](../navigation.md)