@burdenoff/website-sdk 2026.813.2 → 2026.817.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.d.mts +2 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/content/index.d.mts +74 -1
- package/dist/content/index.d.ts +74 -1
- package/dist/content/index.js +136 -0
- package/dist/content/index.js.map +1 -1
- package/dist/content/index.mjs +133 -1
- package/dist/content/index.mjs.map +1 -1
- package/dist/{provider-DBAnqeTv.d.mts → graphql-client-Cv6TO6hn.d.mts} +1 -36
- package/dist/{provider-DBAnqeTv.d.ts → graphql-client-Cv6TO6hn.d.ts} +1 -36
- package/dist/index.d.mts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +156 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +153 -3
- package/dist/index.mjs.map +1 -1
- package/dist/provider-BhsbxVPo.d.mts +37 -0
- package/dist/provider-D-Do5PmD.d.ts +37 -0
- package/package.json +1 -1
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Lightweight GraphQL client for the Burdenoff Web SDK.
|
|
6
3
|
* Uses native fetch - zero external dependencies.
|
|
@@ -75,36 +72,4 @@ declare class WebSDKClient {
|
|
|
75
72
|
private request;
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
|
|
79
|
-
/** SDK client configuration */
|
|
80
|
-
config: WebSDKClientConfig;
|
|
81
|
-
/** Child components */
|
|
82
|
-
children: ReactNode;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Provider component that makes the WebSDKClient available to all child components.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```tsx
|
|
89
|
-
* <WebSDKProvider config={{
|
|
90
|
-
* gatewayUrl: "https://api.burdenoff.com/global/graphql",
|
|
91
|
-
* productId: "your-product-id",
|
|
92
|
-
* productSlug: "your-product",
|
|
93
|
-
* }}>
|
|
94
|
-
* <App />
|
|
95
|
-
* </WebSDKProvider>
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
declare function WebSDKProvider({ config, children }: WebSDKProviderProps): react_jsx_runtime.JSX.Element;
|
|
99
|
-
/**
|
|
100
|
-
* Hook to access the WebSDKClient instance.
|
|
101
|
-
* Must be used within a WebSDKProvider.
|
|
102
|
-
*/
|
|
103
|
-
declare function useWebSDK(): WebSDKClient;
|
|
104
|
-
/**
|
|
105
|
-
* Hook to access the SDK configuration.
|
|
106
|
-
* Useful for components that need config values like productId, recaptchaSiteKey, etc.
|
|
107
|
-
*/
|
|
108
|
-
declare function useWebSDKConfig(): WebSDKClientConfig;
|
|
109
|
-
|
|
110
|
-
export { WebSDKClient as W, type WebSDKClientConfig as a, WebSDKProvider as b, type WebSDKProviderProps as c, useWebSDKConfig as d, useWebSDK as u };
|
|
75
|
+
export { WebSDKClient as W, type WebSDKClientConfig as a };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Lightweight GraphQL client for the Burdenoff Web SDK.
|
|
6
3
|
* Uses native fetch - zero external dependencies.
|
|
@@ -75,36 +72,4 @@ declare class WebSDKClient {
|
|
|
75
72
|
private request;
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
|
|
79
|
-
/** SDK client configuration */
|
|
80
|
-
config: WebSDKClientConfig;
|
|
81
|
-
/** Child components */
|
|
82
|
-
children: ReactNode;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Provider component that makes the WebSDKClient available to all child components.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```tsx
|
|
89
|
-
* <WebSDKProvider config={{
|
|
90
|
-
* gatewayUrl: "https://api.burdenoff.com/global/graphql",
|
|
91
|
-
* productId: "your-product-id",
|
|
92
|
-
* productSlug: "your-product",
|
|
93
|
-
* }}>
|
|
94
|
-
* <App />
|
|
95
|
-
* </WebSDKProvider>
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
declare function WebSDKProvider({ config, children }: WebSDKProviderProps): react_jsx_runtime.JSX.Element;
|
|
99
|
-
/**
|
|
100
|
-
* Hook to access the WebSDKClient instance.
|
|
101
|
-
* Must be used within a WebSDKProvider.
|
|
102
|
-
*/
|
|
103
|
-
declare function useWebSDK(): WebSDKClient;
|
|
104
|
-
/**
|
|
105
|
-
* Hook to access the SDK configuration.
|
|
106
|
-
* Useful for components that need config values like productId, recaptchaSiteKey, etc.
|
|
107
|
-
*/
|
|
108
|
-
declare function useWebSDKConfig(): WebSDKClientConfig;
|
|
109
|
-
|
|
110
|
-
export { WebSDKClient as W, type WebSDKClientConfig as a, WebSDKProvider as b, type WebSDKProviderProps as c, useWebSDKConfig as d, useWebSDK as u };
|
|
75
|
+
export { WebSDKClient as W, type WebSDKClientConfig as a };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { W as WebSDKClient, a as WebSDKClientConfig
|
|
1
|
+
export { W as WebSDKClient, a as WebSDKClientConfig } from './graphql-client-Cv6TO6hn.mjs';
|
|
2
|
+
export { W as WebSDKProvider, a as WebSDKProviderProps, u as useWebSDK, b as useWebSDKConfig } from './provider-BhsbxVPo.mjs';
|
|
2
3
|
export { ContactCategory, ContactPage, ContactPageProps, DEFAULT_CONTACT_CATEGORIES } from './components/contact.mjs';
|
|
3
4
|
export { PartnersPage, PartnersPageProps } from './components/partners.mjs';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -15,7 +16,7 @@ export { ProblemSolved, ProblemsSolvedSection, ProblemsSolvedSectionProps } from
|
|
|
15
16
|
export { DetectedPlatform, ElectronDownloadLink, ElectronDownloadLinkProps, detectElectronPlatform } from './components/electron-download.mjs';
|
|
16
17
|
export { RybbitAnalytics, RybbitAnalyticsProps } from './analytics/index.mjs';
|
|
17
18
|
export { PageHead, PageHeadProps } from './seo/index.mjs';
|
|
18
|
-
export { BlogListPage, BlogListPageProps, BlogPostPage, BlogPostPageProps, CaseStudiesListPage, CaseStudiesListPageProps, CaseStudyPage, CaseStudyPageProps, ChangelogEntry, ChangelogPage, ChangelogPageProps, ContentPageData, ContentPageListData, ContentPageListItem, ContentRenderer, ContractAsset, ContractsPage, ContractsPageProps, Markdown, MarkdownProps, PressKitAsset, PressKitAssetCategory, PressKitPage, PressKitPageProps, useContentPage, useContentPages } from './content/index.mjs';
|
|
19
|
+
export { BlogListPage, BlogListPageProps, BlogPostPage, BlogPostPageProps, CaseStudiesListPage, CaseStudiesListPageProps, CaseStudyPage, CaseStudyPageProps, ChangelogEntry, ChangelogPage, ChangelogPageProps, ContentPageData, ContentPageListData, ContentPageListItem, ContentRenderer, ContractAsset, ContractsPage, ContractsPageProps, Markdown, MarkdownProps, PressKitAsset, PressKitAssetCategory, PressKitPage, PressKitPageProps, PublicInterviewRoundConfig, PublicJobPosting, UsePublicJobPostingOptions, UsePublicJobPostingsOptions, fetchPublicJobPosting, fetchPublicJobPostings, useContentPage, useContentPages, usePublicJobPosting, usePublicJobPostings } from './content/index.mjs';
|
|
19
20
|
export { ProductData, ProductProvider, ProductProviderProps, useProduct, useProductConfig } from './product/index.mjs';
|
|
20
21
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
21
22
|
import * as React from 'react';
|
|
@@ -26,6 +27,13 @@ export { cn } from './utils/index.mjs';
|
|
|
26
27
|
import 'react-markdown';
|
|
27
28
|
import 'clsx';
|
|
28
29
|
|
|
30
|
+
/** A job posting option for the CareersApplyForm dropdown. */
|
|
31
|
+
interface CareersPostingOption {
|
|
32
|
+
/** Posting ID — sent as `jobPostingId` in the application input. */
|
|
33
|
+
id: string;
|
|
34
|
+
/** Display title — also sent as the `position` string. */
|
|
35
|
+
title: string;
|
|
36
|
+
}
|
|
29
37
|
interface CareersApplyFormProps {
|
|
30
38
|
/** Product name (falls back to product context / SDK config). */
|
|
31
39
|
productName?: string;
|
|
@@ -36,6 +44,13 @@ interface CareersApplyFormProps {
|
|
|
36
44
|
* input is shown instead so the form works before a postings list exists.
|
|
37
45
|
*/
|
|
38
46
|
positions?: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* Job postings for the dropdown (e.g. from `usePublicJobPostings`). When
|
|
49
|
+
* non-empty this takes precedence over `positions`: the selected posting's
|
|
50
|
+
* title is sent as `position` and its ID as `jobPostingId` so the
|
|
51
|
+
* application is linked to the posting.
|
|
52
|
+
*/
|
|
53
|
+
postings?: readonly CareersPostingOption[];
|
|
39
54
|
heroTitle?: string;
|
|
40
55
|
heroDescription?: string;
|
|
41
56
|
/**
|
|
@@ -52,7 +67,7 @@ interface CareersApplyFormProps {
|
|
|
52
67
|
keywords?: string;
|
|
53
68
|
};
|
|
54
69
|
}
|
|
55
|
-
declare function CareersApplyForm({ productName, recaptchaSiteKey, positions, heroTitle, heroDescription, headingLevel, maxResumeBytes, className, seo, }: CareersApplyFormProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function CareersApplyForm({ productName, recaptchaSiteKey, positions, postings, heroTitle, heroDescription, headingLevel, maxResumeBytes, className, seo, }: CareersApplyFormProps): react_jsx_runtime.JSX.Element;
|
|
56
71
|
|
|
57
72
|
declare const buttonVariants: (props?: ({
|
|
58
73
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
@@ -80,4 +95,4 @@ declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLP
|
|
|
80
95
|
*/
|
|
81
96
|
declare const ECOSYSTEM_PRODUCTS: WebsiteSwitcherProduct[];
|
|
82
97
|
|
|
83
|
-
export { Button, type ButtonProps, CareersApplyForm, type CareersApplyFormProps, ECOSYSTEM_PRODUCTS, Input, Label, Select, Textarea, WebsiteSwitcherProduct, buttonVariants };
|
|
98
|
+
export { Button, type ButtonProps, CareersApplyForm, type CareersApplyFormProps, type CareersPostingOption, ECOSYSTEM_PRODUCTS, Input, Label, Select, Textarea, WebsiteSwitcherProduct, buttonVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { W as WebSDKClient, a as WebSDKClientConfig
|
|
1
|
+
export { W as WebSDKClient, a as WebSDKClientConfig } from './graphql-client-Cv6TO6hn.js';
|
|
2
|
+
export { W as WebSDKProvider, a as WebSDKProviderProps, u as useWebSDK, b as useWebSDKConfig } from './provider-D-Do5PmD.js';
|
|
2
3
|
export { ContactCategory, ContactPage, ContactPageProps, DEFAULT_CONTACT_CATEGORIES } from './components/contact.js';
|
|
3
4
|
export { PartnersPage, PartnersPageProps } from './components/partners.js';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -15,7 +16,7 @@ export { ProblemSolved, ProblemsSolvedSection, ProblemsSolvedSectionProps } from
|
|
|
15
16
|
export { DetectedPlatform, ElectronDownloadLink, ElectronDownloadLinkProps, detectElectronPlatform } from './components/electron-download.js';
|
|
16
17
|
export { RybbitAnalytics, RybbitAnalyticsProps } from './analytics/index.js';
|
|
17
18
|
export { PageHead, PageHeadProps } from './seo/index.js';
|
|
18
|
-
export { BlogListPage, BlogListPageProps, BlogPostPage, BlogPostPageProps, CaseStudiesListPage, CaseStudiesListPageProps, CaseStudyPage, CaseStudyPageProps, ChangelogEntry, ChangelogPage, ChangelogPageProps, ContentPageData, ContentPageListData, ContentPageListItem, ContentRenderer, ContractAsset, ContractsPage, ContractsPageProps, Markdown, MarkdownProps, PressKitAsset, PressKitAssetCategory, PressKitPage, PressKitPageProps, useContentPage, useContentPages } from './content/index.js';
|
|
19
|
+
export { BlogListPage, BlogListPageProps, BlogPostPage, BlogPostPageProps, CaseStudiesListPage, CaseStudiesListPageProps, CaseStudyPage, CaseStudyPageProps, ChangelogEntry, ChangelogPage, ChangelogPageProps, ContentPageData, ContentPageListData, ContentPageListItem, ContentRenderer, ContractAsset, ContractsPage, ContractsPageProps, Markdown, MarkdownProps, PressKitAsset, PressKitAssetCategory, PressKitPage, PressKitPageProps, PublicInterviewRoundConfig, PublicJobPosting, UsePublicJobPostingOptions, UsePublicJobPostingsOptions, fetchPublicJobPosting, fetchPublicJobPostings, useContentPage, useContentPages, usePublicJobPosting, usePublicJobPostings } from './content/index.js';
|
|
19
20
|
export { ProductData, ProductProvider, ProductProviderProps, useProduct, useProductConfig } from './product/index.js';
|
|
20
21
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
21
22
|
import * as React from 'react';
|
|
@@ -26,6 +27,13 @@ export { cn } from './utils/index.js';
|
|
|
26
27
|
import 'react-markdown';
|
|
27
28
|
import 'clsx';
|
|
28
29
|
|
|
30
|
+
/** A job posting option for the CareersApplyForm dropdown. */
|
|
31
|
+
interface CareersPostingOption {
|
|
32
|
+
/** Posting ID — sent as `jobPostingId` in the application input. */
|
|
33
|
+
id: string;
|
|
34
|
+
/** Display title — also sent as the `position` string. */
|
|
35
|
+
title: string;
|
|
36
|
+
}
|
|
29
37
|
interface CareersApplyFormProps {
|
|
30
38
|
/** Product name (falls back to product context / SDK config). */
|
|
31
39
|
productName?: string;
|
|
@@ -36,6 +44,13 @@ interface CareersApplyFormProps {
|
|
|
36
44
|
* input is shown instead so the form works before a postings list exists.
|
|
37
45
|
*/
|
|
38
46
|
positions?: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* Job postings for the dropdown (e.g. from `usePublicJobPostings`). When
|
|
49
|
+
* non-empty this takes precedence over `positions`: the selected posting's
|
|
50
|
+
* title is sent as `position` and its ID as `jobPostingId` so the
|
|
51
|
+
* application is linked to the posting.
|
|
52
|
+
*/
|
|
53
|
+
postings?: readonly CareersPostingOption[];
|
|
39
54
|
heroTitle?: string;
|
|
40
55
|
heroDescription?: string;
|
|
41
56
|
/**
|
|
@@ -52,7 +67,7 @@ interface CareersApplyFormProps {
|
|
|
52
67
|
keywords?: string;
|
|
53
68
|
};
|
|
54
69
|
}
|
|
55
|
-
declare function CareersApplyForm({ productName, recaptchaSiteKey, positions, heroTitle, heroDescription, headingLevel, maxResumeBytes, className, seo, }: CareersApplyFormProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function CareersApplyForm({ productName, recaptchaSiteKey, positions, postings, heroTitle, heroDescription, headingLevel, maxResumeBytes, className, seo, }: CareersApplyFormProps): react_jsx_runtime.JSX.Element;
|
|
56
71
|
|
|
57
72
|
declare const buttonVariants: (props?: ({
|
|
58
73
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
@@ -80,4 +95,4 @@ declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLP
|
|
|
80
95
|
*/
|
|
81
96
|
declare const ECOSYSTEM_PRODUCTS: WebsiteSwitcherProduct[];
|
|
82
97
|
|
|
83
|
-
export { Button, type ButtonProps, CareersApplyForm, type CareersApplyFormProps, ECOSYSTEM_PRODUCTS, Input, Label, Select, Textarea, WebsiteSwitcherProduct, buttonVariants };
|
|
98
|
+
export { Button, type ButtonProps, CareersApplyForm, type CareersApplyFormProps, type CareersPostingOption, ECOSYSTEM_PRODUCTS, Input, Label, Select, Textarea, WebsiteSwitcherProduct, buttonVariants };
|
package/dist/index.js
CHANGED
|
@@ -1644,6 +1644,7 @@ async function submitApplication(client, data, productId) {
|
|
|
1644
1644
|
...data.linkedinUrl ? { linkedinUrl: data.linkedinUrl } : {},
|
|
1645
1645
|
...data.portfolioUrl ? { portfolioUrl: data.portfolioUrl } : {},
|
|
1646
1646
|
...data.coverLetter ? { coverLetter: data.coverLetter } : {},
|
|
1647
|
+
...data.jobPostingId ? { jobPostingId: data.jobPostingId } : {},
|
|
1647
1648
|
...data.recaptchaToken ? { recaptchaToken: data.recaptchaToken } : {}
|
|
1648
1649
|
}
|
|
1649
1650
|
});
|
|
@@ -1667,6 +1668,7 @@ function CareersApplyForm({
|
|
|
1667
1668
|
productName,
|
|
1668
1669
|
recaptchaSiteKey,
|
|
1669
1670
|
positions = [],
|
|
1671
|
+
postings = [],
|
|
1670
1672
|
heroTitle = "Become a part of the team",
|
|
1671
1673
|
heroDescription = "Tell us about yourself and upload your resume \u2014 we'll be in touch.",
|
|
1672
1674
|
headingLevel = 1,
|
|
@@ -1733,6 +1735,8 @@ function CareersApplyForm({
|
|
|
1733
1735
|
try {
|
|
1734
1736
|
const formData = new FormData(form);
|
|
1735
1737
|
const resumeBase64 = await fileToBase64(resumeFile);
|
|
1738
|
+
const positionValue = formData.get("position") ?? "";
|
|
1739
|
+
const selectedPosting = postings.length > 0 ? postings.find((p) => p.id === positionValue) : void 0;
|
|
1736
1740
|
const result = await submitApplication(
|
|
1737
1741
|
client,
|
|
1738
1742
|
{
|
|
@@ -1740,7 +1744,8 @@ function CareersApplyForm({
|
|
|
1740
1744
|
lastName: formData.get("lastName") ?? "",
|
|
1741
1745
|
email: formData.get("email") ?? "",
|
|
1742
1746
|
phone: formData.get("phone") || void 0,
|
|
1743
|
-
position:
|
|
1747
|
+
position: selectedPosting ? selectedPosting.title : positionValue,
|
|
1748
|
+
jobPostingId: selectedPosting?.id,
|
|
1744
1749
|
linkedinUrl: formData.get("linkedinUrl") || void 0,
|
|
1745
1750
|
portfolioUrl: formData.get("portfolioUrl") || void 0,
|
|
1746
1751
|
coverLetter: formData.get("coverLetter") || void 0,
|
|
@@ -1851,7 +1856,20 @@ function CareersApplyForm({
|
|
|
1851
1856
|
] }),
|
|
1852
1857
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1853
1858
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "position", children: "Position *" }),
|
|
1854
|
-
|
|
1859
|
+
postings.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1860
|
+
"select",
|
|
1861
|
+
{
|
|
1862
|
+
id: "position",
|
|
1863
|
+
name: "position",
|
|
1864
|
+
required: true,
|
|
1865
|
+
defaultValue: "",
|
|
1866
|
+
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
1867
|
+
children: [
|
|
1868
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, children: "Select a role" }),
|
|
1869
|
+
postings.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.id, children: p.title }, p.id))
|
|
1870
|
+
]
|
|
1871
|
+
}
|
|
1872
|
+
) : positions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1855
1873
|
"select",
|
|
1856
1874
|
{
|
|
1857
1875
|
id: "position",
|
|
@@ -4419,6 +4437,138 @@ function RybbitAnalytics({
|
|
|
4419
4437
|
}, [siteId, scriptUrl, enabled]);
|
|
4420
4438
|
return null;
|
|
4421
4439
|
}
|
|
4440
|
+
var PUBLIC_JOB_POSTING_FIELDS = (
|
|
4441
|
+
/* GraphQL */
|
|
4442
|
+
`
|
|
4443
|
+
id
|
|
4444
|
+
slug
|
|
4445
|
+
title
|
|
4446
|
+
department
|
|
4447
|
+
location
|
|
4448
|
+
employmentType
|
|
4449
|
+
openings
|
|
4450
|
+
description
|
|
4451
|
+
overview
|
|
4452
|
+
responsibilities
|
|
4453
|
+
learnings
|
|
4454
|
+
qualifications
|
|
4455
|
+
rounds {
|
|
4456
|
+
roundNumber
|
|
4457
|
+
name
|
|
4458
|
+
roundType
|
|
4459
|
+
isRequired
|
|
4460
|
+
description
|
|
4461
|
+
}
|
|
4462
|
+
`
|
|
4463
|
+
);
|
|
4464
|
+
var PUBLIC_JOB_POSTINGS_QUERY = (
|
|
4465
|
+
/* GraphQL */
|
|
4466
|
+
`
|
|
4467
|
+
query PublicJobPostings($productId: ID, $limit: Int, $offset: Int) {
|
|
4468
|
+
publicJobPostings(productId: $productId, limit: $limit, offset: $offset) {
|
|
4469
|
+
${PUBLIC_JOB_POSTING_FIELDS}
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
`
|
|
4473
|
+
);
|
|
4474
|
+
var PUBLIC_JOB_POSTING_QUERY = (
|
|
4475
|
+
/* GraphQL */
|
|
4476
|
+
`
|
|
4477
|
+
query PublicJobPosting($slug: String!, $productId: ID) {
|
|
4478
|
+
publicJobPosting(slug: $slug, productId: $productId) {
|
|
4479
|
+
${PUBLIC_JOB_POSTING_FIELDS}
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
`
|
|
4483
|
+
);
|
|
4484
|
+
async function fetchPublicJobPostings(client, options) {
|
|
4485
|
+
const result = await client.query(PUBLIC_JOB_POSTINGS_QUERY, {
|
|
4486
|
+
productId: options?.productId,
|
|
4487
|
+
limit: options?.limit ?? 50,
|
|
4488
|
+
offset: options?.offset ?? 0
|
|
4489
|
+
});
|
|
4490
|
+
if (result.errors?.length) {
|
|
4491
|
+
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
4492
|
+
}
|
|
4493
|
+
return result.data?.publicJobPostings ?? [];
|
|
4494
|
+
}
|
|
4495
|
+
async function fetchPublicJobPosting(client, slug, options) {
|
|
4496
|
+
const result = await client.query(PUBLIC_JOB_POSTING_QUERY, {
|
|
4497
|
+
slug,
|
|
4498
|
+
productId: options?.productId
|
|
4499
|
+
});
|
|
4500
|
+
if (result.errors?.length) {
|
|
4501
|
+
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
4502
|
+
}
|
|
4503
|
+
return result.data?.publicJobPosting ?? null;
|
|
4504
|
+
}
|
|
4505
|
+
function usePublicJobPostings(options) {
|
|
4506
|
+
const client = useWebSDK();
|
|
4507
|
+
const config = useWebSDKConfig();
|
|
4508
|
+
const { product } = useProduct();
|
|
4509
|
+
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
4510
|
+
const [postings, setPostings] = React.useState([]);
|
|
4511
|
+
const [loading, setLoading] = React.useState(true);
|
|
4512
|
+
const [error, setError] = React.useState(null);
|
|
4513
|
+
const fetchPostings = React.useCallback(async () => {
|
|
4514
|
+
setLoading(true);
|
|
4515
|
+
setError(null);
|
|
4516
|
+
try {
|
|
4517
|
+
const items = await fetchPublicJobPostings(client, {
|
|
4518
|
+
productId: resolvedProductId,
|
|
4519
|
+
limit: options?.limit,
|
|
4520
|
+
offset: options?.offset
|
|
4521
|
+
});
|
|
4522
|
+
setPostings(items);
|
|
4523
|
+
} catch (err) {
|
|
4524
|
+
setError(
|
|
4525
|
+
err instanceof Error ? err.message : "Failed to fetch job postings"
|
|
4526
|
+
);
|
|
4527
|
+
setPostings([]);
|
|
4528
|
+
} finally {
|
|
4529
|
+
setLoading(false);
|
|
4530
|
+
}
|
|
4531
|
+
}, [client, resolvedProductId, options?.limit, options?.offset]);
|
|
4532
|
+
React.useEffect(() => {
|
|
4533
|
+
fetchPostings();
|
|
4534
|
+
}, [fetchPostings]);
|
|
4535
|
+
return { postings, loading, error, refetch: fetchPostings };
|
|
4536
|
+
}
|
|
4537
|
+
function usePublicJobPosting(slug, options) {
|
|
4538
|
+
const client = useWebSDK();
|
|
4539
|
+
const config = useWebSDKConfig();
|
|
4540
|
+
const { product } = useProduct();
|
|
4541
|
+
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
4542
|
+
const [posting, setPosting] = React.useState(null);
|
|
4543
|
+
const [loading, setLoading] = React.useState(true);
|
|
4544
|
+
const [error, setError] = React.useState(null);
|
|
4545
|
+
const fetchPosting = React.useCallback(async () => {
|
|
4546
|
+
if (!slug) {
|
|
4547
|
+
setPosting(null);
|
|
4548
|
+
setLoading(false);
|
|
4549
|
+
return;
|
|
4550
|
+
}
|
|
4551
|
+
setLoading(true);
|
|
4552
|
+
setError(null);
|
|
4553
|
+
try {
|
|
4554
|
+
const item = await fetchPublicJobPosting(client, slug, {
|
|
4555
|
+
productId: resolvedProductId
|
|
4556
|
+
});
|
|
4557
|
+
setPosting(item);
|
|
4558
|
+
} catch (err) {
|
|
4559
|
+
setError(
|
|
4560
|
+
err instanceof Error ? err.message : "Failed to fetch job posting"
|
|
4561
|
+
);
|
|
4562
|
+
setPosting(null);
|
|
4563
|
+
} finally {
|
|
4564
|
+
setLoading(false);
|
|
4565
|
+
}
|
|
4566
|
+
}, [client, resolvedProductId, slug]);
|
|
4567
|
+
React.useEffect(() => {
|
|
4568
|
+
fetchPosting();
|
|
4569
|
+
}, [fetchPosting]);
|
|
4570
|
+
return { posting, loading, error, refetch: fetchPosting };
|
|
4571
|
+
}
|
|
4422
4572
|
var PROSE_CSS = `
|
|
4423
4573
|
.boff-prose {
|
|
4424
4574
|
max-width: none;
|
|
@@ -9159,12 +9309,16 @@ exports.WebsiteSwitcher = WebsiteSwitcher;
|
|
|
9159
9309
|
exports.buttonVariants = buttonVariants;
|
|
9160
9310
|
exports.cn = cn;
|
|
9161
9311
|
exports.detectElectronPlatform = detectElectronPlatform;
|
|
9312
|
+
exports.fetchPublicJobPosting = fetchPublicJobPosting;
|
|
9313
|
+
exports.fetchPublicJobPostings = fetchPublicJobPostings;
|
|
9162
9314
|
exports.formatDownloads = formatDownloads;
|
|
9163
9315
|
exports.formatPrice = formatPrice2;
|
|
9164
9316
|
exports.useContentPage = useContentPage;
|
|
9165
9317
|
exports.useContentPages = useContentPages;
|
|
9166
9318
|
exports.useProduct = useProduct;
|
|
9167
9319
|
exports.useProductConfig = useProductConfig;
|
|
9320
|
+
exports.usePublicJobPosting = usePublicJobPosting;
|
|
9321
|
+
exports.usePublicJobPostings = usePublicJobPostings;
|
|
9168
9322
|
exports.useWebSDK = useWebSDK;
|
|
9169
9323
|
exports.useWebSDKConfig = useWebSDKConfig;
|
|
9170
9324
|
//# sourceMappingURL=index.js.map
|