@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
|
@@ -736,7 +736,7 @@ interface components {
|
|
|
736
736
|
handle: string | null;
|
|
737
737
|
/** @description Avatar URL, or `null`. */
|
|
738
738
|
avatarUrl: string | null;
|
|
739
|
-
/** @description Whether the candidate
|
|
739
|
+
/** @description Whether a resume is on file. On list rows this reflects the stored pointer; on the single-candidate detail it reflects the resolved blob (always agrees with `resume !== null`), so the two can briefly disagree if a stored file was garbage-collected. */
|
|
740
740
|
hasResume: boolean;
|
|
741
741
|
/** @description ISO-8601 timestamp of when the candidate registered. */
|
|
742
742
|
createdAt: string;
|
|
@@ -765,6 +765,7 @@ interface components {
|
|
|
765
765
|
savedJobCount: number;
|
|
766
766
|
/** @description Number of job alerts the candidate has. */
|
|
767
767
|
alertCount: number;
|
|
768
|
+
resume: components["schemas"]["CandidateResumeFile"];
|
|
768
769
|
};
|
|
769
770
|
CandidateEducation: {
|
|
770
771
|
id: string;
|
|
@@ -822,6 +823,15 @@ interface components {
|
|
|
822
823
|
jobSearchStatusVisibleTo: "everyone" | "employers_only";
|
|
823
824
|
openToRelocate: boolean;
|
|
824
825
|
};
|
|
826
|
+
/** @description Signed Convex storage URL + metadata for the uploaded resume, or `null` when no resume is on file (or the storage blob is missing). Treat the URL as sensitive PII. */
|
|
827
|
+
CandidateResumeFile: {
|
|
828
|
+
/** @description Convex storage download URL for the candidate resume. Unguessable; treat as sensitive PII — it serves the candidate’s actual resume file. Short-lived: do not cache or store it; re-fetch the candidate to get a fresh URL. */
|
|
829
|
+
url: string;
|
|
830
|
+
/** @description MIME type of the stored resume file. */
|
|
831
|
+
contentType: string;
|
|
832
|
+
/** @description Size of the resume file in bytes. */
|
|
833
|
+
sizeBytes: number;
|
|
834
|
+
} | null;
|
|
825
835
|
CandidateSkill: {
|
|
826
836
|
/** @enum {string} */
|
|
827
837
|
object: "candidate_skill";
|
|
@@ -2589,6 +2599,10 @@ interface components {
|
|
|
2589
2599
|
/** @description Board-defined custom field definitions, in display order. Read these to learn which `customFieldValues` keys, types, and option keys a job accepts on POST/PATCH /v1/jobs. */
|
|
2590
2600
|
customFields?: components["schemas"]["CustomFieldDefinition"][];
|
|
2591
2601
|
};
|
|
2602
|
+
JobFormCustomFieldsBody: {
|
|
2603
|
+
/** @description Full replacement list of custom field definitions, in display order. Empty array removes all. Changing `type` on an existing `key` is rejected (422); delete + recreate instead. Renaming a key is delete+add and orphans per-job values under the old key. */
|
|
2604
|
+
customFields: components["schemas"]["CustomFieldDefinition"][];
|
|
2605
|
+
};
|
|
2592
2606
|
JobOfficeLocation: {
|
|
2593
2607
|
/** @description ISO 3166-1 alpha-2 country code, or `null` if the location was not resolved. */
|
|
2594
2608
|
countryCode: string | null;
|
|
@@ -4840,6 +4854,39 @@ interface components {
|
|
|
4840
4854
|
/** @description Space-separated list of scopes granted on the issued token. */
|
|
4841
4855
|
scope: string;
|
|
4842
4856
|
};
|
|
4857
|
+
Transaction: {
|
|
4858
|
+
id: string;
|
|
4859
|
+
/** @enum {string} */
|
|
4860
|
+
object: "transaction";
|
|
4861
|
+
/** @enum {string} */
|
|
4862
|
+
kind: "card_post" | "invoice" | "subscription";
|
|
4863
|
+
/** @enum {string} */
|
|
4864
|
+
status: "paid" | "open" | "void" | "uncollectible";
|
|
4865
|
+
/** @enum {string} */
|
|
4866
|
+
method: "card" | "invoice";
|
|
4867
|
+
/** @description Amount in Stripe minor units (cents for most currencies). */
|
|
4868
|
+
amountCents: number;
|
|
4869
|
+
currency: string;
|
|
4870
|
+
description: string;
|
|
4871
|
+
customerLabel: string;
|
|
4872
|
+
customerEmail: string | null;
|
|
4873
|
+
/** @description ISO-8601 transaction date. */
|
|
4874
|
+
date: string;
|
|
4875
|
+
/** @description ISO-8601 invoice due date, or null. Past-due is client-derived from this field. */
|
|
4876
|
+
invoiceDueAt: string | null;
|
|
4877
|
+
stripeInvoiceId: string | null;
|
|
4878
|
+
hostedInvoiceUrl: string | null;
|
|
4879
|
+
receiptUrl: string | null;
|
|
4880
|
+
methodBrand: string | null;
|
|
4881
|
+
methodLast4: string | null;
|
|
4882
|
+
methodType: string | null;
|
|
4883
|
+
/** @enum {string|null} */
|
|
4884
|
+
publishTiming: "on_issue" | "on_payment" | null;
|
|
4885
|
+
/** @description jobOrders id when this row is order-sourced. */
|
|
4886
|
+
orderId: string | null;
|
|
4887
|
+
/** @description employerSubscriptions id when this row is a subscription renewal. Cross-link: GET /v1/employer-subscriptions/:id. */
|
|
4888
|
+
subscriptionId: string | null;
|
|
4889
|
+
};
|
|
4843
4890
|
TransferOwnershipBody: {
|
|
4844
4891
|
/** @description The user ID of the member who will become the primary owner. */
|
|
4845
4892
|
newOwnerUserId: string;
|
|
@@ -736,7 +736,7 @@ interface components {
|
|
|
736
736
|
handle: string | null;
|
|
737
737
|
/** @description Avatar URL, or `null`. */
|
|
738
738
|
avatarUrl: string | null;
|
|
739
|
-
/** @description Whether the candidate
|
|
739
|
+
/** @description Whether a resume is on file. On list rows this reflects the stored pointer; on the single-candidate detail it reflects the resolved blob (always agrees with `resume !== null`), so the two can briefly disagree if a stored file was garbage-collected. */
|
|
740
740
|
hasResume: boolean;
|
|
741
741
|
/** @description ISO-8601 timestamp of when the candidate registered. */
|
|
742
742
|
createdAt: string;
|
|
@@ -765,6 +765,7 @@ interface components {
|
|
|
765
765
|
savedJobCount: number;
|
|
766
766
|
/** @description Number of job alerts the candidate has. */
|
|
767
767
|
alertCount: number;
|
|
768
|
+
resume: components["schemas"]["CandidateResumeFile"];
|
|
768
769
|
};
|
|
769
770
|
CandidateEducation: {
|
|
770
771
|
id: string;
|
|
@@ -822,6 +823,15 @@ interface components {
|
|
|
822
823
|
jobSearchStatusVisibleTo: "everyone" | "employers_only";
|
|
823
824
|
openToRelocate: boolean;
|
|
824
825
|
};
|
|
826
|
+
/** @description Signed Convex storage URL + metadata for the uploaded resume, or `null` when no resume is on file (or the storage blob is missing). Treat the URL as sensitive PII. */
|
|
827
|
+
CandidateResumeFile: {
|
|
828
|
+
/** @description Convex storage download URL for the candidate resume. Unguessable; treat as sensitive PII — it serves the candidate’s actual resume file. Short-lived: do not cache or store it; re-fetch the candidate to get a fresh URL. */
|
|
829
|
+
url: string;
|
|
830
|
+
/** @description MIME type of the stored resume file. */
|
|
831
|
+
contentType: string;
|
|
832
|
+
/** @description Size of the resume file in bytes. */
|
|
833
|
+
sizeBytes: number;
|
|
834
|
+
} | null;
|
|
825
835
|
CandidateSkill: {
|
|
826
836
|
/** @enum {string} */
|
|
827
837
|
object: "candidate_skill";
|
|
@@ -2589,6 +2599,10 @@ interface components {
|
|
|
2589
2599
|
/** @description Board-defined custom field definitions, in display order. Read these to learn which `customFieldValues` keys, types, and option keys a job accepts on POST/PATCH /v1/jobs. */
|
|
2590
2600
|
customFields?: components["schemas"]["CustomFieldDefinition"][];
|
|
2591
2601
|
};
|
|
2602
|
+
JobFormCustomFieldsBody: {
|
|
2603
|
+
/** @description Full replacement list of custom field definitions, in display order. Empty array removes all. Changing `type` on an existing `key` is rejected (422); delete + recreate instead. Renaming a key is delete+add and orphans per-job values under the old key. */
|
|
2604
|
+
customFields: components["schemas"]["CustomFieldDefinition"][];
|
|
2605
|
+
};
|
|
2592
2606
|
JobOfficeLocation: {
|
|
2593
2607
|
/** @description ISO 3166-1 alpha-2 country code, or `null` if the location was not resolved. */
|
|
2594
2608
|
countryCode: string | null;
|
|
@@ -4840,6 +4854,39 @@ interface components {
|
|
|
4840
4854
|
/** @description Space-separated list of scopes granted on the issued token. */
|
|
4841
4855
|
scope: string;
|
|
4842
4856
|
};
|
|
4857
|
+
Transaction: {
|
|
4858
|
+
id: string;
|
|
4859
|
+
/** @enum {string} */
|
|
4860
|
+
object: "transaction";
|
|
4861
|
+
/** @enum {string} */
|
|
4862
|
+
kind: "card_post" | "invoice" | "subscription";
|
|
4863
|
+
/** @enum {string} */
|
|
4864
|
+
status: "paid" | "open" | "void" | "uncollectible";
|
|
4865
|
+
/** @enum {string} */
|
|
4866
|
+
method: "card" | "invoice";
|
|
4867
|
+
/** @description Amount in Stripe minor units (cents for most currencies). */
|
|
4868
|
+
amountCents: number;
|
|
4869
|
+
currency: string;
|
|
4870
|
+
description: string;
|
|
4871
|
+
customerLabel: string;
|
|
4872
|
+
customerEmail: string | null;
|
|
4873
|
+
/** @description ISO-8601 transaction date. */
|
|
4874
|
+
date: string;
|
|
4875
|
+
/** @description ISO-8601 invoice due date, or null. Past-due is client-derived from this field. */
|
|
4876
|
+
invoiceDueAt: string | null;
|
|
4877
|
+
stripeInvoiceId: string | null;
|
|
4878
|
+
hostedInvoiceUrl: string | null;
|
|
4879
|
+
receiptUrl: string | null;
|
|
4880
|
+
methodBrand: string | null;
|
|
4881
|
+
methodLast4: string | null;
|
|
4882
|
+
methodType: string | null;
|
|
4883
|
+
/** @enum {string|null} */
|
|
4884
|
+
publishTiming: "on_issue" | "on_payment" | null;
|
|
4885
|
+
/** @description jobOrders id when this row is order-sourced. */
|
|
4886
|
+
orderId: string | null;
|
|
4887
|
+
/** @description employerSubscriptions id when this row is a subscription renewal. Cross-link: GET /v1/employer-subscriptions/:id. */
|
|
4888
|
+
subscriptionId: string | null;
|
|
4889
|
+
};
|
|
4843
4890
|
TransferOwnershipBody: {
|
|
4844
4891
|
/** @description The user ID of the member who will become the primary owner. */
|
|
4845
4892
|
newOwnerUserId: string;
|
package/dist/filters.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as BoardLabelOverrides } from './ui-copy-CKfFTtLk.mjs';
|
|
2
|
-
import { J as JobSort, E as EmploymentType, R as RemoteOption, S as Seniority } from './jobs-
|
|
3
|
-
import './_spec-
|
|
2
|
+
import { J as JobSort, E as EmploymentType, R as RemoteOption, S as Seniority } from './jobs-DqujLqGk.mjs';
|
|
3
|
+
import './_spec-DQ2GR9lq.mjs';
|
|
4
4
|
|
|
5
5
|
declare const REMOTE_OPTIONS: readonly RemoteOption[];
|
|
6
6
|
/**
|
package/dist/filters.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as BoardLabelOverrides } from './ui-copy-CKfFTtLk.js';
|
|
2
|
-
import { J as JobSort, E as EmploymentType, R as RemoteOption, S as Seniority } from './jobs-
|
|
3
|
-
import './_spec-
|
|
2
|
+
import { J as JobSort, E as EmploymentType, R as RemoteOption, S as Seniority } from './jobs-BlnV6hmC.js';
|
|
3
|
+
import './_spec-DQ2GR9lq.js';
|
|
4
4
|
|
|
5
5
|
declare const REMOTE_OPTIONS: readonly RemoteOption[];
|
|
6
6
|
/**
|
package/dist/format.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PublicJob, a as PublicJobCard, C as CustomFieldValues } from './jobs-
|
|
1
|
+
import { P as PublicJob, a as PublicJobCard, C as CustomFieldValues } from './jobs-DqujLqGk.mjs';
|
|
2
2
|
import { B as BoardLabelOverrides } from './ui-copy-CKfFTtLk.mjs';
|
|
3
3
|
export { A as AlertsCopy, a as ApplyCopy, b as BlogCopy, c as BreadcrumbsCopy, C as CopyLinkCopy, E as EntityCopy, F as FooterCopy, J as JobCardCopy, d as JobDetailCopy, e as JobSearchCopy, N as NavCopy, P as PUBLIC_LABEL_GROUPS, f as PaginationCopy, S as SalaryCopy, U as UiCopy, u as uiCopy } from './ui-copy-CKfFTtLk.mjs';
|
|
4
|
-
import { C as CustomFieldDefinition } from './board-
|
|
5
|
-
import './_spec-
|
|
4
|
+
import { C as CustomFieldDefinition } from './board-ComPm8FD.mjs';
|
|
5
|
+
import './_spec-DQ2GR9lq.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Date display helpers in the board language (required leading parameter,
|
package/dist/format.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PublicJob, a as PublicJobCard, C as CustomFieldValues } from './jobs-
|
|
1
|
+
import { P as PublicJob, a as PublicJobCard, C as CustomFieldValues } from './jobs-BlnV6hmC.js';
|
|
2
2
|
import { B as BoardLabelOverrides } from './ui-copy-CKfFTtLk.js';
|
|
3
3
|
export { A as AlertsCopy, a as ApplyCopy, b as BlogCopy, c as BreadcrumbsCopy, C as CopyLinkCopy, E as EntityCopy, F as FooterCopy, J as JobCardCopy, d as JobDetailCopy, e as JobSearchCopy, N as NavCopy, P as PUBLIC_LABEL_GROUPS, f as PaginationCopy, S as SalaryCopy, U as UiCopy, u as uiCopy } from './ui-copy-CKfFTtLk.js';
|
|
4
|
-
import { C as CustomFieldDefinition } from './board-
|
|
5
|
-
import './_spec-
|
|
4
|
+
import { C as CustomFieldDefinition } from './board-DpBlk05S.js';
|
|
5
|
+
import './_spec-DQ2GR9lq.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Date display helpers in the board language (required leading parameter,
|
package/dist/go.d.mts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure `/go` indirection for self-deployed SDK boards (LNK-04).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the hosted-app contract:
|
|
5
|
+
* - `/go/job/<id>` → 302 to jobDetailPath(companySlug, jobSlug)
|
|
6
|
+
* - `/go/alerts-manage` / `/go/alerts-confirm` → 302 carrying query
|
|
7
|
+
* - unknown / unresolvable → 302 to BOARD_PATHS.jobs
|
|
8
|
+
* - every response: `X-Robots-Tag: noindex, nofollow`
|
|
9
|
+
*
|
|
10
|
+
* Framework-portable: takes a standard Request, returns a standard
|
|
11
|
+
* Response. No Next.js imports (same discipline as the sitemap walker).
|
|
12
|
+
*/
|
|
13
|
+
interface ResolvedJobSlugs {
|
|
14
|
+
companySlug: string;
|
|
15
|
+
jobSlug: string;
|
|
16
|
+
}
|
|
17
|
+
interface GoRedirectResult {
|
|
18
|
+
location: string;
|
|
19
|
+
status: 302;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Optional job-id → slugs lookup. The public Board API currently exposes
|
|
23
|
+
* job retrieve **by slug only** (`board.jobs.retrieve(jobSlug)`); there is
|
|
24
|
+
* no publishable-key endpoint that resolves an immutable job id to slugs.
|
|
25
|
+
*
|
|
26
|
+
* When `lookupJob` is omitted, `/go/job/<id>` degrades to the jobs index
|
|
27
|
+
* (safe, never 404). Pass a custom lookup when a data-plane endpoint lands
|
|
28
|
+
* (see TODO(LNK-04-followup)).
|
|
29
|
+
*/
|
|
30
|
+
type GoJobLookup = (jobId: string) => Promise<ResolvedJobSlugs | null> | ResolvedJobSlugs | null;
|
|
31
|
+
interface CreateGoHandlerConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Optional job resolver. Injected so tests can fake the data client and
|
|
34
|
+
* so callers can wire a future Board API id-lookup without an SDK release.
|
|
35
|
+
*/
|
|
36
|
+
lookupJob?: GoJobLookup;
|
|
37
|
+
/**
|
|
38
|
+
* Base origin used to absolutize Location (e.g. `https://jobs.example.com`).
|
|
39
|
+
* When omitted, Location is absolute against the incoming request URL —
|
|
40
|
+
* correct for same-host mounts.
|
|
41
|
+
*/
|
|
42
|
+
origin?: string;
|
|
43
|
+
}
|
|
44
|
+
declare function goResponseHeaders(): Record<string, string>;
|
|
45
|
+
/**
|
|
46
|
+
* Pure role → location resolver. Shared by the handler so unit tests can
|
|
47
|
+
* assert the contract without spinning a Request.
|
|
48
|
+
*/
|
|
49
|
+
declare function resolveGoRedirect(parts: readonly string[] | undefined, search: string, resolvedJob: ResolvedJobSlugs | null): GoRedirectResult;
|
|
50
|
+
/**
|
|
51
|
+
* Create a `(request) => Response` handler the starter mounts at `/go/*`.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* // Next.js App Router
|
|
55
|
+
* import { createGoHandler } from '@cavuno/board/go';
|
|
56
|
+
* export const GET = createGoHandler({});
|
|
57
|
+
*
|
|
58
|
+
* // With a future id-lookup:
|
|
59
|
+
* export const GET = createGoHandler({
|
|
60
|
+
* lookupJob: async (id) => board.jobs.retrieveById?.(id) ?? null,
|
|
61
|
+
* });
|
|
62
|
+
*/
|
|
63
|
+
declare function createGoHandler(config?: CreateGoHandlerConfig): (request: Request) => Promise<Response>;
|
|
64
|
+
|
|
65
|
+
export { type CreateGoHandlerConfig, type GoJobLookup, type GoRedirectResult, type ResolvedJobSlugs, createGoHandler, goResponseHeaders, resolveGoRedirect };
|
package/dist/go.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure `/go` indirection for self-deployed SDK boards (LNK-04).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the hosted-app contract:
|
|
5
|
+
* - `/go/job/<id>` → 302 to jobDetailPath(companySlug, jobSlug)
|
|
6
|
+
* - `/go/alerts-manage` / `/go/alerts-confirm` → 302 carrying query
|
|
7
|
+
* - unknown / unresolvable → 302 to BOARD_PATHS.jobs
|
|
8
|
+
* - every response: `X-Robots-Tag: noindex, nofollow`
|
|
9
|
+
*
|
|
10
|
+
* Framework-portable: takes a standard Request, returns a standard
|
|
11
|
+
* Response. No Next.js imports (same discipline as the sitemap walker).
|
|
12
|
+
*/
|
|
13
|
+
interface ResolvedJobSlugs {
|
|
14
|
+
companySlug: string;
|
|
15
|
+
jobSlug: string;
|
|
16
|
+
}
|
|
17
|
+
interface GoRedirectResult {
|
|
18
|
+
location: string;
|
|
19
|
+
status: 302;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Optional job-id → slugs lookup. The public Board API currently exposes
|
|
23
|
+
* job retrieve **by slug only** (`board.jobs.retrieve(jobSlug)`); there is
|
|
24
|
+
* no publishable-key endpoint that resolves an immutable job id to slugs.
|
|
25
|
+
*
|
|
26
|
+
* When `lookupJob` is omitted, `/go/job/<id>` degrades to the jobs index
|
|
27
|
+
* (safe, never 404). Pass a custom lookup when a data-plane endpoint lands
|
|
28
|
+
* (see TODO(LNK-04-followup)).
|
|
29
|
+
*/
|
|
30
|
+
type GoJobLookup = (jobId: string) => Promise<ResolvedJobSlugs | null> | ResolvedJobSlugs | null;
|
|
31
|
+
interface CreateGoHandlerConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Optional job resolver. Injected so tests can fake the data client and
|
|
34
|
+
* so callers can wire a future Board API id-lookup without an SDK release.
|
|
35
|
+
*/
|
|
36
|
+
lookupJob?: GoJobLookup;
|
|
37
|
+
/**
|
|
38
|
+
* Base origin used to absolutize Location (e.g. `https://jobs.example.com`).
|
|
39
|
+
* When omitted, Location is absolute against the incoming request URL —
|
|
40
|
+
* correct for same-host mounts.
|
|
41
|
+
*/
|
|
42
|
+
origin?: string;
|
|
43
|
+
}
|
|
44
|
+
declare function goResponseHeaders(): Record<string, string>;
|
|
45
|
+
/**
|
|
46
|
+
* Pure role → location resolver. Shared by the handler so unit tests can
|
|
47
|
+
* assert the contract without spinning a Request.
|
|
48
|
+
*/
|
|
49
|
+
declare function resolveGoRedirect(parts: readonly string[] | undefined, search: string, resolvedJob: ResolvedJobSlugs | null): GoRedirectResult;
|
|
50
|
+
/**
|
|
51
|
+
* Create a `(request) => Response` handler the starter mounts at `/go/*`.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* // Next.js App Router
|
|
55
|
+
* import { createGoHandler } from '@cavuno/board/go';
|
|
56
|
+
* export const GET = createGoHandler({});
|
|
57
|
+
*
|
|
58
|
+
* // With a future id-lookup:
|
|
59
|
+
* export const GET = createGoHandler({
|
|
60
|
+
* lookupJob: async (id) => board.jobs.retrieveById?.(id) ?? null,
|
|
61
|
+
* });
|
|
62
|
+
*/
|
|
63
|
+
declare function createGoHandler(config?: CreateGoHandlerConfig): (request: Request) => Promise<Response>;
|
|
64
|
+
|
|
65
|
+
export { type CreateGoHandlerConfig, type GoJobLookup, type GoRedirectResult, type ResolvedJobSlugs, createGoHandler, goResponseHeaders, resolveGoRedirect };
|
package/dist/go.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
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/go/index.ts
|
|
21
|
+
var go_exports = {};
|
|
22
|
+
__export(go_exports, {
|
|
23
|
+
createGoHandler: () => createGoHandler,
|
|
24
|
+
goResponseHeaders: () => goResponseHeaders,
|
|
25
|
+
resolveGoRedirect: () => resolveGoRedirect
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(go_exports);
|
|
28
|
+
|
|
29
|
+
// src/paths/index.ts
|
|
30
|
+
function jobDetailPath(companySlug, jobSlug) {
|
|
31
|
+
return `/companies/${companySlug}/jobs/${jobSlug}`;
|
|
32
|
+
}
|
|
33
|
+
var BOARD_PATHS = {
|
|
34
|
+
home: "/",
|
|
35
|
+
jobs: "/jobs",
|
|
36
|
+
companies: "/companies",
|
|
37
|
+
salaries: "/salaries",
|
|
38
|
+
salaryCompanies: "/salaries/companies",
|
|
39
|
+
salaryTitles: "/salaries/titles",
|
|
40
|
+
salarySkills: "/salaries/skills",
|
|
41
|
+
salaryLocations: "/salaries/locations",
|
|
42
|
+
blog: "/blog",
|
|
43
|
+
about: "/about",
|
|
44
|
+
privacyPolicy: "/privacy-policy",
|
|
45
|
+
termsOfService: "/terms-of-service",
|
|
46
|
+
cookiePolicy: "/cookie-policy",
|
|
47
|
+
impressum: "/impressum",
|
|
48
|
+
talent: "/talent",
|
|
49
|
+
employers: "/employers",
|
|
50
|
+
/**
|
|
51
|
+
* Alert-email surfaces (ADR-0090 D1/D4). Promoted out of raw literals in
|
|
52
|
+
* the job-alerts composer so /go indirection and email composition share
|
|
53
|
+
* one definition.
|
|
54
|
+
*/
|
|
55
|
+
alertsManage: "/alerts/manage",
|
|
56
|
+
alertsConfirm: "/alerts/confirm"
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/go/create-go-handler.ts
|
|
60
|
+
var NOINDEX_ROBOTS = "noindex, nofollow";
|
|
61
|
+
function goResponseHeaders() {
|
|
62
|
+
return {
|
|
63
|
+
"X-Robots-Tag": NOINDEX_ROBOTS,
|
|
64
|
+
"Cache-Control": "private, no-store"
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function resolveGoRedirect(parts, search, resolvedJob) {
|
|
68
|
+
const role = parts?.[0];
|
|
69
|
+
const id = parts?.[1];
|
|
70
|
+
const query = search.startsWith("?") ? search : search ? `?${search}` : "";
|
|
71
|
+
if (role === "job") {
|
|
72
|
+
if (id && resolvedJob?.companySlug && resolvedJob.jobSlug) {
|
|
73
|
+
return {
|
|
74
|
+
location: jobDetailPath(resolvedJob.companySlug, resolvedJob.jobSlug),
|
|
75
|
+
status: 302
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return { location: BOARD_PATHS.jobs, status: 302 };
|
|
79
|
+
}
|
|
80
|
+
if (role === "alerts-manage") {
|
|
81
|
+
return {
|
|
82
|
+
location: `${BOARD_PATHS.alertsManage}${query}`,
|
|
83
|
+
status: 302
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (role === "alerts-confirm") {
|
|
87
|
+
return {
|
|
88
|
+
location: `${BOARD_PATHS.alertsConfirm}${query}`,
|
|
89
|
+
status: 302
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return { location: BOARD_PATHS.jobs, status: 302 };
|
|
93
|
+
}
|
|
94
|
+
function partsFromRequest(request) {
|
|
95
|
+
const { pathname } = new URL(request.url);
|
|
96
|
+
const segments = pathname.split("/").map((s) => s.trim()).filter(Boolean);
|
|
97
|
+
const goIdx = segments.findIndex((s) => s === "go");
|
|
98
|
+
if (goIdx >= 0) {
|
|
99
|
+
return segments.slice(goIdx + 1);
|
|
100
|
+
}
|
|
101
|
+
return segments;
|
|
102
|
+
}
|
|
103
|
+
function createGoHandler(config = {}) {
|
|
104
|
+
const { lookupJob, origin } = config;
|
|
105
|
+
return async function goHandler(request) {
|
|
106
|
+
const url = new URL(request.url);
|
|
107
|
+
const parts = partsFromRequest(request);
|
|
108
|
+
let resolvedJob = null;
|
|
109
|
+
if (parts[0] === "job" && parts[1]) {
|
|
110
|
+
if (lookupJob) {
|
|
111
|
+
try {
|
|
112
|
+
resolvedJob = await lookupJob(parts[1]) ?? null;
|
|
113
|
+
} catch {
|
|
114
|
+
resolvedJob = null;
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
resolvedJob = null;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const result = resolveGoRedirect(parts, url.search, resolvedJob);
|
|
121
|
+
const locationBase = origin ?? url.origin;
|
|
122
|
+
return new Response(null, {
|
|
123
|
+
status: result.status,
|
|
124
|
+
headers: {
|
|
125
|
+
...goResponseHeaders(),
|
|
126
|
+
Location: new URL(result.location, locationBase).toString()
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
}
|
package/dist/go.mjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/paths/index.ts
|
|
2
|
+
function jobDetailPath(companySlug, jobSlug) {
|
|
3
|
+
return `/companies/${companySlug}/jobs/${jobSlug}`;
|
|
4
|
+
}
|
|
5
|
+
var BOARD_PATHS = {
|
|
6
|
+
home: "/",
|
|
7
|
+
jobs: "/jobs",
|
|
8
|
+
companies: "/companies",
|
|
9
|
+
salaries: "/salaries",
|
|
10
|
+
salaryCompanies: "/salaries/companies",
|
|
11
|
+
salaryTitles: "/salaries/titles",
|
|
12
|
+
salarySkills: "/salaries/skills",
|
|
13
|
+
salaryLocations: "/salaries/locations",
|
|
14
|
+
blog: "/blog",
|
|
15
|
+
about: "/about",
|
|
16
|
+
privacyPolicy: "/privacy-policy",
|
|
17
|
+
termsOfService: "/terms-of-service",
|
|
18
|
+
cookiePolicy: "/cookie-policy",
|
|
19
|
+
impressum: "/impressum",
|
|
20
|
+
talent: "/talent",
|
|
21
|
+
employers: "/employers",
|
|
22
|
+
/**
|
|
23
|
+
* Alert-email surfaces (ADR-0090 D1/D4). Promoted out of raw literals in
|
|
24
|
+
* the job-alerts composer so /go indirection and email composition share
|
|
25
|
+
* one definition.
|
|
26
|
+
*/
|
|
27
|
+
alertsManage: "/alerts/manage",
|
|
28
|
+
alertsConfirm: "/alerts/confirm"
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/go/create-go-handler.ts
|
|
32
|
+
var NOINDEX_ROBOTS = "noindex, nofollow";
|
|
33
|
+
function goResponseHeaders() {
|
|
34
|
+
return {
|
|
35
|
+
"X-Robots-Tag": NOINDEX_ROBOTS,
|
|
36
|
+
"Cache-Control": "private, no-store"
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function resolveGoRedirect(parts, search, resolvedJob) {
|
|
40
|
+
const role = parts?.[0];
|
|
41
|
+
const id = parts?.[1];
|
|
42
|
+
const query = search.startsWith("?") ? search : search ? `?${search}` : "";
|
|
43
|
+
if (role === "job") {
|
|
44
|
+
if (id && resolvedJob?.companySlug && resolvedJob.jobSlug) {
|
|
45
|
+
return {
|
|
46
|
+
location: jobDetailPath(resolvedJob.companySlug, resolvedJob.jobSlug),
|
|
47
|
+
status: 302
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return { location: BOARD_PATHS.jobs, status: 302 };
|
|
51
|
+
}
|
|
52
|
+
if (role === "alerts-manage") {
|
|
53
|
+
return {
|
|
54
|
+
location: `${BOARD_PATHS.alertsManage}${query}`,
|
|
55
|
+
status: 302
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (role === "alerts-confirm") {
|
|
59
|
+
return {
|
|
60
|
+
location: `${BOARD_PATHS.alertsConfirm}${query}`,
|
|
61
|
+
status: 302
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return { location: BOARD_PATHS.jobs, status: 302 };
|
|
65
|
+
}
|
|
66
|
+
function partsFromRequest(request) {
|
|
67
|
+
const { pathname } = new URL(request.url);
|
|
68
|
+
const segments = pathname.split("/").map((s) => s.trim()).filter(Boolean);
|
|
69
|
+
const goIdx = segments.findIndex((s) => s === "go");
|
|
70
|
+
if (goIdx >= 0) {
|
|
71
|
+
return segments.slice(goIdx + 1);
|
|
72
|
+
}
|
|
73
|
+
return segments;
|
|
74
|
+
}
|
|
75
|
+
function createGoHandler(config = {}) {
|
|
76
|
+
const { lookupJob, origin } = config;
|
|
77
|
+
return async function goHandler(request) {
|
|
78
|
+
const url = new URL(request.url);
|
|
79
|
+
const parts = partsFromRequest(request);
|
|
80
|
+
let resolvedJob = null;
|
|
81
|
+
if (parts[0] === "job" && parts[1]) {
|
|
82
|
+
if (lookupJob) {
|
|
83
|
+
try {
|
|
84
|
+
resolvedJob = await lookupJob(parts[1]) ?? null;
|
|
85
|
+
} catch {
|
|
86
|
+
resolvedJob = null;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
resolvedJob = null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const result = resolveGoRedirect(parts, url.search, resolvedJob);
|
|
93
|
+
const locationBase = origin ?? url.origin;
|
|
94
|
+
return new Response(null, {
|
|
95
|
+
status: result.status,
|
|
96
|
+
headers: {
|
|
97
|
+
...goResponseHeaders(),
|
|
98
|
+
Location: new URL(result.location, locationBase).toString()
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
createGoHandler,
|
|
105
|
+
goResponseHeaders,
|
|
106
|
+
resolveGoRedirect
|
|
107
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { S as Schemas, c as components } from './_spec-
|
|
2
|
-
import { F as FetchOptions, c as StorageMode, B as BoardRequest, A as Awaitable, L as Logger, d as BoardClient, a as SearchSuggestQuery } from './search-
|
|
3
|
-
export { e as ACCESS_TOKEN_KEY, f as BOARD_ACCESS_GRANT_KEY, C as CompanySuggestion, g as CustomStorage, R as REFRESH_TOKEN_KEY, b as SuggestResult, S as SuggestionItem, T as TermSuggestion } from './search-
|
|
4
|
-
export { C as CustomFieldDefinition, a as CustomFieldOption, b as CustomFieldType, P as PublicBoard, c as PublicBoardAnalytics, d as PublicBoardFeatures, e as PublicBoardTheme } from './board-
|
|
5
|
-
import { R as RemoteOption, E as EmploymentType, S as Seniority, L as ListEnvelope, b as JobsListQuery, c as JobCardListEnvelope, d as JobsSearchBody, e as JobCardSearchEnvelope, f as JobsSimilarQuery, g as SearchEnvelope } from './jobs-
|
|
6
|
-
export { h as CustomFieldValue, C as CustomFieldValues, i as EducationRequirement, j as JobCatalogPagination, k as JobCompany, J as JobSort, O as OfficeLocation, l as OffsetPagination, P as PublicJob, a as PublicJobCard, m as RelatedSearch, n as RemotePermit, o as RemoteTimezone, p as StorefrontPagination } from './jobs-
|
|
7
|
-
import { b as CompaniesListQuery, c as CompanyListEnvelope, d as CompaniesSearchBody, e as CompanyJobsListQuery, f as CompanySimilarQuery, g as CompanyMarketsListQuery, h as SalaryDetailQuery, i as BlogPostsListQuery, j as BlogSimilarQuery, k as BlogSearchBody } from './salaries-
|
|
8
|
-
export { B as BlogAuthorEmbed, l as BlogTagEmbed, C as CompanyCategorySalary, m as CompanyMarket, n as CompanyMarketRef, a as CompanySalary, L as LocationSalaryDetail, o as LocationSkillsIndex, p as LocationTitlesIndex, q as PublicBlogAdjacentPosts, r as PublicBlogAuthor, s as PublicBlogPost, P as PublicBlogPostSummary, t as PublicBlogTag, u as PublicCompany, v as PublicCompanyDetail, w as SalaryCompany, x as SalaryLocation, y as SalarySkill, z as SalaryTitle, A as SkillLocationSalary, D as SkillLocationsIndex, S as SkillSalaryDetail, E as TitleLocationSalary, F as TitleLocationsIndex, T as TitleSalaryDetail } from './salaries-
|
|
1
|
+
import { S as Schemas, c as components } from './_spec-DQ2GR9lq.mjs';
|
|
2
|
+
import { F as FetchOptions, c as StorageMode, B as BoardRequest, A as Awaitable, L as Logger, d as BoardClient, a as SearchSuggestQuery } from './search-CnRMApws.mjs';
|
|
3
|
+
export { e as ACCESS_TOKEN_KEY, f as BOARD_ACCESS_GRANT_KEY, C as CompanySuggestion, g as CustomStorage, R as REFRESH_TOKEN_KEY, b as SuggestResult, S as SuggestionItem, T as TermSuggestion } from './search-CnRMApws.mjs';
|
|
4
|
+
export { C as CustomFieldDefinition, a as CustomFieldOption, b as CustomFieldType, P as PublicBoard, c as PublicBoardAnalytics, d as PublicBoardFeatures, e as PublicBoardTheme } from './board-ComPm8FD.mjs';
|
|
5
|
+
import { R as RemoteOption, E as EmploymentType, S as Seniority, L as ListEnvelope, b as JobsListQuery, c as JobCardListEnvelope, d as JobsSearchBody, e as JobCardSearchEnvelope, f as JobsSimilarQuery, g as SearchEnvelope } from './jobs-DqujLqGk.mjs';
|
|
6
|
+
export { h as CustomFieldValue, C as CustomFieldValues, i as EducationRequirement, j as JobCatalogPagination, k as JobCompany, J as JobSort, O as OfficeLocation, l as OffsetPagination, P as PublicJob, a as PublicJobCard, m as RelatedSearch, n as RemotePermit, o as RemoteTimezone, p as StorefrontPagination } from './jobs-DqujLqGk.mjs';
|
|
7
|
+
import { b as CompaniesListQuery, c as CompanyListEnvelope, d as CompaniesSearchBody, e as CompanyJobsListQuery, f as CompanySimilarQuery, g as CompanyMarketsListQuery, h as SalaryDetailQuery, i as BlogPostsListQuery, j as BlogSimilarQuery, k as BlogSearchBody } from './salaries-CNJVapW5.mjs';
|
|
8
|
+
export { B as BlogAuthorEmbed, l as BlogTagEmbed, C as CompanyCategorySalary, m as CompanyMarket, n as CompanyMarketRef, a as CompanySalary, L as LocationSalaryDetail, o as LocationSkillsIndex, p as LocationTitlesIndex, q as PublicBlogAdjacentPosts, r as PublicBlogAuthor, s as PublicBlogPost, P as PublicBlogPostSummary, t as PublicBlogTag, u as PublicCompany, v as PublicCompanyDetail, w as SalaryCompany, x as SalaryLocation, y as SalarySkill, z as SalaryTitle, A as SkillLocationSalary, D as SkillLocationsIndex, S as SkillSalaryDetail, E as TitleLocationSalary, F as TitleLocationsIndex, T as TitleSalaryDetail } from './salaries-CNJVapW5.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Well-known `<domain>_<snake_reason>` codes the Board API sends, grouped by
|
|
@@ -141,7 +141,7 @@ declare function paginate<Q extends Record<string, unknown>, P extends PageShape
|
|
|
141
141
|
* constant because the package is platform-neutral and cannot read
|
|
142
142
|
* package.json at runtime.
|
|
143
143
|
*/
|
|
144
|
-
declare const SDK_VERSION = "1.
|
|
144
|
+
declare const SDK_VERSION = "1.43.0";
|
|
145
145
|
|
|
146
146
|
type SavedJob = Schemas['SavedJob'];
|
|
147
147
|
type SavedJobsListQuery = {
|