@cavuno/board 3.1.0 → 4.0.0

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 (77) hide show
  1. package/CHANGELOG.md +421 -0
  2. package/README.md +6 -2
  3. package/dist/{_spec-nkWAraS0.d.mts → _spec-GVe6WAfT.d.mts} +68 -59
  4. package/dist/{_spec-nkWAraS0.d.ts → _spec-GVe6WAfT.d.ts} +68 -59
  5. package/dist/bin.mjs +7 -2
  6. package/dist/blog-BsmKizpd.d.ts +29 -0
  7. package/dist/blog-Cf64mI8A.d.mts +29 -0
  8. package/dist/{salaries-BahBpxWT.d.ts → board-DUhgiacm.d.ts} +17 -29
  9. package/dist/{salaries-ChSqDBAM.d.mts → board-GGWJ4coe.d.mts} +17 -29
  10. package/dist/breadcrumbs-DFKr0HzU.d.mts +372 -0
  11. package/dist/breadcrumbs-DiccJhk4.d.ts +372 -0
  12. package/dist/chunk-2ETP5UH4.mjs +271 -0
  13. package/dist/chunk-BGKNXG4H.mjs +146 -0
  14. package/dist/chunk-DLSO6XXY.mjs +33 -0
  15. package/dist/chunk-T2KC6XGV.mjs +1060 -0
  16. package/dist/chunk-YEAQ3JEI.mjs +853 -0
  17. package/dist/doctor.js +1 -1
  18. package/dist/doctor.mjs +1 -1
  19. package/dist/filters.d.mts +25 -20
  20. package/dist/filters.d.ts +25 -20
  21. package/dist/filters.js +3 -692
  22. package/dist/filters.mjs +3 -690
  23. package/dist/format.d.mts +57 -230
  24. package/dist/format.d.ts +57 -230
  25. package/dist/format.js +355 -927
  26. package/dist/format.mjs +213 -931
  27. package/dist/go.js +11 -1
  28. package/dist/go.mjs +4 -29
  29. package/dist/index.d.mts +23 -75
  30. package/dist/index.d.ts +23 -75
  31. package/dist/index.js +11 -36
  32. package/dist/index.mjs +32 -313
  33. package/dist/{jobs-lVvKCBCU.d.mts → jobs-BuLpV8iy.d.mts} +4 -4
  34. package/dist/{jobs-BiEvL9d7.d.ts → jobs-QrbXOYB9.d.ts} +4 -4
  35. package/dist/paths.d.mts +89 -1
  36. package/dist/paths.d.ts +89 -1
  37. package/dist/paths.js +62 -14
  38. package/dist/paths.mjs +29 -78
  39. package/dist/route-contract.js +23 -13
  40. package/dist/route-contract.mjs +30 -1079
  41. package/dist/{search-CCyFWPi3.d.mts → search-Cr4noJJZ.d.mts} +14 -3
  42. package/dist/{search-CyRvVMUp.d.ts → search-DdsniXQv.d.ts} +14 -3
  43. package/dist/seo.d.mts +33 -189
  44. package/dist/seo.d.ts +33 -189
  45. package/dist/seo.js +197 -718
  46. package/dist/seo.mjs +44 -1417
  47. package/dist/server.d.mts +5 -5
  48. package/dist/server.d.ts +5 -5
  49. package/dist/server.mjs +5 -31
  50. package/dist/sitemap.d.mts +5 -5
  51. package/dist/sitemap.d.ts +5 -5
  52. package/dist/sitemap.js +25 -14
  53. package/dist/sitemap.mjs +22 -97
  54. package/dist/skills.js +1 -1
  55. package/dist/skills.mjs +1 -1
  56. package/dist/suggest.d.mts +2 -2
  57. package/dist/suggest.d.ts +2 -2
  58. package/dist/suggest.js +17 -3
  59. package/dist/suggest.mjs +17 -3
  60. package/dist/well-known.js +23 -13
  61. package/dist/well-known.mjs +4 -421
  62. package/package.json +5 -4
  63. package/skills/cavuno-board-applications/SKILL.md +4 -1
  64. package/skills/cavuno-board-filters/SKILL.md +11 -12
  65. package/skills/cavuno-board-format/SKILL.md +68 -56
  66. package/skills/cavuno-board-i18n/SKILL.md +102 -21
  67. package/skills/cavuno-board-search-suggestions/SKILL.md +8 -3
  68. package/skills/cavuno-board-seo/BLOG.md +4 -1
  69. package/skills/cavuno-board-seo/JOB_AND_BREADCRUMBS.md +5 -2
  70. package/skills/cavuno-board-seo/LISTING.md +35 -12
  71. package/skills/cavuno-board-seo/SALARY.md +83 -18
  72. package/skills/cavuno-board-seo/SKILL.md +3 -2
  73. package/skills/manifest.json +3 -3
  74. package/dist/board-NE98PlwN.d.ts +0 -16
  75. package/dist/board-muu8BI8P.d.mts +0 -16
  76. package/dist/ui-copy-CCkz6CVF.d.mts +0 -230
  77. package/dist/ui-copy-CCkz6CVF.d.ts +0 -230
@@ -0,0 +1,146 @@
1
+ // src/paths/index.ts
2
+ function encodePathSegment(segment) {
3
+ try {
4
+ return encodeURIComponent(decodeURIComponent(segment)).replace(
5
+ /%3A/gi,
6
+ ":"
7
+ );
8
+ } catch {
9
+ return encodeURIComponent(segment).replace(/%3A/gi, ":");
10
+ }
11
+ }
12
+ function jobDetailPath(companySlug, jobSlug) {
13
+ return `/companies/${encodePathSegment(companySlug)}/jobs/${encodePathSegment(jobSlug)}`;
14
+ }
15
+ function jobsCategoryPath(categorySlug) {
16
+ return `/jobs/${encodePathSegment(categorySlug)}`;
17
+ }
18
+ function jobsSkillPath(skillSlug) {
19
+ return `/jobs/skills/${encodePathSegment(skillSlug)}`;
20
+ }
21
+ function jobsLocationPath(placeSlug) {
22
+ return `/jobs/locations/${encodePathSegment(placeSlug)}`;
23
+ }
24
+ function jobsLocationCategoryPath(placeSlug, categorySlug) {
25
+ return `${jobsLocationPath(placeSlug)}/${encodePathSegment(categorySlug)}`;
26
+ }
27
+ function jobsLocationSkillPath(placeSlug, skillSlug) {
28
+ return `${jobsLocationPath(placeSlug)}/skills/${encodePathSegment(skillSlug)}`;
29
+ }
30
+ function companyPath(companySlug) {
31
+ return `/companies/${encodePathSegment(companySlug)}`;
32
+ }
33
+ function companyMarketPath(marketSlug) {
34
+ return `/companies/markets/${encodePathSegment(marketSlug)}`;
35
+ }
36
+ function suggestionPath(suggestion, options) {
37
+ const location = options.location?.trim() || void 0;
38
+ if (options.scope === "blog") {
39
+ if (suggestion.type === "post") {
40
+ return blogPostPath(suggestion.slug);
41
+ }
42
+ if (suggestion.type === "tag") {
43
+ return blogTagPath(suggestion.slug);
44
+ }
45
+ return null;
46
+ }
47
+ if (options.scope === "jobs") {
48
+ if (suggestion.type === "company" || suggestion.type === "market" || suggestion.type === "post" || suggestion.type === "tag") {
49
+ return null;
50
+ }
51
+ if (suggestion.termType === "skill") {
52
+ return location ? jobsLocationSkillPath(location, suggestion.canonicalSlug) : jobsSkillPath(suggestion.canonicalSlug);
53
+ }
54
+ return location ? jobsLocationCategoryPath(location, suggestion.canonicalSlug) : jobsCategoryPath(suggestion.canonicalSlug);
55
+ }
56
+ if (suggestion.type === "company") {
57
+ return companyPath(suggestion.slug);
58
+ }
59
+ if (suggestion.type === "market") {
60
+ return companyMarketPath(suggestion.slug);
61
+ }
62
+ return null;
63
+ }
64
+ function companySalaryPath(companySlug) {
65
+ return `/companies/${encodePathSegment(companySlug)}/salaries`;
66
+ }
67
+ function salaryTitlePath(titleSlug) {
68
+ return `/salaries/titles/${encodePathSegment(titleSlug)}`;
69
+ }
70
+ function salarySkillPath(skillSlug) {
71
+ return `/salaries/skills/${encodePathSegment(skillSlug)}`;
72
+ }
73
+ function salaryLocationPath(placeSlug) {
74
+ return `/salaries/locations/${encodePathSegment(placeSlug)}`;
75
+ }
76
+ function blogPostPath(postSlug) {
77
+ return `/blog/${encodePathSegment(postSlug)}`;
78
+ }
79
+ function blogTagPath(tagSlug) {
80
+ return `/blog/tag/${encodePathSegment(tagSlug)}`;
81
+ }
82
+ function blogAuthorPath(authorSlug) {
83
+ return `/blog/author/${encodePathSegment(authorSlug)}`;
84
+ }
85
+ var BOARD_PATHS = {
86
+ home: "/",
87
+ jobs: "/jobs",
88
+ companies: "/companies",
89
+ salaries: "/salaries",
90
+ salaryCompanies: "/salaries/companies",
91
+ salaryTitles: "/salaries/titles",
92
+ salarySkills: "/salaries/skills",
93
+ salaryLocations: "/salaries/locations",
94
+ blog: "/blog",
95
+ about: "/about",
96
+ privacyPolicy: "/privacy-policy",
97
+ termsOfService: "/terms-of-service",
98
+ cookiePolicy: "/cookie-policy",
99
+ impressum: "/impressum",
100
+ talent: "/talent",
101
+ employers: "/employers",
102
+ /**
103
+ * Alert-email surfaces. Promoted out of raw literals in
104
+ * the job-alerts composer so /go indirection and email composition share
105
+ * one definition.
106
+ */
107
+ alertsManage: "/alerts/manage",
108
+ alertsConfirm: "/alerts/confirm"
109
+ };
110
+ function goJobPath(jobId) {
111
+ return `/go/job/${jobId}`;
112
+ }
113
+ function goAlertsManagePath() {
114
+ return "/go/alerts-manage";
115
+ }
116
+ function goAlertsConfirmPath() {
117
+ return "/go/alerts-confirm";
118
+ }
119
+ function boardUrl(origin, path) {
120
+ return `${origin.replace(/\/+$/, "")}${path}`;
121
+ }
122
+
123
+ export {
124
+ encodePathSegment,
125
+ jobDetailPath,
126
+ jobsCategoryPath,
127
+ jobsSkillPath,
128
+ jobsLocationPath,
129
+ jobsLocationCategoryPath,
130
+ jobsLocationSkillPath,
131
+ companyPath,
132
+ companyMarketPath,
133
+ suggestionPath,
134
+ companySalaryPath,
135
+ salaryTitlePath,
136
+ salarySkillPath,
137
+ salaryLocationPath,
138
+ blogPostPath,
139
+ blogTagPath,
140
+ blogAuthorPath,
141
+ BOARD_PATHS,
142
+ goJobPath,
143
+ goAlertsManagePath,
144
+ goAlertsConfirmPath,
145
+ boardUrl
146
+ };
@@ -0,0 +1,33 @@
1
+ // src/pagination.ts
2
+ function paginate(listFn, query, options) {
3
+ async function* pages() {
4
+ let current = query;
5
+ for (; ; ) {
6
+ const page = await listFn(current, options);
7
+ yield page;
8
+ if (!page.hasMore || page.nextCursor === null) return;
9
+ const { offset: _offset, ...rest } = current ?? {};
10
+ current = { ...rest, cursor: page.nextCursor };
11
+ }
12
+ }
13
+ return {
14
+ pages,
15
+ async *[Symbol.asyncIterator]() {
16
+ for await (const page of pages()) {
17
+ yield* page.data;
18
+ }
19
+ },
20
+ async toArray({ limit }) {
21
+ const items = [];
22
+ for await (const page of pages()) {
23
+ items.push(...page.data);
24
+ if (items.length >= limit) break;
25
+ }
26
+ return items.slice(0, limit);
27
+ }
28
+ };
29
+ }
30
+
31
+ export {
32
+ paginate
33
+ };