@cavuno/board 1.41.0 → 1.43.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.
- package/dist/{_spec-l_596ZwW.d.mts → _spec-DQ2GR9lq.d.mts} +48 -1
- package/dist/{_spec-l_596ZwW.d.ts → _spec-DQ2GR9lq.d.ts} +48 -1
- package/dist/{board-CyHA6rRP.d.mts → board-ComPm8FD.d.mts} +1 -1
- package/dist/{board-BzK5j73O.d.ts → board-DpBlk05S.d.ts} +1 -1
- package/dist/filters.d.mts +2 -2
- package/dist/filters.d.ts +2 -2
- package/dist/format.d.mts +3 -3
- package/dist/format.d.ts +3 -3
- package/dist/go.d.mts +65 -0
- package/dist/go.d.ts +65 -0
- package/dist/go.js +130 -0
- package/dist/go.mjs +107 -0
- package/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{jobs-CXudz1Y4.d.ts → jobs-BlnV6hmC.d.ts} +1 -1
- package/dist/{jobs-BhthvMkA.d.mts → jobs-DqujLqGk.d.mts} +1 -1
- package/dist/paths.d.mts +25 -1
- package/dist/paths.d.ts +25 -1
- package/dist/paths.js +20 -1
- package/dist/paths.mjs +20 -1
- package/dist/roles-vY0AXhoc.d.mts +82 -0
- package/dist/roles-vY0AXhoc.d.ts +82 -0
- package/dist/route-contract.d.mts +257 -0
- package/dist/route-contract.d.ts +257 -0
- package/dist/route-contract.js +1131 -0
- package/dist/route-contract.mjs +1108 -0
- package/dist/{salaries-Dr_Zugal.d.mts → salaries-CNJVapW5.d.mts} +2 -2
- package/dist/{salaries-ByBuHCLH.d.ts → salaries-DzM7rbXp.d.ts} +2 -2
- package/dist/{search-DZrq-k76.d.ts → search-B1GtdfAm.d.ts} +1 -1
- package/dist/{search-CrIlXSJP.d.mts → search-CnRMApws.d.mts} +1 -1
- package/dist/seo.d.mts +4 -4
- package/dist/seo.d.ts +4 -4
- package/dist/server.d.mts +5 -5
- package/dist/server.d.ts +5 -5
- package/dist/sitemap.d.mts +5 -5
- package/dist/sitemap.d.ts +5 -5
- package/dist/sitemap.js +8 -1
- package/dist/sitemap.mjs +8 -1
- package/dist/suggest.d.mts +2 -2
- package/dist/suggest.d.ts +2 -2
- package/dist/well-known.d.mts +113 -0
- package/dist/well-known.d.ts +113 -0
- package/dist/well-known.js +561 -0
- package/dist/well-known.mjs +538 -0
- package/package.json +31 -1
- package/skills/manifest.json +1 -1
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/well-known/index.ts
|
|
21
|
+
var well_known_exports = {};
|
|
22
|
+
__export(well_known_exports, {
|
|
23
|
+
WELL_KNOWN_CACHE_CONTROL: () => WELL_KNOWN_CACHE_CONTROL,
|
|
24
|
+
WELL_KNOWN_CONTENT_TYPE: () => WELL_KNOWN_CONTENT_TYPE,
|
|
25
|
+
WELL_KNOWN_MANIFEST_PATH: () => WELL_KNOWN_MANIFEST_PATH,
|
|
26
|
+
createWellKnownHandler: () => createWellKnownHandler,
|
|
27
|
+
emitWellKnownManifest: () => emitWellKnownManifest,
|
|
28
|
+
routeEntriesFromTanStackRouteTree: () => routeEntriesFromTanStackRouteTree,
|
|
29
|
+
serializeManifest: () => serializeManifest,
|
|
30
|
+
tanStackPathToUrlPattern: () => tanStackPathToUrlPattern
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(well_known_exports);
|
|
33
|
+
|
|
34
|
+
// src/paths/index.ts
|
|
35
|
+
function jobDetailPath(companySlug, jobSlug) {
|
|
36
|
+
return `/companies/${companySlug}/jobs/${jobSlug}`;
|
|
37
|
+
}
|
|
38
|
+
function jobsCategoryPath(categorySlug) {
|
|
39
|
+
return `/jobs/${categorySlug}`;
|
|
40
|
+
}
|
|
41
|
+
function jobsSkillPath(skillSlug) {
|
|
42
|
+
return `/jobs/skills/${skillSlug}`;
|
|
43
|
+
}
|
|
44
|
+
function jobsLocationPath(placeSlug) {
|
|
45
|
+
return `/jobs/locations/${placeSlug}`;
|
|
46
|
+
}
|
|
47
|
+
function companyPath(companySlug) {
|
|
48
|
+
return `/companies/${companySlug}`;
|
|
49
|
+
}
|
|
50
|
+
function companyMarketPath(marketSlug) {
|
|
51
|
+
return `/companies/markets/${marketSlug}`;
|
|
52
|
+
}
|
|
53
|
+
function companySalaryPath(companySlug) {
|
|
54
|
+
return `/companies/${companySlug}/salaries`;
|
|
55
|
+
}
|
|
56
|
+
function salaryTitlePath(titleSlug) {
|
|
57
|
+
return `/salaries/titles/${titleSlug}`;
|
|
58
|
+
}
|
|
59
|
+
function salarySkillPath(skillSlug) {
|
|
60
|
+
return `/salaries/skills/${skillSlug}`;
|
|
61
|
+
}
|
|
62
|
+
function salaryLocationPath(placeSlug) {
|
|
63
|
+
return `/salaries/locations/${placeSlug}`;
|
|
64
|
+
}
|
|
65
|
+
function blogPostPath(postSlug) {
|
|
66
|
+
return `/blog/${postSlug}`;
|
|
67
|
+
}
|
|
68
|
+
function blogTagPath(tagSlug) {
|
|
69
|
+
return `/blog/tag/${tagSlug}`;
|
|
70
|
+
}
|
|
71
|
+
function blogAuthorPath(authorSlug) {
|
|
72
|
+
return `/blog/author/${authorSlug}`;
|
|
73
|
+
}
|
|
74
|
+
var BOARD_PATHS = {
|
|
75
|
+
home: "/",
|
|
76
|
+
jobs: "/jobs",
|
|
77
|
+
companies: "/companies",
|
|
78
|
+
salaries: "/salaries",
|
|
79
|
+
salaryCompanies: "/salaries/companies",
|
|
80
|
+
salaryTitles: "/salaries/titles",
|
|
81
|
+
salarySkills: "/salaries/skills",
|
|
82
|
+
salaryLocations: "/salaries/locations",
|
|
83
|
+
blog: "/blog",
|
|
84
|
+
about: "/about",
|
|
85
|
+
privacyPolicy: "/privacy-policy",
|
|
86
|
+
termsOfService: "/terms-of-service",
|
|
87
|
+
cookiePolicy: "/cookie-policy",
|
|
88
|
+
impressum: "/impressum",
|
|
89
|
+
talent: "/talent",
|
|
90
|
+
employers: "/employers",
|
|
91
|
+
/**
|
|
92
|
+
* Alert-email surfaces (ADR-0090 D1/D4). Promoted out of raw literals in
|
|
93
|
+
* the job-alerts composer so /go indirection and email composition share
|
|
94
|
+
* one definition.
|
|
95
|
+
*/
|
|
96
|
+
alertsManage: "/alerts/manage",
|
|
97
|
+
alertsConfirm: "/alerts/confirm"
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// src/route-contract/roles.ts
|
|
101
|
+
var ROLE_PARAM_REGISTRY = {
|
|
102
|
+
jobDetail: ["companySlug", "jobSlug"],
|
|
103
|
+
jobsCategory: ["categorySlug"],
|
|
104
|
+
jobsSkill: ["skillSlug"],
|
|
105
|
+
jobsLocation: ["placeSlug"],
|
|
106
|
+
company: ["companySlug"],
|
|
107
|
+
companyMarket: ["marketSlug"],
|
|
108
|
+
companySalary: ["companySlug"],
|
|
109
|
+
salaryTitle: ["titleSlug"],
|
|
110
|
+
salarySkill: ["skillSlug"],
|
|
111
|
+
salaryLocation: ["placeSlug"],
|
|
112
|
+
blogPost: ["postSlug"],
|
|
113
|
+
blogTag: ["tagSlug"],
|
|
114
|
+
blogAuthor: ["authorSlug"],
|
|
115
|
+
home: [],
|
|
116
|
+
jobs: [],
|
|
117
|
+
companies: [],
|
|
118
|
+
salaries: [],
|
|
119
|
+
salaryCompanies: [],
|
|
120
|
+
salaryTitles: [],
|
|
121
|
+
salarySkills: [],
|
|
122
|
+
salaryLocations: [],
|
|
123
|
+
blog: [],
|
|
124
|
+
about: [],
|
|
125
|
+
privacyPolicy: [],
|
|
126
|
+
termsOfService: [],
|
|
127
|
+
cookiePolicy: [],
|
|
128
|
+
impressum: [],
|
|
129
|
+
talent: [],
|
|
130
|
+
employers: [],
|
|
131
|
+
alertsManage: [],
|
|
132
|
+
alertsConfirm: []
|
|
133
|
+
};
|
|
134
|
+
var REQUIRED_ROLES = [
|
|
135
|
+
"jobDetail",
|
|
136
|
+
"alertsManage",
|
|
137
|
+
"alertsConfirm"
|
|
138
|
+
];
|
|
139
|
+
var ALL_ROLES = Object.keys(
|
|
140
|
+
ROLE_PARAM_REGISTRY
|
|
141
|
+
);
|
|
142
|
+
var ROLE_SET = new Set(ALL_ROLES);
|
|
143
|
+
var CANONICAL_MANIFEST = {
|
|
144
|
+
version: 1,
|
|
145
|
+
roles: {
|
|
146
|
+
jobDetail: jobDetailPath(":companySlug", ":jobSlug"),
|
|
147
|
+
jobsCategory: jobsCategoryPath(":categorySlug"),
|
|
148
|
+
jobsSkill: jobsSkillPath(":skillSlug"),
|
|
149
|
+
jobsLocation: jobsLocationPath(":placeSlug"),
|
|
150
|
+
company: companyPath(":companySlug"),
|
|
151
|
+
companyMarket: companyMarketPath(":marketSlug"),
|
|
152
|
+
companySalary: companySalaryPath(":companySlug"),
|
|
153
|
+
salaryTitle: salaryTitlePath(":titleSlug"),
|
|
154
|
+
salarySkill: salarySkillPath(":skillSlug"),
|
|
155
|
+
salaryLocation: salaryLocationPath(":placeSlug"),
|
|
156
|
+
blogPost: blogPostPath(":postSlug"),
|
|
157
|
+
blogTag: blogTagPath(":tagSlug"),
|
|
158
|
+
blogAuthor: blogAuthorPath(":authorSlug"),
|
|
159
|
+
home: BOARD_PATHS.home,
|
|
160
|
+
jobs: BOARD_PATHS.jobs,
|
|
161
|
+
companies: BOARD_PATHS.companies,
|
|
162
|
+
salaries: BOARD_PATHS.salaries,
|
|
163
|
+
salaryCompanies: BOARD_PATHS.salaryCompanies,
|
|
164
|
+
salaryTitles: BOARD_PATHS.salaryTitles,
|
|
165
|
+
salarySkills: BOARD_PATHS.salarySkills,
|
|
166
|
+
salaryLocations: BOARD_PATHS.salaryLocations,
|
|
167
|
+
blog: BOARD_PATHS.blog,
|
|
168
|
+
about: BOARD_PATHS.about,
|
|
169
|
+
privacyPolicy: BOARD_PATHS.privacyPolicy,
|
|
170
|
+
termsOfService: BOARD_PATHS.termsOfService,
|
|
171
|
+
cookiePolicy: BOARD_PATHS.cookiePolicy,
|
|
172
|
+
impressum: BOARD_PATHS.impressum,
|
|
173
|
+
talent: BOARD_PATHS.talent,
|
|
174
|
+
employers: BOARD_PATHS.employers,
|
|
175
|
+
alertsManage: "/alerts/manage",
|
|
176
|
+
alertsConfirm: "/alerts/confirm"
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// src/route-contract/params.ts
|
|
181
|
+
function extractParamNames(template) {
|
|
182
|
+
const names = [];
|
|
183
|
+
const re = /:([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
184
|
+
let match;
|
|
185
|
+
while ((match = re.exec(template)) !== null) {
|
|
186
|
+
const name = match[1];
|
|
187
|
+
if (name !== void 0) names.push(name);
|
|
188
|
+
}
|
|
189
|
+
return names;
|
|
190
|
+
}
|
|
191
|
+
function sameParamSet(a, b) {
|
|
192
|
+
if (a.length !== b.length) return false;
|
|
193
|
+
const sortedA = [...a].sort();
|
|
194
|
+
const sortedB = [...b].sort();
|
|
195
|
+
for (let i = 0; i < sortedA.length; i++) {
|
|
196
|
+
if (sortedA[i] !== sortedB[i]) return false;
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
function paramSetKey(params) {
|
|
201
|
+
return [...params].sort().join("\0");
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// src/route-contract/classify.ts
|
|
205
|
+
var SHARED_SIGNATURE_COUNTS = (() => {
|
|
206
|
+
const counts = /* @__PURE__ */ new Map();
|
|
207
|
+
for (const role of ALL_ROLES) {
|
|
208
|
+
const params = ROLE_PARAM_REGISTRY[role];
|
|
209
|
+
if (params.length === 0) continue;
|
|
210
|
+
const key = paramSetKey(params);
|
|
211
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
212
|
+
}
|
|
213
|
+
return counts;
|
|
214
|
+
})();
|
|
215
|
+
function isSignatureCandidate(route, role) {
|
|
216
|
+
const registry = ROLE_PARAM_REGISTRY[role];
|
|
217
|
+
const routeParams = extractParamNames(route.template);
|
|
218
|
+
if (registry.length === 0) {
|
|
219
|
+
return route.template === CANONICAL_MANIFEST.roles[role];
|
|
220
|
+
}
|
|
221
|
+
if (!sameParamSet(routeParams, registry)) return false;
|
|
222
|
+
const shareCount = SHARED_SIGNATURE_COUNTS.get(paramSetKey(registry)) ?? 0;
|
|
223
|
+
if (shareCount > 1) {
|
|
224
|
+
return route.template === CANONICAL_MANIFEST.roles[role];
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
function classifyRoutes(routes, markers) {
|
|
229
|
+
const assignments = {};
|
|
230
|
+
const ambiguities = [];
|
|
231
|
+
const claimed = /* @__PURE__ */ new Set();
|
|
232
|
+
if (markers && markers.size > 0) {
|
|
233
|
+
const claimsByRole = /* @__PURE__ */ new Map();
|
|
234
|
+
for (const route of routes) {
|
|
235
|
+
if (route.sourcePath === void 0) continue;
|
|
236
|
+
const role = markers.get(route.sourcePath);
|
|
237
|
+
if (role === void 0) continue;
|
|
238
|
+
const list = claimsByRole.get(role);
|
|
239
|
+
if (list) list.push(route);
|
|
240
|
+
else claimsByRole.set(role, [route]);
|
|
241
|
+
}
|
|
242
|
+
for (const [role, candidates] of claimsByRole) {
|
|
243
|
+
for (const c of candidates) claimed.add(c);
|
|
244
|
+
if (candidates.length === 1) {
|
|
245
|
+
assignments[role] = candidates[0];
|
|
246
|
+
} else {
|
|
247
|
+
ambiguities.push({ role, candidates: [...candidates] });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const pool = routes.filter((r) => !claimed.has(r));
|
|
252
|
+
for (const role of ALL_ROLES) {
|
|
253
|
+
if (assignments[role] !== void 0) continue;
|
|
254
|
+
if (ambiguities.some((a) => a.role === role)) continue;
|
|
255
|
+
const candidates = pool.filter((r) => isSignatureCandidate(r, role));
|
|
256
|
+
if (candidates.length === 0) continue;
|
|
257
|
+
if (candidates.length === 1) {
|
|
258
|
+
const only = candidates[0];
|
|
259
|
+
if (claimed.has(only)) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
assignments[role] = only;
|
|
263
|
+
claimed.add(only);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
ambiguities.push({ role, candidates: [...candidates] });
|
|
267
|
+
}
|
|
268
|
+
const missingRequired = REQUIRED_ROLES.filter(
|
|
269
|
+
(role) => assignments[role] === void 0
|
|
270
|
+
);
|
|
271
|
+
return { assignments, ambiguities, missingRequired };
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/route-contract/validate.ts
|
|
275
|
+
var TEMPLATE_CHARSET_RE = /^[A-Za-z0-9/_.:-]+$/;
|
|
276
|
+
function checkRoleTemplate(role, template) {
|
|
277
|
+
const errors = [];
|
|
278
|
+
if (typeof template !== "string" || template.length === 0) {
|
|
279
|
+
errors.push({
|
|
280
|
+
code: "invalid_template",
|
|
281
|
+
message: `role '${role}' template must be a non-empty string`,
|
|
282
|
+
role
|
|
283
|
+
});
|
|
284
|
+
return errors;
|
|
285
|
+
}
|
|
286
|
+
if (!template.startsWith("/")) {
|
|
287
|
+
errors.push({
|
|
288
|
+
code: "invalid_template",
|
|
289
|
+
message: `role '${role}' template must start with '/', got ${JSON.stringify(template)}`,
|
|
290
|
+
role
|
|
291
|
+
});
|
|
292
|
+
return errors;
|
|
293
|
+
}
|
|
294
|
+
if (/\s/.test(template)) {
|
|
295
|
+
errors.push({
|
|
296
|
+
code: "invalid_template",
|
|
297
|
+
message: `role '${role}' template must not contain whitespace, got ${JSON.stringify(template)}`,
|
|
298
|
+
role
|
|
299
|
+
});
|
|
300
|
+
return errors;
|
|
301
|
+
}
|
|
302
|
+
if (template.includes("?") || template.includes("#")) {
|
|
303
|
+
errors.push({
|
|
304
|
+
code: "template_query_or_fragment",
|
|
305
|
+
message: `role '${role}' template must not contain '?' or '#', got ${JSON.stringify(template)}`,
|
|
306
|
+
role
|
|
307
|
+
});
|
|
308
|
+
return errors;
|
|
309
|
+
}
|
|
310
|
+
if (template.startsWith("//") || template.includes("//")) {
|
|
311
|
+
errors.push({
|
|
312
|
+
code: "template_double_slash",
|
|
313
|
+
message: `role '${role}' template must not contain '//', got ${JSON.stringify(template)}`,
|
|
314
|
+
role
|
|
315
|
+
});
|
|
316
|
+
return errors;
|
|
317
|
+
}
|
|
318
|
+
for (const seg of template.split("/")) {
|
|
319
|
+
if (seg === "." || seg === "..") {
|
|
320
|
+
errors.push({
|
|
321
|
+
code: "template_dot_segment",
|
|
322
|
+
message: `role '${role}' template must not contain '.' or '..' segments, got ${JSON.stringify(template)}`,
|
|
323
|
+
role
|
|
324
|
+
});
|
|
325
|
+
return errors;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (!TEMPLATE_CHARSET_RE.test(template)) {
|
|
329
|
+
errors.push({
|
|
330
|
+
code: "template_illegal_charset",
|
|
331
|
+
message: `role '${role}' template contains illegal characters, got ${JSON.stringify(template)}`,
|
|
332
|
+
role
|
|
333
|
+
});
|
|
334
|
+
return errors;
|
|
335
|
+
}
|
|
336
|
+
const registry = ROLE_PARAM_REGISTRY[role];
|
|
337
|
+
const tokens = extractParamNames(template);
|
|
338
|
+
if (registry.length === 0) {
|
|
339
|
+
if (tokens.length > 0) {
|
|
340
|
+
errors.push({
|
|
341
|
+
code: "static_has_params",
|
|
342
|
+
message: `static role '${role}' template must not contain ':' tokens, got ${template}`,
|
|
343
|
+
role,
|
|
344
|
+
token: tokens[0]
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
const registrySet = new Set(registry);
|
|
349
|
+
for (const token of tokens) {
|
|
350
|
+
if (!registrySet.has(token)) {
|
|
351
|
+
errors.push({
|
|
352
|
+
code: "unregistered_param",
|
|
353
|
+
message: `role '${role}' template references unregistered param ':${token}'`,
|
|
354
|
+
role,
|
|
355
|
+
token
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
const retained = tokens.filter((t) => registrySet.has(t));
|
|
360
|
+
if (retained.length === 0) {
|
|
361
|
+
errors.push({
|
|
362
|
+
code: "missing_entity_param",
|
|
363
|
+
message: `role '${role}' template must contain at least one registry param (${registry.join(", ")})`,
|
|
364
|
+
role
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return errors;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// src/route-contract/compile.ts
|
|
372
|
+
var REQUIRED_SET = new Set(REQUIRED_ROLES);
|
|
373
|
+
function compileManifest(routes, markers) {
|
|
374
|
+
const { assignments, ambiguities, missingRequired } = classifyRoutes(
|
|
375
|
+
routes,
|
|
376
|
+
markers
|
|
377
|
+
);
|
|
378
|
+
const roles = {};
|
|
379
|
+
const warnings = [];
|
|
380
|
+
const blocking = new Set(missingRequired);
|
|
381
|
+
for (const role of ALL_ROLES) {
|
|
382
|
+
const entry = assignments[role];
|
|
383
|
+
if (entry === void 0) continue;
|
|
384
|
+
const templateErrors = checkRoleTemplate(role, entry.template);
|
|
385
|
+
if (templateErrors.length > 0) {
|
|
386
|
+
const exact = templateErrors.map((e) => e.message).join("; ");
|
|
387
|
+
warnings.push(
|
|
388
|
+
`role '${role}' template rejected: ${exact} \u2014 add export const cavunoPage = '${role}' on the correct page or fix the template`
|
|
389
|
+
);
|
|
390
|
+
if (REQUIRED_SET.has(role)) {
|
|
391
|
+
blocking.add(role);
|
|
392
|
+
}
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
roles[role] = entry.template;
|
|
396
|
+
}
|
|
397
|
+
for (const amb of ambiguities) {
|
|
398
|
+
const kind = REQUIRED_SET.has(amb.role) ? "required" : "optional";
|
|
399
|
+
warnings.push(
|
|
400
|
+
`${kind} role '${amb.role}' is ambiguous \u2014 add export const cavunoPage = '${amb.role}' to disambiguate`
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
for (const role of ALL_ROLES) {
|
|
404
|
+
if (REQUIRED_SET.has(role)) continue;
|
|
405
|
+
if (roles[role] !== void 0) continue;
|
|
406
|
+
if (assignments[role] !== void 0) continue;
|
|
407
|
+
if (ambiguities.some((a) => a.role === role)) continue;
|
|
408
|
+
warnings.push(`optional role '${role}' is unassigned`);
|
|
409
|
+
}
|
|
410
|
+
return {
|
|
411
|
+
manifest: { version: 1, roles },
|
|
412
|
+
blockingMissing: REQUIRED_ROLES.filter((r) => blocking.has(r)),
|
|
413
|
+
warnings,
|
|
414
|
+
ambiguities
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// src/route-contract/resolve-links.ts
|
|
419
|
+
var REQUIRED_SET2 = new Set(REQUIRED_ROLES);
|
|
420
|
+
|
|
421
|
+
// src/route-contract/match-history.ts
|
|
422
|
+
var ROLE_INDEX_PATHS = {
|
|
423
|
+
jobDetail: BOARD_PATHS.jobs,
|
|
424
|
+
jobsCategory: BOARD_PATHS.jobs,
|
|
425
|
+
jobsSkill: BOARD_PATHS.jobs,
|
|
426
|
+
jobsLocation: BOARD_PATHS.jobs,
|
|
427
|
+
company: BOARD_PATHS.companies,
|
|
428
|
+
companyMarket: BOARD_PATHS.companies,
|
|
429
|
+
companySalary: BOARD_PATHS.companies,
|
|
430
|
+
salaryTitle: BOARD_PATHS.salaries,
|
|
431
|
+
salarySkill: BOARD_PATHS.salaries,
|
|
432
|
+
salaryLocation: BOARD_PATHS.salaries,
|
|
433
|
+
salaryCompanies: BOARD_PATHS.salaries,
|
|
434
|
+
salaryTitles: BOARD_PATHS.salaries,
|
|
435
|
+
salarySkills: BOARD_PATHS.salaries,
|
|
436
|
+
salaryLocations: BOARD_PATHS.salaries,
|
|
437
|
+
salaries: BOARD_PATHS.salaries,
|
|
438
|
+
blogPost: BOARD_PATHS.blog,
|
|
439
|
+
blogTag: BOARD_PATHS.blog,
|
|
440
|
+
blogAuthor: BOARD_PATHS.blog,
|
|
441
|
+
blog: BOARD_PATHS.blog,
|
|
442
|
+
home: BOARD_PATHS.home,
|
|
443
|
+
jobs: BOARD_PATHS.jobs,
|
|
444
|
+
companies: BOARD_PATHS.companies,
|
|
445
|
+
about: BOARD_PATHS.about,
|
|
446
|
+
privacyPolicy: BOARD_PATHS.privacyPolicy,
|
|
447
|
+
termsOfService: BOARD_PATHS.termsOfService,
|
|
448
|
+
cookiePolicy: BOARD_PATHS.cookiePolicy,
|
|
449
|
+
impressum: BOARD_PATHS.impressum,
|
|
450
|
+
talent: BOARD_PATHS.talent,
|
|
451
|
+
employers: BOARD_PATHS.employers,
|
|
452
|
+
alertsManage: BOARD_PATHS.home,
|
|
453
|
+
alertsConfirm: BOARD_PATHS.home
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
// src/well-known/handler.ts
|
|
457
|
+
var WELL_KNOWN_CACHE_CONTROL = "public, max-age=300";
|
|
458
|
+
var WELL_KNOWN_CONTENT_TYPE = "application/json";
|
|
459
|
+
function createWellKnownHandler(config) {
|
|
460
|
+
return async (_request) => {
|
|
461
|
+
try {
|
|
462
|
+
const routes = await resolveRoutes(config.routes);
|
|
463
|
+
const { manifest } = compileManifest(routes, config.markers);
|
|
464
|
+
const body = serializeManifest(manifest);
|
|
465
|
+
return new Response(body, {
|
|
466
|
+
status: 200,
|
|
467
|
+
headers: {
|
|
468
|
+
"content-type": WELL_KNOWN_CONTENT_TYPE,
|
|
469
|
+
"cache-control": WELL_KNOWN_CACHE_CONTROL
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
} catch {
|
|
473
|
+
return new Response("", { status: 500 });
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
async function resolveRoutes(routes) {
|
|
478
|
+
if (typeof routes === "function") {
|
|
479
|
+
return await routes();
|
|
480
|
+
}
|
|
481
|
+
return routes;
|
|
482
|
+
}
|
|
483
|
+
function serializeManifest(manifest) {
|
|
484
|
+
return JSON.stringify(manifest);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// src/well-known/emit.ts
|
|
488
|
+
var WELL_KNOWN_MANIFEST_PATH = ".well-known/cavuno.json";
|
|
489
|
+
function emitWellKnownManifest(config) {
|
|
490
|
+
const { manifest } = compileManifest(config.routes, config.markers);
|
|
491
|
+
const contents = serializeManifest(manifest);
|
|
492
|
+
return { path: WELL_KNOWN_MANIFEST_PATH, contents };
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// src/well-known/tanstack.ts
|
|
496
|
+
function routeEntriesFromTanStackRouteTree(routeTree) {
|
|
497
|
+
const out = [];
|
|
498
|
+
const seen = /* @__PURE__ */ new Set();
|
|
499
|
+
function visit(node, isRoot) {
|
|
500
|
+
if (!isTechnicalNode(node, isRoot)) {
|
|
501
|
+
const template = templateFromNode(node);
|
|
502
|
+
if (template !== null && !seen.has(template)) {
|
|
503
|
+
seen.add(template);
|
|
504
|
+
out.push({ template });
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
for (const child of childrenOf(node)) {
|
|
508
|
+
visit(child, false);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
visit(routeTree, true);
|
|
512
|
+
return out;
|
|
513
|
+
}
|
|
514
|
+
function childrenOf(node) {
|
|
515
|
+
const kids = node.children;
|
|
516
|
+
if (kids === void 0 || kids === null) return [];
|
|
517
|
+
if (Array.isArray(kids)) return kids;
|
|
518
|
+
return Object.values(kids);
|
|
519
|
+
}
|
|
520
|
+
function isTechnicalNode(node, isRoot) {
|
|
521
|
+
if (isRoot) return true;
|
|
522
|
+
const id = node.id ?? "";
|
|
523
|
+
if (id === "__root__" || id === "root") return true;
|
|
524
|
+
const path = node.path ?? "";
|
|
525
|
+
if (path === "" && !node.fullPath) return true;
|
|
526
|
+
if (hasUnderscoreSegment(path) || hasUnderscoreSegment(id)) {
|
|
527
|
+
const full = node.fullPath ?? "";
|
|
528
|
+
if (full === "" || hasUnderscoreSegment(full)) return true;
|
|
529
|
+
}
|
|
530
|
+
return false;
|
|
531
|
+
}
|
|
532
|
+
function hasUnderscoreSegment(value) {
|
|
533
|
+
if (!value) return false;
|
|
534
|
+
return value.split("/").some((seg) => seg.startsWith("_") && seg.length > 1);
|
|
535
|
+
}
|
|
536
|
+
function templateFromNode(node) {
|
|
537
|
+
const raw = typeof node.fullPath === "string" && node.fullPath.length > 0 ? node.fullPath : typeof node.path === "string" && node.path.length > 0 ? node.path.startsWith("/") ? node.path : `/${node.path}` : null;
|
|
538
|
+
if (raw === null) return null;
|
|
539
|
+
if (hasUnderscoreSegment(raw)) return null;
|
|
540
|
+
return tanStackPathToUrlPattern(raw);
|
|
541
|
+
}
|
|
542
|
+
function tanStackPathToUrlPattern(path) {
|
|
543
|
+
if (path === "/" || path === "") return "/";
|
|
544
|
+
const segments = path.split("/");
|
|
545
|
+
const converted = segments.map((seg) => {
|
|
546
|
+
if (seg === "") return seg;
|
|
547
|
+
if (seg === "$") return "*";
|
|
548
|
+
if (seg.startsWith("$") && seg.endsWith("?")) {
|
|
549
|
+
return `:${seg.slice(1, -1)}`;
|
|
550
|
+
}
|
|
551
|
+
if (seg.startsWith("$")) return `:${seg.slice(1)}`;
|
|
552
|
+
return seg;
|
|
553
|
+
});
|
|
554
|
+
let result = converted.join("/");
|
|
555
|
+
result = result.replace(/\/{2,}/g, "/");
|
|
556
|
+
if (!result.startsWith("/")) result = `/${result}`;
|
|
557
|
+
if (result.length > 1 && result.endsWith("/")) {
|
|
558
|
+
result = result.slice(0, -1);
|
|
559
|
+
}
|
|
560
|
+
return result;
|
|
561
|
+
}
|