@bright.global/arboretum-sdk 0.0.6

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 (218) hide show
  1. package/README.md +223 -0
  2. package/dist/arboretum-client.js +2 -0
  3. package/dist/clients/contentful-client/contentful-client.js +2 -0
  4. package/dist/clients/contentful-client/impl/contentful-client-impl.js +54 -0
  5. package/dist/es6/arboretum-client.js +1 -0
  6. package/dist/es6/clients/contentful-client/contentful-client.js +1 -0
  7. package/dist/es6/clients/contentful-client/impl/contentful-client-impl.js +50 -0
  8. package/dist/es6/impl/arboretum-client.impl.js +182 -0
  9. package/dist/es6/impl/data/content-types.js +136 -0
  10. package/dist/es6/impl/data/helpers/__mocks__/mocked-contentful-entries-client-api.js +66 -0
  11. package/dist/es6/impl/data/helpers/entry-status.js +19 -0
  12. package/dist/es6/impl/data/helpers/get-all-entries-recursively.js +113 -0
  13. package/dist/es6/impl/data/helpers/get-all-entries-recursively.test.js +114 -0
  14. package/dist/es6/impl/data/helpers/home-pages-by-tag-id.js +66 -0
  15. package/dist/es6/impl/data/helpers/home-pages-by-tag-id.test.js +105 -0
  16. package/dist/es6/impl/data/helpers/locale-codes-from-metadata.js +7 -0
  17. package/dist/es6/impl/data/helpers/locale-codes-from-metadata.test.js +52 -0
  18. package/dist/es6/impl/data/helpers/parse-locale-tag.js +24 -0
  19. package/dist/es6/impl/data/helpers/parse-locale-tag.test.js +19 -0
  20. package/dist/es6/impl/data/helpers/validate-content-types.js +112 -0
  21. package/dist/es6/impl/data/helpers/validate-content-types.test.js +103 -0
  22. package/dist/es6/impl/data/home-page.js +75 -0
  23. package/dist/es6/impl/data/locales.js +60 -0
  24. package/dist/es6/impl/data/page-entries.js +169 -0
  25. package/dist/es6/impl/data/page-entries.test.js +170 -0
  26. package/dist/es6/impl/data/redirect-entries.js +163 -0
  27. package/dist/es6/impl/data/sitemap-data.js +109 -0
  28. package/dist/es6/impl/sitemap/adapters/page-entry-adapter.js +27 -0
  29. package/dist/es6/impl/sitemap/adapters/redirect-entry-adapter.js +26 -0
  30. package/dist/es6/impl/sitemap/adapters/redirect-to-arboretum-page-adapter.js +11 -0
  31. package/dist/es6/impl/sitemap/adapters/to-arboretum-page-adapter.js +14 -0
  32. package/dist/es6/impl/sitemap/adapters/to-arboretum-page-adapter.test.js +100 -0
  33. package/dist/es6/impl/sitemap/adapters/to-arboretum-page-with-missing-data-adapter.js +16 -0
  34. package/dist/es6/impl/sitemap/helpers/__mocks__/mocked-localized-sitemap.js +186 -0
  35. package/dist/es6/impl/sitemap/helpers/build-localized-sitemap.js +128 -0
  36. package/dist/es6/impl/sitemap/helpers/build-localized-sitemap.test.js +208 -0
  37. package/dist/es6/impl/sitemap/helpers/build-pages-by-tag-eagerly.js +7 -0
  38. package/dist/es6/impl/sitemap/helpers/build-sitemap-eagerly.js +32 -0
  39. package/dist/es6/impl/sitemap/helpers/find-ancestors.js +42 -0
  40. package/dist/es6/impl/sitemap/helpers/find-ancestors.test.js +33 -0
  41. package/dist/es6/impl/sitemap/helpers/find-children.js +9 -0
  42. package/dist/es6/impl/sitemap/helpers/find-children.test.js +39 -0
  43. package/dist/es6/impl/sitemap/helpers/is-root.js +1 -0
  44. package/dist/es6/impl/sitemap/helpers/localize-contentful-field.js +22 -0
  45. package/dist/es6/impl/sitemap/helpers/localize-contentful-field.test.js +137 -0
  46. package/dist/es6/impl/sitemap/helpers/localized-pages-by-tag-id.js +79 -0
  47. package/dist/es6/impl/sitemap/helpers/localized-path.js +4 -0
  48. package/dist/es6/impl/sitemap/helpers/page-ancestors.js +8 -0
  49. package/dist/es6/impl/sitemap/helpers/page-children.js +10 -0
  50. package/dist/es6/impl/sitemap/methods/cached-data.js +7 -0
  51. package/dist/es6/impl/sitemap/methods/home-page.js +27 -0
  52. package/dist/es6/impl/sitemap/methods/page-by-id.js +29 -0
  53. package/dist/es6/impl/sitemap/methods/page-by-path.js +52 -0
  54. package/dist/es6/impl/sitemap/methods/pages-by-ids.js +6 -0
  55. package/dist/es6/impl/sitemap/methods/pages-by-paths.js +6 -0
  56. package/dist/es6/impl/sitemap/methods/pages-by-tag-id.js +37 -0
  57. package/dist/es6/impl/sitemap/methods/pages.js +75 -0
  58. package/dist/es6/impl/sitemap/methods/regenerate.js +64 -0
  59. package/dist/es6/impl/sitemap/methods/search.js +97 -0
  60. package/dist/es6/impl/sitemap/methods/status.js +47 -0
  61. package/dist/es6/index.js +2 -0
  62. package/dist/es6/utils/array-to-map.js +7 -0
  63. package/dist/es6/utils/fp-utils.js +5 -0
  64. package/dist/es6/utils/group-by.js +13 -0
  65. package/dist/es6/utils/json-stringify-map-replacer.js +6 -0
  66. package/dist/es6/utils/string-similarity.js +59 -0
  67. package/dist/impl/arboretum-client.impl.js +189 -0
  68. package/dist/impl/data/content-types.js +140 -0
  69. package/dist/impl/data/helpers/__mocks__/mocked-contentful-entries-client-api.js +72 -0
  70. package/dist/impl/data/helpers/entry-status.js +23 -0
  71. package/dist/impl/data/helpers/get-all-entries-recursively.js +117 -0
  72. package/dist/impl/data/helpers/get-all-entries-recursively.test.js +116 -0
  73. package/dist/impl/data/helpers/home-pages-by-tag-id.js +70 -0
  74. package/dist/impl/data/helpers/home-pages-by-tag-id.test.js +107 -0
  75. package/dist/impl/data/helpers/locale-codes-from-metadata.js +11 -0
  76. package/dist/impl/data/helpers/locale-codes-from-metadata.test.js +54 -0
  77. package/dist/impl/data/helpers/parse-locale-tag.js +28 -0
  78. package/dist/impl/data/helpers/parse-locale-tag.test.js +21 -0
  79. package/dist/impl/data/helpers/validate-content-types.js +117 -0
  80. package/dist/impl/data/helpers/validate-content-types.test.js +105 -0
  81. package/dist/impl/data/home-page.js +79 -0
  82. package/dist/impl/data/locales.js +64 -0
  83. package/dist/impl/data/page-entries.js +173 -0
  84. package/dist/impl/data/page-entries.test.js +172 -0
  85. package/dist/impl/data/redirect-entries.js +168 -0
  86. package/dist/impl/data/sitemap-data.js +113 -0
  87. package/dist/impl/sitemap/adapters/page-entry-adapter.js +31 -0
  88. package/dist/impl/sitemap/adapters/redirect-entry-adapter.js +30 -0
  89. package/dist/impl/sitemap/adapters/redirect-to-arboretum-page-adapter.js +15 -0
  90. package/dist/impl/sitemap/adapters/to-arboretum-page-adapter.js +18 -0
  91. package/dist/impl/sitemap/adapters/to-arboretum-page-adapter.test.js +102 -0
  92. package/dist/impl/sitemap/adapters/to-arboretum-page-with-missing-data-adapter.js +20 -0
  93. package/dist/impl/sitemap/helpers/__mocks__/mocked-localized-sitemap.js +189 -0
  94. package/dist/impl/sitemap/helpers/build-localized-sitemap.js +133 -0
  95. package/dist/impl/sitemap/helpers/build-localized-sitemap.test.js +210 -0
  96. package/dist/impl/sitemap/helpers/build-pages-by-tag-eagerly.js +11 -0
  97. package/dist/impl/sitemap/helpers/build-sitemap-eagerly.js +36 -0
  98. package/dist/impl/sitemap/helpers/find-ancestors.js +46 -0
  99. package/dist/impl/sitemap/helpers/find-ancestors.test.js +35 -0
  100. package/dist/impl/sitemap/helpers/find-children.js +13 -0
  101. package/dist/impl/sitemap/helpers/find-children.test.js +41 -0
  102. package/dist/impl/sitemap/helpers/is-root.js +5 -0
  103. package/dist/impl/sitemap/helpers/localize-contentful-field.js +26 -0
  104. package/dist/impl/sitemap/helpers/localize-contentful-field.test.js +139 -0
  105. package/dist/impl/sitemap/helpers/localized-pages-by-tag-id.js +84 -0
  106. package/dist/impl/sitemap/helpers/localized-path.js +8 -0
  107. package/dist/impl/sitemap/helpers/page-ancestors.js +12 -0
  108. package/dist/impl/sitemap/helpers/page-children.js +14 -0
  109. package/dist/impl/sitemap/methods/cached-data.js +11 -0
  110. package/dist/impl/sitemap/methods/home-page.js +31 -0
  111. package/dist/impl/sitemap/methods/page-by-id.js +33 -0
  112. package/dist/impl/sitemap/methods/page-by-path.js +56 -0
  113. package/dist/impl/sitemap/methods/pages-by-ids.js +10 -0
  114. package/dist/impl/sitemap/methods/pages-by-paths.js +10 -0
  115. package/dist/impl/sitemap/methods/pages-by-tag-id.js +41 -0
  116. package/dist/impl/sitemap/methods/pages.js +79 -0
  117. package/dist/impl/sitemap/methods/regenerate.js +68 -0
  118. package/dist/impl/sitemap/methods/search.js +101 -0
  119. package/dist/impl/sitemap/methods/status.js +51 -0
  120. package/dist/index.js +8 -0
  121. package/dist/types/arboretum-client.d.ts +110 -0
  122. package/dist/types/clients/contentful-client/contentful-client.d.ts +95 -0
  123. package/dist/types/clients/contentful-client/impl/contentful-client-impl.d.ts +3 -0
  124. package/dist/types/impl/arboretum-client.impl.d.ts +107 -0
  125. package/dist/types/impl/data/content-types.d.ts +11 -0
  126. package/dist/types/impl/data/helpers/__mocks__/mocked-contentful-entries-client-api.d.ts +7 -0
  127. package/dist/types/impl/data/helpers/entry-status.d.ts +2 -0
  128. package/dist/types/impl/data/helpers/get-all-entries-recursively.d.ts +6 -0
  129. package/dist/types/impl/data/helpers/get-all-entries-recursively.test.d.ts +1 -0
  130. package/dist/types/impl/data/helpers/home-pages-by-tag-id.d.ts +15 -0
  131. package/dist/types/impl/data/helpers/home-pages-by-tag-id.test.d.ts +1 -0
  132. package/dist/types/impl/data/helpers/locale-codes-from-metadata.d.ts +2 -0
  133. package/dist/types/impl/data/helpers/locale-codes-from-metadata.test.d.ts +1 -0
  134. package/dist/types/impl/data/helpers/parse-locale-tag.d.ts +3 -0
  135. package/dist/types/impl/data/helpers/parse-locale-tag.test.d.ts +1 -0
  136. package/dist/types/impl/data/helpers/validate-content-types.d.ts +5 -0
  137. package/dist/types/impl/data/helpers/validate-content-types.test.d.ts +1 -0
  138. package/dist/types/impl/data/home-page.d.ts +3 -0
  139. package/dist/types/impl/data/locales.d.ts +10 -0
  140. package/dist/types/impl/data/page-entries.d.ts +3 -0
  141. package/dist/types/impl/data/page-entries.test.d.ts +1 -0
  142. package/dist/types/impl/data/redirect-entries.d.ts +4 -0
  143. package/dist/types/impl/data/sitemap-data.d.ts +17 -0
  144. package/dist/types/impl/sitemap/adapters/page-entry-adapter.d.ts +6 -0
  145. package/dist/types/impl/sitemap/adapters/redirect-entry-adapter.d.ts +4 -0
  146. package/dist/types/impl/sitemap/adapters/redirect-to-arboretum-page-adapter.d.ts +3 -0
  147. package/dist/types/impl/sitemap/adapters/to-arboretum-page-adapter.d.ts +3 -0
  148. package/dist/types/impl/sitemap/adapters/to-arboretum-page-adapter.test.d.ts +1 -0
  149. package/dist/types/impl/sitemap/adapters/to-arboretum-page-with-missing-data-adapter.d.ts +3 -0
  150. package/dist/types/impl/sitemap/helpers/__mocks__/mocked-localized-sitemap.d.ts +16 -0
  151. package/dist/types/impl/sitemap/helpers/build-localized-sitemap.d.ts +5 -0
  152. package/dist/types/impl/sitemap/helpers/build-localized-sitemap.test.d.ts +1 -0
  153. package/dist/types/impl/sitemap/helpers/build-pages-by-tag-eagerly.d.ts +3 -0
  154. package/dist/types/impl/sitemap/helpers/build-sitemap-eagerly.d.ts +3 -0
  155. package/dist/types/impl/sitemap/helpers/find-ancestors.d.ts +2 -0
  156. package/dist/types/impl/sitemap/helpers/find-ancestors.test.d.ts +1 -0
  157. package/dist/types/impl/sitemap/helpers/find-children.d.ts +2 -0
  158. package/dist/types/impl/sitemap/helpers/find-children.test.d.ts +1 -0
  159. package/dist/types/impl/sitemap/helpers/is-root.d.ts +2 -0
  160. package/dist/types/impl/sitemap/helpers/localize-contentful-field.d.ts +4 -0
  161. package/dist/types/impl/sitemap/helpers/localize-contentful-field.test.d.ts +1 -0
  162. package/dist/types/impl/sitemap/helpers/localized-pages-by-tag-id.d.ts +4 -0
  163. package/dist/types/impl/sitemap/helpers/localized-path.d.ts +1 -0
  164. package/dist/types/impl/sitemap/helpers/page-ancestors.d.ts +3 -0
  165. package/dist/types/impl/sitemap/helpers/page-children.d.ts +5 -0
  166. package/dist/types/impl/sitemap/methods/cached-data.d.ts +3 -0
  167. package/dist/types/impl/sitemap/methods/home-page.d.ts +3 -0
  168. package/dist/types/impl/sitemap/methods/page-by-id.d.ts +3 -0
  169. package/dist/types/impl/sitemap/methods/page-by-path.d.ts +3 -0
  170. package/dist/types/impl/sitemap/methods/pages-by-ids.d.ts +3 -0
  171. package/dist/types/impl/sitemap/methods/pages-by-paths.d.ts +3 -0
  172. package/dist/types/impl/sitemap/methods/pages-by-tag-id.d.ts +3 -0
  173. package/dist/types/impl/sitemap/methods/pages.d.ts +3 -0
  174. package/dist/types/impl/sitemap/methods/regenerate.d.ts +3 -0
  175. package/dist/types/impl/sitemap/methods/search.d.ts +3 -0
  176. package/dist/types/impl/sitemap/methods/status.d.ts +3 -0
  177. package/dist/types/index.d.ts +6 -0
  178. package/dist/types/utils/array-to-map.d.ts +1 -0
  179. package/dist/types/utils/fp-utils.d.ts +11 -0
  180. package/dist/types/utils/group-by.d.ts +1 -0
  181. package/dist/types/utils/json-stringify-map-replacer.d.ts +1 -0
  182. package/dist/types/utils/string-similarity.d.ts +9 -0
  183. package/dist/utils/array-to-map.js +11 -0
  184. package/dist/utils/fp-utils.js +10 -0
  185. package/dist/utils/group-by.js +17 -0
  186. package/dist/utils/json-stringify-map-replacer.js +10 -0
  187. package/dist/utils/string-similarity.js +63 -0
  188. package/docs/.nojekyll +1 -0
  189. package/docs/assets/highlight.css +78 -0
  190. package/docs/assets/main.js +58 -0
  191. package/docs/assets/search.js +1 -0
  192. package/docs/assets/style.css +1367 -0
  193. package/docs/functions/createArboretumClient.html +72 -0
  194. package/docs/functions/createArboretumClientFromCdaClient.html +72 -0
  195. package/docs/functions/createArboretumClientFromCdaParams.html +72 -0
  196. package/docs/functions/createArboretumClientFromCma.html +72 -0
  197. package/docs/index.html +228 -0
  198. package/docs/modules.html +88 -0
  199. package/docs/types/ArboretumAliasT.html +70 -0
  200. package/docs/types/ArboretumClientConfigFromCdaParamsT.html +74 -0
  201. package/docs/types/ArboretumClientConfigFromCdaT.html +79 -0
  202. package/docs/types/ArboretumClientConfigFromCmaT.html +79 -0
  203. package/docs/types/ArboretumClientConfigT.html +63 -0
  204. package/docs/types/ArboretumClientContentfulConfigOptionsT.html +93 -0
  205. package/docs/types/ArboretumClientOptions.html +72 -0
  206. package/docs/types/ArboretumClientOptionsT.html +63 -0
  207. package/docs/types/ArboretumClientT.html +235 -0
  208. package/docs/types/ArboretumPageNodeT.html +63 -0
  209. package/docs/types/ArboretumPageT.html +76 -0
  210. package/docs/types/ArboretumRedirectT.html +70 -0
  211. package/docs/types/CachedDataT.html +63 -0
  212. package/docs/types/Either.html +70 -0
  213. package/docs/types/EitherL.html +75 -0
  214. package/docs/types/EitherR.html +75 -0
  215. package/docs/types/LocaleT.html +63 -0
  216. package/docs/types/OptionsT.html +70 -0
  217. package/logo.svg +12 -0
  218. package/package.json +47 -0
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.regenerate = void 0;
40
+ var sitemap_data_1 = require("../../data/sitemap-data");
41
+ var regenerate = function (ctx) {
42
+ return function () { return __awaiter(void 0, void 0, void 0, function () {
43
+ var dataE;
44
+ return __generator(this, function (_a) {
45
+ switch (_a.label) {
46
+ case 0:
47
+ ctx.regenerationInProgress = true;
48
+ return [4 /*yield*/, (0, sitemap_data_1.sitemapData)(ctx).finally(function () {
49
+ ctx.regenerationInProgress = false;
50
+ })];
51
+ case 1:
52
+ dataE = _a.sent();
53
+ if (dataE._tag === 'Right') {
54
+ ctx.sitemap = new Map();
55
+ ctx.pagesByTagId = new Map();
56
+ ctx.lastUpdatedAt = new Date().toISOString();
57
+ ctx.data = dataE.right.data;
58
+ return [2 /*return*/, { status: 'OK', warnings: dataE.right.warnings }];
59
+ }
60
+ else {
61
+ throw new Error(dataE.left.join('\n'));
62
+ }
63
+ return [2 /*return*/];
64
+ }
65
+ });
66
+ }); };
67
+ };
68
+ exports.regenerate = regenerate;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
18
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
20
+ if (ar || !(i in from)) {
21
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
22
+ ar[i] = from[i];
23
+ }
24
+ }
25
+ return to.concat(ar || Array.prototype.slice.call(from));
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.search = void 0;
29
+ var string_similarity_1 = require("../../../utils/string-similarity");
30
+ var build_localized_sitemap_1 = require("../helpers/build-localized-sitemap");
31
+ var to_arboretum_page_with_missing_data_adapter_1 = require("../adapters/to-arboretum-page-with-missing-data-adapter");
32
+ var redirect_to_arboretum_page_adapter_1 = require("../adapters/redirect-to-arboretum-page-adapter");
33
+ var minPhraseSimilarity = 0.4;
34
+ var defaultLimit = 20;
35
+ var pagePhraseSimilarity = function (page, path, phrase) {
36
+ var slugSimilarity = (0, string_similarity_1.stringSimilarity)(phrase, page.slug);
37
+ var pathSimilarity = (0, string_similarity_1.stringSimilarity)(phrase, path);
38
+ var idSimilarity = (0, string_similarity_1.stringSimilarity)(phrase, page.sys.id);
39
+ return Math.max.apply(Math, [slugSimilarity, pathSimilarity, idSimilarity]);
40
+ };
41
+ var redirectPhraseSimilarity = function (redirect, phrase) {
42
+ var pathSimilarity = (0, string_similarity_1.stringSimilarity)(phrase, redirect.path);
43
+ var idSimilarity = (0, string_similarity_1.stringSimilarity)(phrase, redirect.sys.id);
44
+ return Math.max.apply(Math, [pathSimilarity, idSimilarity]);
45
+ };
46
+ var localizedRecursiveSearch = function (localeCode, localizedSitemap, phrase, parentPath, currentPage) {
47
+ var getPath = function (page) {
48
+ return page.sys.id === localizedSitemap.root.sys.id
49
+ ? parentPath
50
+ : parentPath + '/' + page.slug;
51
+ };
52
+ var phraseSimilarity = currentPage.type === 'page'
53
+ ? pagePhraseSimilarity(currentPage, getPath(currentPage), phrase)
54
+ : redirectPhraseSimilarity(currentPage, phrase);
55
+ var childrenResults = currentPage.type === 'page'
56
+ ? currentPage.childPages.flatMap(function (_a) {
57
+ var id = _a.sys.id;
58
+ var childPage = localizedSitemap.sitemap.get(id);
59
+ var path = getPath(currentPage);
60
+ return childPage
61
+ ? localizedRecursiveSearch(localeCode, localizedSitemap, phrase, path, childPage)
62
+ : [];
63
+ })
64
+ : [];
65
+ var res = [];
66
+ if (phraseSimilarity >= minPhraseSimilarity) {
67
+ res.push({
68
+ phraseSimilarity: phraseSimilarity,
69
+ page: currentPage.type === 'page'
70
+ ? (0, to_arboretum_page_with_missing_data_adapter_1.toArboretumPageWithMissingData)(localeCode)(currentPage, undefined, undefined)
71
+ : (0, redirect_to_arboretum_page_adapter_1.redirectToArboretumPage)(localeCode)(currentPage),
72
+ });
73
+ }
74
+ res.push.apply(res, __spreadArray([], __read(childrenResults), false));
75
+ return res;
76
+ };
77
+ // Primitive implementation that can be inefficient for large sitemaps
78
+ var search = function (ctx) {
79
+ return function (phrase, localeCode, limit) {
80
+ return __spreadArray([], __read(ctx.data.locales.values()), false).filter(function (locale) { return (localeCode ? locale.code === localeCode : true); })
81
+ .flatMap(function (locale) {
82
+ var sitemap = (0, build_localized_sitemap_1.localizedSitemapFromCacheOrBuildEff)(ctx, locale);
83
+ var homePage = sitemap._tag === 'Right'
84
+ ? sitemap.right.sitemap.get(sitemap.right.root.sys.id)
85
+ : undefined;
86
+ if (sitemap._tag === 'Right' && homePage) {
87
+ return localizedRecursiveSearch(locale.code, sitemap.right, phrase, "/".concat(locale.code), homePage);
88
+ }
89
+ else {
90
+ return [];
91
+ }
92
+ })
93
+ .sort(function (a, b) { return b.phraseSimilarity - a.phraseSimilarity; })
94
+ .slice(0, limit || defaultLimit)
95
+ .map(function (_a) {
96
+ var page = _a.page;
97
+ return page;
98
+ });
99
+ };
100
+ };
101
+ exports.search = search;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
18
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
20
+ if (ar || !(i in from)) {
21
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
22
+ ar[i] = from[i];
23
+ }
24
+ }
25
+ return to.concat(ar || Array.prototype.slice.call(from));
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.status = void 0;
29
+ var build_localized_sitemap_1 = require("../helpers/build-localized-sitemap");
30
+ var status = function (ctx) {
31
+ return function () {
32
+ var pagesCount = __spreadArray([], __read(ctx.data.locales.values()), false).reduce(function (acc, locale) {
33
+ var sitemap = (0, build_localized_sitemap_1.localizedSitemapFromCacheOrBuildEff)(ctx, locale);
34
+ if (sitemap._tag === 'Right') {
35
+ return sitemap.right.sitemap.size + acc;
36
+ }
37
+ else {
38
+ return acc;
39
+ }
40
+ }, 0);
41
+ var localesCount = ctx.data.locales.size;
42
+ return {
43
+ pagesCount: pagesCount,
44
+ localesCount: localesCount,
45
+ lastUpdatedAt: ctx.lastUpdatedAt,
46
+ contentful: ctx.options,
47
+ regenerationInProgress: ctx.regenerationInProgress
48
+ };
49
+ };
50
+ };
51
+ exports.status = status;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createArboretumClientFromCdaParams = exports.createArboretumClientFromCdaClient = exports.createArboretumClientFromCma = exports.createArboretumClient = void 0;
4
+ var arboretum_client_impl_1 = require("./impl/arboretum-client.impl");
5
+ Object.defineProperty(exports, "createArboretumClient", { enumerable: true, get: function () { return arboretum_client_impl_1.createArboretumClient; } });
6
+ Object.defineProperty(exports, "createArboretumClientFromCma", { enumerable: true, get: function () { return arboretum_client_impl_1.createArboretumClientFromCma; } });
7
+ Object.defineProperty(exports, "createArboretumClientFromCdaClient", { enumerable: true, get: function () { return arboretum_client_impl_1.createArboretumClientFromCdaClient; } });
8
+ Object.defineProperty(exports, "createArboretumClientFromCdaParams", { enumerable: true, get: function () { return arboretum_client_impl_1.createArboretumClientFromCdaParams; } });
@@ -0,0 +1,110 @@
1
+ import { ContentfulClientApi, CreateClientParams } from "contentful";
2
+ import { CachedDataT, SysIdT } from "./impl/arboretum-client.impl";
3
+ import { Either } from "./utils/fp-utils";
4
+ import { ContentfulEnvironmentAPI } from "contentful-management/dist/typings/create-environment-api";
5
+ import { LocaleT, StatusT } from "./clients/contentful-client/contentful-client";
6
+ export type ArboretumClientOptions = {
7
+ data?: CachedDataT;
8
+ eagerly?: boolean;
9
+ includeEntryStatus?: boolean;
10
+ };
11
+ export type ArboretumClientContentfulConfigOptionsT = {
12
+ pageContentTypes: {
13
+ [id: SysIdT]: {
14
+ slugFieldId: string;
15
+ titleFieldId?: string;
16
+ childPagesFieldId?: string;
17
+ };
18
+ };
19
+ redirectContentType?: {
20
+ id: string;
21
+ titleFieldId?: string;
22
+ pageFieldId: string;
23
+ pathFieldId: string;
24
+ typeFieldId: string;
25
+ };
26
+ homePageTagId?: string;
27
+ };
28
+ export type ArboretumClientConfigFromCmaT = {
29
+ type: "cma-client";
30
+ preview: boolean;
31
+ contentful: {
32
+ client: ContentfulEnvironmentAPI;
33
+ options: ArboretumClientContentfulConfigOptionsT;
34
+ };
35
+ options?: ArboretumClientOptions;
36
+ };
37
+ export type ArboretumClientConfigFromCdaT = {
38
+ type: "cda-client";
39
+ preview: boolean;
40
+ contentful: {
41
+ client: ContentfulClientApi;
42
+ options: ArboretumClientContentfulConfigOptionsT;
43
+ };
44
+ options?: Pick<ArboretumClientOptions, "data" | "eagerly">;
45
+ };
46
+ export type ArboretumClientConfigFromCdaParamsT = {
47
+ type: "cda-client-params";
48
+ preview: boolean;
49
+ contentful: CreateClientParams & {
50
+ options: ArboretumClientContentfulConfigOptionsT;
51
+ };
52
+ options?: Pick<ArboretumClientOptions, "data" | "eagerly">;
53
+ };
54
+ export type ArboretumClientConfigT = ArboretumClientConfigFromCmaT | ArboretumClientConfigFromCdaT | ArboretumClientConfigFromCdaParamsT;
55
+ type ArboretumPageBaseT = {
56
+ id: string;
57
+ localeCode: string;
58
+ path: string;
59
+ title?: string;
60
+ cmaOnlyStatus?: StatusT;
61
+ };
62
+ export type ArboretumRedirectT = ArboretumPageBaseT & {
63
+ type: "redirect";
64
+ pageId: string;
65
+ };
66
+ export type ArboretumAliasT = ArboretumPageBaseT & {
67
+ type: "alias";
68
+ pageId: string;
69
+ };
70
+ export type ArboretumPageT = ArboretumPageBaseT & {
71
+ type: "page";
72
+ slug: string;
73
+ totalDirectChildrenCount: number;
74
+ children?: Array<ArboretumPageNodeT>;
75
+ ancestors?: Array<Omit<ArboretumPageT, "children" | "ancestors">>;
76
+ };
77
+ export type ArboretumPageNodeT = ArboretumPageT | ArboretumRedirectT | ArboretumAliasT;
78
+ export type OptionsT = {
79
+ withChildren?: boolean;
80
+ withAncestors?: boolean;
81
+ };
82
+ export type ArboretumClientOptionsT = Pick<ArboretumClientContentfulConfigOptionsT, "pageContentTypes" | "redirectContentType"> & Pick<ArboretumClientOptions, "includeEntryStatus">;
83
+ export type ArboretumClientT = {
84
+ homePage: (localeCode: string, options?: OptionsT) => Either<string, ArboretumPageT>;
85
+ pageByPath: (path: string, options?: OptionsT) => Either<string, ArboretumPageNodeT>;
86
+ pagesByPaths: (paths: Array<string>, options?: OptionsT) => Array<Either<string, ArboretumPageNodeT>>;
87
+ pageById: (localeCode: string, id: string, options?: OptionsT) => Either<string, ArboretumPageNodeT>;
88
+ pagesByIds: (localeCode: string, ids: Array<string>, options?: OptionsT) => Array<Either<string, ArboretumPageNodeT>>;
89
+ pagesByTagId: (localeCode: string, tagId: string, options?: OptionsT) => Either<string, Array<ArboretumPageNodeT>>;
90
+ pages: (options?: OptionsT & {
91
+ limit?: number;
92
+ skip?: number;
93
+ localeCode?: string;
94
+ }) => Either<string, Array<ArboretumPageNodeT>>;
95
+ locales: () => Array<LocaleT>;
96
+ regenerate: () => Promise<{
97
+ status: "OK";
98
+ warnings?: Array<string>;
99
+ }>;
100
+ search: (phrase: string, localeCode?: string, limit?: number) => Array<ArboretumPageNodeT>;
101
+ status: () => {
102
+ lastUpdatedAt: string;
103
+ pagesCount: number;
104
+ localesCount: number;
105
+ contentful: ArboretumClientOptionsT;
106
+ regenerationInProgress: boolean;
107
+ };
108
+ cachedData: () => CachedDataT;
109
+ };
110
+ export {};
@@ -0,0 +1,95 @@
1
+ import { Entry, Locale } from "contentful";
2
+ type EntriesQueryT = {
3
+ limit?: number;
4
+ skip?: number;
5
+ content_type?: string;
6
+ include?: number;
7
+ select?: string;
8
+ locale?: string;
9
+ ["metadata.tags.sys.id[in]"]?: string;
10
+ order?: string;
11
+ [key: string]: any;
12
+ };
13
+ type ContentTypesQueryT = {
14
+ limit: number;
15
+ "sys.id[in]": string;
16
+ };
17
+ export type StatusT = "draft" | "published" | "changed" | "archived";
18
+ export type EntryT = {
19
+ metadata?: {
20
+ tags: Array<{
21
+ sys: {
22
+ id: string;
23
+ };
24
+ }>;
25
+ };
26
+ fields: Entry<any>["fields"];
27
+ sys: {
28
+ id: string;
29
+ archivedVersion?: number;
30
+ version?: number;
31
+ publishedVersion?: number;
32
+ contentType: {
33
+ sys: {
34
+ id: string;
35
+ };
36
+ };
37
+ cmaOnlyStatus?: StatusT;
38
+ };
39
+ };
40
+ export type EntryIdT = EntryT["sys"]["id"];
41
+ type TagsQueryT = {
42
+ limit?: number;
43
+ skip?: number;
44
+ [key: string]: any;
45
+ };
46
+ export type TagT = {
47
+ name: string;
48
+ sys: {
49
+ id: string;
50
+ };
51
+ };
52
+ export type LocaleT = Pick<Locale, "code" | "default" | "fallbackCode" | "name">;
53
+ export type ContentTypeT = {
54
+ sys: {
55
+ id: string;
56
+ };
57
+ fields: Array<{
58
+ id: string;
59
+ name: string;
60
+ localized: boolean;
61
+ type: string;
62
+ linkType?: string;
63
+ items?: {
64
+ type?: string;
65
+ linkType?: string;
66
+ };
67
+ }>;
68
+ };
69
+ export type ContentfulClientT = {
70
+ getEntries: (query?: EntriesQueryT) => Promise<{
71
+ skip: number;
72
+ limit: number;
73
+ total: number;
74
+ items: Array<EntryT>;
75
+ }>;
76
+ getLocales: () => Promise<{
77
+ skip: number;
78
+ limit: number;
79
+ total: number;
80
+ items: Array<LocaleT>;
81
+ }>;
82
+ getContentTypes: (query?: ContentTypesQueryT) => Promise<{
83
+ skip: number;
84
+ limit: number;
85
+ total: number;
86
+ items: Array<ContentTypeT>;
87
+ }>;
88
+ getTags: (query?: TagsQueryT) => Promise<{
89
+ skip: number;
90
+ limit: number;
91
+ total: number;
92
+ items: Array<TagT>;
93
+ }>;
94
+ };
95
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ArboretumClientConfigT } from "../../../arboretum-client";
2
+ import { ContentfulClientT } from "../contentful-client";
3
+ export declare const createContentfulClient: (config: ArboretumClientConfigT) => ContentfulClientT;
@@ -0,0 +1,107 @@
1
+ import { ArboretumClientConfigFromCdaParamsT, ArboretumClientConfigFromCdaT, ArboretumClientConfigFromCmaT, ArboretumClientConfigT, ArboretumClientT, ArboretumClientOptionsT } from "../arboretum-client";
2
+ import { ContentfulClientT, StatusT } from "../clients/contentful-client/contentful-client";
3
+ import { SitemapDataT } from "./data/sitemap-data";
4
+ import { Either } from "../utils/fp-utils";
5
+ export type LocaleCodeT = string;
6
+ export type SysIdT = string;
7
+ export type MetadataT = {
8
+ tags: Array<{
9
+ sys: {
10
+ id: string;
11
+ };
12
+ }>;
13
+ };
14
+ export type PageT = {
15
+ type: "page";
16
+ sys: {
17
+ id: string;
18
+ cmaOnlyStatus?: StatusT;
19
+ };
20
+ metadata?: MetadataT;
21
+ parent: {
22
+ sys: {
23
+ id: string;
24
+ };
25
+ } | undefined;
26
+ path: string;
27
+ slug: string;
28
+ title?: string;
29
+ childPages: Array<{
30
+ sys: {
31
+ id: string;
32
+ };
33
+ }>;
34
+ };
35
+ export type RedirectT = {
36
+ sys: {
37
+ id: string;
38
+ cmaOnlyStatus?: StatusT;
39
+ };
40
+ parent: {
41
+ sys: {
42
+ id: string;
43
+ };
44
+ };
45
+ metadata?: MetadataT;
46
+ path: string;
47
+ title?: string;
48
+ type: "redirect" | "alias";
49
+ page: {
50
+ sys: {
51
+ id: string;
52
+ };
53
+ };
54
+ };
55
+ export type RedirectIdT = RedirectT["sys"]["id"];
56
+ export type RedirectPathT = RedirectT["path"];
57
+ export type PageIdT = (PageT | RedirectT)["sys"]["id"];
58
+ export type PagePathT = (PageT | RedirectT)["path"];
59
+ export type TagIdT = string;
60
+ export type LocalizedSitemapT = {
61
+ root: {
62
+ sys: {
63
+ id: string;
64
+ };
65
+ };
66
+ sitemap: Map<PageIdT, PageT | RedirectT>;
67
+ pageIdByPath: Map<PagePathT, PageIdT>;
68
+ };
69
+ export type SitemapT = Map<LocaleCodeT, Either<string, LocalizedSitemapT>>;
70
+ export type PagesByTagIdV = Either<string, Map<TagIdT, Array<{
71
+ sys: {
72
+ id: SysIdT;
73
+ };
74
+ }>>>;
75
+ export type PagesByTagIdT = Map<LocaleCodeT, PagesByTagIdV>;
76
+ export type CachedDataT = Pick<ArboretumClientCtx, "data" | "pagesByTagId" | "sitemap">;
77
+ export type ArboretumClientCtx = {
78
+ preview: boolean;
79
+ contentfulClientType: ArboretumClientConfigT["type"];
80
+ lastUpdatedAt: string;
81
+ clientApi: ContentfulClientT;
82
+ cmaPreviewClientApi?: ContentfulClientT;
83
+ options: ArboretumClientOptionsT;
84
+ data: SitemapDataT;
85
+ sitemap: SitemapT;
86
+ pagesByTagId: PagesByTagIdT;
87
+ localeTagIdPrefix: string;
88
+ pageTagIdPrefix: string;
89
+ pageHomeTagId: string;
90
+ regenerationInProgress: boolean;
91
+ };
92
+ export declare const createArboretumClient: (config: ArboretumClientConfigT) => Promise<{
93
+ client: ArboretumClientT;
94
+ warnings?: Array<string>;
95
+ }>;
96
+ export declare const createArboretumClientFromCdaClient: (config: Pick<ArboretumClientConfigFromCdaT, "contentful" | "preview" | "options">) => Promise<{
97
+ client: ArboretumClientT;
98
+ warnings?: string[] | undefined;
99
+ }>;
100
+ export declare const createArboretumClientFromCdaParams: (config: Pick<ArboretumClientConfigFromCdaParamsT, "contentful" | "preview" | "options">) => Promise<{
101
+ client: ArboretumClientT;
102
+ warnings?: string[] | undefined;
103
+ }>;
104
+ export declare const createArboretumClientFromCma: (config: Pick<ArboretumClientConfigFromCmaT, "contentful" | "preview" | "options">) => Promise<{
105
+ client: ArboretumClientT;
106
+ warnings?: string[] | undefined;
107
+ }>;
@@ -0,0 +1,11 @@
1
+ import { ArboretumClientCtx, SysIdT } from '../arboretum-client.impl';
2
+ import { ContentTypeT } from '../../clients/contentful-client/contentful-client';
3
+ export type ContentTypesT = Map<SysIdT, Pick<ContentTypeT, 'sys'> & {
4
+ fields: Map<SysIdT, ContentTypeT['fields'][number]>;
5
+ }>;
6
+ type ContentTypesR = {
7
+ contentTypes: ContentTypesT;
8
+ warnings?: Array<string>;
9
+ };
10
+ export declare const contentTypes: (ctx: Pick<ArboretumClientCtx, 'clientApi' | 'options'>) => Promise<ContentTypesR>;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ArboretumClientCtx } from '../../../arboretum-client.impl';
2
+ export declare const mockedEntrySysId: (contentType: string, idx: number) => string;
3
+ export declare const mockedContentfulEntriesClientApi: (contentType: string, total: number) => Pick<ArboretumClientCtx['clientApi'], 'getEntries'>;
4
+ export declare const multipleContentTypesMockedContentfulEntriesClientApi: (contentTypes: Array<{
5
+ contentType: string;
6
+ total: number;
7
+ }>) => Pick<ArboretumClientCtx['clientApi'], 'getEntries'>;
@@ -0,0 +1,2 @@
1
+ import { EntryT, StatusT } from "../../../clients/contentful-client/contentful-client";
2
+ export declare const entryStatus: (sys: Pick<EntryT["sys"], "archivedVersion" | "version" | "publishedVersion">) => StatusT | undefined;
@@ -0,0 +1,6 @@
1
+ import { EntryT } from "../../../clients/contentful-client/contentful-client";
2
+ import { ArboretumClientCtx, SysIdT } from "../../arboretum-client.impl";
3
+ export type PagesT = {
4
+ [sys: SysIdT]: EntryT;
5
+ };
6
+ export declare const getAllEntriesRecursively: ({ getEntries }: Pick<ArboretumClientCtx["clientApi"], "getEntries">, contentType: string, skip: number, acc: Array<EntryT>, select?: string, refFieldsToFilterOut?: Array<string>, limit?: number) => Promise<Array<EntryT>>;
@@ -0,0 +1,15 @@
1
+ import { EntryT } from '../../../clients/contentful-client/contentful-client';
2
+ import { ArboretumClientCtx, LocaleCodeT, SysIdT, TagIdT } from '../../arboretum-client.impl';
3
+ import { LocalesT } from '../locales';
4
+ export type HomePagesByTagIdT = {
5
+ homePagesByTagId: Map<LocaleCodeT, Map<TagIdT, Array<{
6
+ sys: {
7
+ id: SysIdT;
8
+ };
9
+ }>>>;
10
+ warnings?: Array<string>;
11
+ };
12
+ export declare const homePagesByTagId: (ctx: Pick<ArboretumClientCtx, 'localeTagIdPrefix' | 'pageHomeTagId'>, locales: LocalesT, entries: Array<{
13
+ metadata?: EntryT['metadata'];
14
+ sys: Pick<EntryT['sys'], 'id'>;
15
+ }>) => HomePagesByTagIdT;
@@ -0,0 +1,2 @@
1
+ import { EntryT } from '../../../clients/contentful-client/contentful-client';
2
+ export declare const localeCodesFromMetadata: (localeTagIdPrefix: string, metadata: EntryT['metadata']) => Array<string>;
@@ -0,0 +1,3 @@
1
+ export declare const parseLocaleTag: (localeTagIdPrefix: string) => (tagId: string) => {
2
+ localeCode: string;
3
+ } | undefined;
@@ -0,0 +1,5 @@
1
+ import { ArboretumClientContentfulConfigOptionsT } from "../../../arboretum-client";
2
+ import { ContentTypeT } from "../../../clients/contentful-client/contentful-client";
3
+ import { Either } from "../../../utils/fp-utils";
4
+ export declare const validatePageContentType: (pageContentTypeConfig: ArboretumClientContentfulConfigOptionsT["pageContentTypes"][string]) => (contentType: ContentTypeT) => Either<string, ContentTypeT>;
5
+ export declare const validateRedirectContentType: (redirectContentTypeConfig: Pick<NonNullable<ArboretumClientContentfulConfigOptionsT["redirectContentType"]>, "pageFieldId" | "pathFieldId" | "titleFieldId" | "typeFieldId">) => (contentType: ContentTypeT) => Either<string, ContentTypeT>;
@@ -0,0 +1,3 @@
1
+ import { ArboretumClientCtx } from "../arboretum-client.impl";
2
+ import { EntryT } from "../../clients/contentful-client/contentful-client";
3
+ export declare const homePages: (ctx: Pick<ArboretumClientCtx, "clientApi" | "localeTagIdPrefix" | "contentfulClientType">, homePageTagId: string) => Promise<Array<EntryT>>;
@@ -0,0 +1,10 @@
1
+ import { Either } from "../../utils/fp-utils";
2
+ import { ArboretumClientCtx, LocaleCodeT } from "../arboretum-client.impl";
3
+ import { LocaleT } from "../../clients/contentful-client/contentful-client";
4
+ export type LocalesT = {
5
+ locales: Map<LocaleCodeT, LocaleT>;
6
+ defaultLocaleCode: string;
7
+ };
8
+ type LocalesR = Either<string, LocalesT>;
9
+ export declare const locales: (ctx: Pick<ArboretumClientCtx, "clientApi" | "options">) => Promise<LocalesR>;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ArboretumClientCtx } from "../arboretum-client.impl";
2
+ import { EntriesT } from "./sitemap-data";
3
+ export declare const pageEntries: (ctx: Pick<ArboretumClientCtx, "options" | "contentfulClientType" | "preview">, apiClient: Pick<ArboretumClientCtx["clientApi"], "getEntries">, cmaPreviewClientApi?: Pick<NonNullable<ArboretumClientCtx["cmaPreviewClientApi"]>, "getEntries">) => Promise<EntriesT>;
@@ -0,0 +1 @@
1
+ export {};