@burdenoff/website-sdk 2026.1021.2 → 2026.1021.3
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/README.md +58 -0
- package/dist/components/partners.js.map +1 -1
- package/dist/components/partners.mjs.map +1 -1
- package/dist/content/index.d.mts +1 -1
- package/dist/content/index.d.ts +1 -1
- package/dist/content/index.js +416 -196
- package/dist/content/index.js.map +1 -1
- package/dist/content/index.mjs +409 -197
- package/dist/content/index.mjs.map +1 -1
- package/dist/{index-ySbOLSD5.d.ts → index-CB0Uw1xD.d.ts} +108 -1
- package/dist/{index-gm3pBCJT.d.mts → index-Ctws7kGs.d.mts} +108 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +222 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/content/index.mjs
CHANGED
|
@@ -389,10 +389,15 @@ function useContentPage(slug, options) {
|
|
|
389
389
|
hasProvider,
|
|
390
390
|
productLoading
|
|
391
391
|
);
|
|
392
|
+
const enabled = options?.enabled !== false;
|
|
392
393
|
const [data, setData] = useState(null);
|
|
393
|
-
const [loading, setLoading] = useState(
|
|
394
|
+
const [loading, setLoading] = useState(enabled);
|
|
394
395
|
const [error, setError] = useState(null);
|
|
395
396
|
const fetchPage = useCallback(async () => {
|
|
397
|
+
if (!enabled) {
|
|
398
|
+
setLoading(false);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
396
401
|
if (gate === "wait") return;
|
|
397
402
|
if (gate === "unavailable") {
|
|
398
403
|
setData(null);
|
|
@@ -426,7 +431,15 @@ function useContentPage(slug, options) {
|
|
|
426
431
|
} finally {
|
|
427
432
|
setLoading(false);
|
|
428
433
|
}
|
|
429
|
-
}, [
|
|
434
|
+
}, [
|
|
435
|
+
client,
|
|
436
|
+
enabled,
|
|
437
|
+
gate,
|
|
438
|
+
productError,
|
|
439
|
+
resolvedProductId,
|
|
440
|
+
slug,
|
|
441
|
+
options?.resolve
|
|
442
|
+
]);
|
|
430
443
|
useEffect(() => {
|
|
431
444
|
fetchPage();
|
|
432
445
|
}, [fetchPage]);
|
|
@@ -487,200 +500,6 @@ function ContentRenderer({
|
|
|
487
500
|
}
|
|
488
501
|
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("pre", { style: { whiteSpace: "pre-wrap", fontFamily: "inherit" }, children: content }) });
|
|
489
502
|
}
|
|
490
|
-
var PUBLIC_JOB_POSTING_FIELDS = (
|
|
491
|
-
/* GraphQL */
|
|
492
|
-
`
|
|
493
|
-
id
|
|
494
|
-
slug
|
|
495
|
-
title
|
|
496
|
-
department
|
|
497
|
-
location
|
|
498
|
-
employmentType
|
|
499
|
-
openings
|
|
500
|
-
description
|
|
501
|
-
overview
|
|
502
|
-
responsibilities
|
|
503
|
-
learnings
|
|
504
|
-
qualifications
|
|
505
|
-
rounds {
|
|
506
|
-
roundNumber
|
|
507
|
-
name
|
|
508
|
-
roundType
|
|
509
|
-
isRequired
|
|
510
|
-
description
|
|
511
|
-
}
|
|
512
|
-
`
|
|
513
|
-
);
|
|
514
|
-
var PUBLIC_JOB_POSTINGS_QUERY = (
|
|
515
|
-
/* GraphQL */
|
|
516
|
-
`
|
|
517
|
-
query PublicJobPostings($productId: ID, $limit: Int, $offset: Int) {
|
|
518
|
-
publicJobPostings(productId: $productId, limit: $limit, offset: $offset) {
|
|
519
|
-
${PUBLIC_JOB_POSTING_FIELDS}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
`
|
|
523
|
-
);
|
|
524
|
-
var PUBLIC_JOB_POSTING_QUERY = (
|
|
525
|
-
/* GraphQL */
|
|
526
|
-
`
|
|
527
|
-
query PublicJobPosting($slug: String!, $productId: ID) {
|
|
528
|
-
publicJobPosting(slug: $slug, productId: $productId) {
|
|
529
|
-
${PUBLIC_JOB_POSTING_FIELDS}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
`
|
|
533
|
-
);
|
|
534
|
-
var PUBLIC_JOB_POSTINGS_FOR_SUBMISSION_QUERY = (
|
|
535
|
-
/* GraphQL */
|
|
536
|
-
`
|
|
537
|
-
query PublicJobPostingsForSubmission(
|
|
538
|
-
$productId: ID
|
|
539
|
-
$limit: Int
|
|
540
|
-
$offset: Int
|
|
541
|
-
) {
|
|
542
|
-
publicJobPostingsForSubmission(
|
|
543
|
-
productId: $productId
|
|
544
|
-
limit: $limit
|
|
545
|
-
offset: $offset
|
|
546
|
-
) {
|
|
547
|
-
id
|
|
548
|
-
title
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
`
|
|
552
|
-
);
|
|
553
|
-
async function fetchPublicJobPostings(client, options) {
|
|
554
|
-
const result = await client.query(PUBLIC_JOB_POSTINGS_QUERY, {
|
|
555
|
-
productId: options?.productId,
|
|
556
|
-
limit: options?.limit ?? 50,
|
|
557
|
-
offset: options?.offset ?? 0
|
|
558
|
-
});
|
|
559
|
-
if (result.errors?.length) {
|
|
560
|
-
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
561
|
-
}
|
|
562
|
-
return result.data?.publicJobPostings ?? [];
|
|
563
|
-
}
|
|
564
|
-
async function fetchPublicJobPosting(client, slug, options) {
|
|
565
|
-
const result = await client.query(PUBLIC_JOB_POSTING_QUERY, {
|
|
566
|
-
slug,
|
|
567
|
-
productId: options?.productId
|
|
568
|
-
});
|
|
569
|
-
if (result.errors?.length) {
|
|
570
|
-
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
571
|
-
}
|
|
572
|
-
return result.data?.publicJobPosting ?? null;
|
|
573
|
-
}
|
|
574
|
-
async function fetchPublicJobPostingsForSubmission(client, options) {
|
|
575
|
-
const result = await client.query(PUBLIC_JOB_POSTINGS_FOR_SUBMISSION_QUERY, {
|
|
576
|
-
productId: options?.productId,
|
|
577
|
-
limit: options?.limit ?? 50,
|
|
578
|
-
offset: options?.offset ?? 0
|
|
579
|
-
});
|
|
580
|
-
if (result.errors?.length) {
|
|
581
|
-
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
582
|
-
}
|
|
583
|
-
return result.data?.publicJobPostingsForSubmission ?? [];
|
|
584
|
-
}
|
|
585
|
-
function usePublicJobPostings(options) {
|
|
586
|
-
const client = useWebSDK();
|
|
587
|
-
const config = useWebSDKConfig();
|
|
588
|
-
const { product } = useProduct();
|
|
589
|
-
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
590
|
-
const [postings, setPostings] = useState([]);
|
|
591
|
-
const [loading, setLoading] = useState(true);
|
|
592
|
-
const [error, setError] = useState(null);
|
|
593
|
-
const fetchPostings = useCallback(async () => {
|
|
594
|
-
setLoading(true);
|
|
595
|
-
setError(null);
|
|
596
|
-
try {
|
|
597
|
-
const items = await fetchPublicJobPostings(client, {
|
|
598
|
-
productId: resolvedProductId,
|
|
599
|
-
limit: options?.limit,
|
|
600
|
-
offset: options?.offset
|
|
601
|
-
});
|
|
602
|
-
setPostings(items);
|
|
603
|
-
} catch (err) {
|
|
604
|
-
setError(
|
|
605
|
-
err instanceof Error ? err.message : "Failed to fetch job postings"
|
|
606
|
-
);
|
|
607
|
-
setPostings([]);
|
|
608
|
-
} finally {
|
|
609
|
-
setLoading(false);
|
|
610
|
-
}
|
|
611
|
-
}, [client, resolvedProductId, options?.limit, options?.offset]);
|
|
612
|
-
useEffect(() => {
|
|
613
|
-
fetchPostings();
|
|
614
|
-
}, [fetchPostings]);
|
|
615
|
-
return { postings, loading, error, refetch: fetchPostings };
|
|
616
|
-
}
|
|
617
|
-
function usePublicJobPostingsForSubmission(options) {
|
|
618
|
-
const client = useWebSDK();
|
|
619
|
-
const config = useWebSDKConfig();
|
|
620
|
-
const { product } = useProduct();
|
|
621
|
-
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
622
|
-
const [postings, setPostings] = useState([]);
|
|
623
|
-
const [loading, setLoading] = useState(true);
|
|
624
|
-
const [error, setError] = useState(null);
|
|
625
|
-
const fetchPostings = useCallback(async () => {
|
|
626
|
-
setLoading(true);
|
|
627
|
-
setError(null);
|
|
628
|
-
try {
|
|
629
|
-
const items = await fetchPublicJobPostingsForSubmission(client, {
|
|
630
|
-
productId: resolvedProductId,
|
|
631
|
-
limit: options?.limit,
|
|
632
|
-
offset: options?.offset
|
|
633
|
-
});
|
|
634
|
-
setPostings(items);
|
|
635
|
-
} catch (err) {
|
|
636
|
-
setError(
|
|
637
|
-
err instanceof Error ? err.message : "Failed to fetch job postings"
|
|
638
|
-
);
|
|
639
|
-
setPostings([]);
|
|
640
|
-
} finally {
|
|
641
|
-
setLoading(false);
|
|
642
|
-
}
|
|
643
|
-
}, [client, resolvedProductId, options?.limit, options?.offset]);
|
|
644
|
-
useEffect(() => {
|
|
645
|
-
fetchPostings();
|
|
646
|
-
}, [fetchPostings]);
|
|
647
|
-
return { postings, loading, error, refetch: fetchPostings };
|
|
648
|
-
}
|
|
649
|
-
function usePublicJobPosting(slug, options) {
|
|
650
|
-
const client = useWebSDK();
|
|
651
|
-
const config = useWebSDKConfig();
|
|
652
|
-
const { product } = useProduct();
|
|
653
|
-
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
654
|
-
const [posting, setPosting] = useState(null);
|
|
655
|
-
const [loading, setLoading] = useState(true);
|
|
656
|
-
const [error, setError] = useState(null);
|
|
657
|
-
const fetchPosting = useCallback(async () => {
|
|
658
|
-
if (!slug) {
|
|
659
|
-
setPosting(null);
|
|
660
|
-
setLoading(false);
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
setLoading(true);
|
|
664
|
-
setError(null);
|
|
665
|
-
try {
|
|
666
|
-
const item = await fetchPublicJobPosting(client, slug, {
|
|
667
|
-
productId: resolvedProductId
|
|
668
|
-
});
|
|
669
|
-
setPosting(item);
|
|
670
|
-
} catch (err) {
|
|
671
|
-
setError(
|
|
672
|
-
err instanceof Error ? err.message : "Failed to fetch job posting"
|
|
673
|
-
);
|
|
674
|
-
setPosting(null);
|
|
675
|
-
} finally {
|
|
676
|
-
setLoading(false);
|
|
677
|
-
}
|
|
678
|
-
}, [client, resolvedProductId, slug]);
|
|
679
|
-
useEffect(() => {
|
|
680
|
-
fetchPosting();
|
|
681
|
-
}, [fetchPosting]);
|
|
682
|
-
return { posting, loading, error, refetch: fetchPosting };
|
|
683
|
-
}
|
|
684
503
|
var PROSE_CSS = `
|
|
685
504
|
.boff-prose {
|
|
686
505
|
max-width: none;
|
|
@@ -929,6 +748,399 @@ function PageHead({
|
|
|
929
748
|
))
|
|
930
749
|
] });
|
|
931
750
|
}
|
|
751
|
+
var LEGAL_DOCUMENTS = {
|
|
752
|
+
privacy: {
|
|
753
|
+
key: "privacy",
|
|
754
|
+
slug: "privacy-policy",
|
|
755
|
+
title: "Privacy Policy",
|
|
756
|
+
description: "How we collect, use, share and protect your personal information."
|
|
757
|
+
},
|
|
758
|
+
terms: {
|
|
759
|
+
key: "terms",
|
|
760
|
+
slug: "terms-of-service",
|
|
761
|
+
title: "Terms of Service",
|
|
762
|
+
description: "The terms that govern your use of the service."
|
|
763
|
+
},
|
|
764
|
+
cookies: {
|
|
765
|
+
key: "cookies",
|
|
766
|
+
slug: "cookie-policy",
|
|
767
|
+
title: "Cookie Policy",
|
|
768
|
+
description: "The cookies and similar technologies we use, and why."
|
|
769
|
+
},
|
|
770
|
+
refunds: {
|
|
771
|
+
key: "refunds",
|
|
772
|
+
slug: "refund-policy",
|
|
773
|
+
title: "Refund Policy",
|
|
774
|
+
description: "How cancellations and refunds work for paid plans."
|
|
775
|
+
},
|
|
776
|
+
aup: {
|
|
777
|
+
key: "aup",
|
|
778
|
+
slug: "acceptable-use-policy",
|
|
779
|
+
title: "Acceptable Use Policy",
|
|
780
|
+
description: "What you may and may not do with the service."
|
|
781
|
+
},
|
|
782
|
+
dpa: {
|
|
783
|
+
key: "dpa",
|
|
784
|
+
slug: "data-processing-addendum",
|
|
785
|
+
title: "Data Processing Addendum",
|
|
786
|
+
description: "Our obligations as a processor of personal data on your behalf."
|
|
787
|
+
},
|
|
788
|
+
"ai-terms": {
|
|
789
|
+
key: "ai-terms",
|
|
790
|
+
slug: "ai-product-terms",
|
|
791
|
+
title: "AI Product Terms",
|
|
792
|
+
description: "The terms that apply to AI features, including how your data is and is not used."
|
|
793
|
+
},
|
|
794
|
+
subprocessors: {
|
|
795
|
+
key: "subprocessors",
|
|
796
|
+
slug: "subprocessors",
|
|
797
|
+
title: "Subprocessors",
|
|
798
|
+
description: "The third parties that help us host, secure and support the service."
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
var LEGAL_DOCUMENT_KEYS = Object.keys(
|
|
802
|
+
LEGAL_DOCUMENTS
|
|
803
|
+
);
|
|
804
|
+
function findLegalDocument(keyOrSlug) {
|
|
805
|
+
if (Object.prototype.hasOwnProperty.call(LEGAL_DOCUMENTS, keyOrSlug)) {
|
|
806
|
+
return LEGAL_DOCUMENTS[keyOrSlug];
|
|
807
|
+
}
|
|
808
|
+
return Object.values(LEGAL_DOCUMENTS).find((doc) => doc.slug === keyOrSlug) ?? null;
|
|
809
|
+
}
|
|
810
|
+
var LEGAL_CONTENT_QUERY = `
|
|
811
|
+
query PublicLegalContentPage($slug: String!, $productId: String!) {
|
|
812
|
+
publicResolvedContentPage(slug: $slug, productId: $productId) {
|
|
813
|
+
title
|
|
814
|
+
slug
|
|
815
|
+
content
|
|
816
|
+
contentFormat
|
|
817
|
+
seoTitle
|
|
818
|
+
seoDescription
|
|
819
|
+
seoKeywords
|
|
820
|
+
lastUpdated
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
`;
|
|
824
|
+
async function fetchLegalContentPage(client, slug, productId) {
|
|
825
|
+
const result = await client.query(LEGAL_CONTENT_QUERY, { slug, productId }, { cache: false });
|
|
826
|
+
if (result.errors?.length) {
|
|
827
|
+
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
828
|
+
}
|
|
829
|
+
return result.data?.publicResolvedContentPage ?? null;
|
|
830
|
+
}
|
|
831
|
+
async function fetchLegalContent(client, options) {
|
|
832
|
+
const docs = (options.documents ?? LEGAL_DOCUMENT_KEYS).map(
|
|
833
|
+
(key) => LEGAL_DOCUMENTS[key]
|
|
834
|
+
);
|
|
835
|
+
const entries = await Promise.all(
|
|
836
|
+
docs.map(
|
|
837
|
+
async (doc) => [
|
|
838
|
+
doc.slug,
|
|
839
|
+
await fetchLegalContentPage(client, doc.slug, options.productId)
|
|
840
|
+
]
|
|
841
|
+
)
|
|
842
|
+
);
|
|
843
|
+
return Object.fromEntries(entries);
|
|
844
|
+
}
|
|
845
|
+
function splitLeadingHeading(content, format) {
|
|
846
|
+
if (format.toLowerCase() !== "markdown")
|
|
847
|
+
return { heading: null, body: content };
|
|
848
|
+
const match = /^\s*#[ \t]+([^\n]+?)[ \t#]*(?:\n|$)/.exec(content);
|
|
849
|
+
if (!match?.[1]) return { heading: null, body: content };
|
|
850
|
+
return {
|
|
851
|
+
heading: match[1].trim(),
|
|
852
|
+
body: content.slice(match[0].length).replace(/^\s+/, "")
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function formatLegalDate(iso) {
|
|
856
|
+
if (!iso) return null;
|
|
857
|
+
const date = new Date(iso);
|
|
858
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
859
|
+
return date.toLocaleDateString("en-US", {
|
|
860
|
+
year: "numeric",
|
|
861
|
+
month: "long",
|
|
862
|
+
day: "numeric",
|
|
863
|
+
timeZone: "UTC"
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
function LegalPage(props) {
|
|
867
|
+
const {
|
|
868
|
+
document: document2,
|
|
869
|
+
slug: slugProp,
|
|
870
|
+
initialContent,
|
|
871
|
+
fallbackTitle,
|
|
872
|
+
fallbackDescription,
|
|
873
|
+
productName,
|
|
874
|
+
canonicalUrl,
|
|
875
|
+
contactEmail,
|
|
876
|
+
className = ""
|
|
877
|
+
} = props;
|
|
878
|
+
const registered = document2 ? LEGAL_DOCUMENTS[document2] : slugProp ? findLegalDocument(slugProp) : null;
|
|
879
|
+
const slug = registered?.slug ?? slugProp ?? "";
|
|
880
|
+
const prefetched = initialContent !== void 0;
|
|
881
|
+
const { data: fetched, loading } = useContentPage(slug, {
|
|
882
|
+
resolve: true,
|
|
883
|
+
enabled: !prefetched && slug !== ""
|
|
884
|
+
});
|
|
885
|
+
const page = prefetched ? initialContent ?? null : fetched;
|
|
886
|
+
const isLoading = !prefetched && slug !== "" && loading;
|
|
887
|
+
const defaultTitle = fallbackTitle ?? registered?.title ?? "Legal";
|
|
888
|
+
const defaultDescription = fallbackDescription ?? registered?.description ?? "";
|
|
889
|
+
const { heading, body } = page ? splitLeadingHeading(page.content, page.contentFormat) : { heading: null, body: "" };
|
|
890
|
+
const title = page?.title || heading || defaultTitle;
|
|
891
|
+
const updated = formatLegalDate(page?.lastUpdated);
|
|
892
|
+
const unavailable = !isLoading && !page;
|
|
893
|
+
return /* @__PURE__ */ jsxs("div", { className: `w-full ${className}`, children: [
|
|
894
|
+
/* @__PURE__ */ jsx(ProseStyles, {}),
|
|
895
|
+
/* @__PURE__ */ jsx(
|
|
896
|
+
PageHead,
|
|
897
|
+
{
|
|
898
|
+
title: page?.seoTitle || title,
|
|
899
|
+
description: page?.seoDescription?.trim() || defaultDescription,
|
|
900
|
+
keywords: page?.seoKeywords ?? void 0,
|
|
901
|
+
productName,
|
|
902
|
+
url: canonicalUrl,
|
|
903
|
+
robots: unavailable ? "noindex, follow" : void 0
|
|
904
|
+
}
|
|
905
|
+
),
|
|
906
|
+
/* @__PURE__ */ jsxs(
|
|
907
|
+
"article",
|
|
908
|
+
{
|
|
909
|
+
className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16 sm:py-24",
|
|
910
|
+
"aria-busy": isLoading,
|
|
911
|
+
children: [
|
|
912
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl sm:text-4xl font-bold tracking-tight text-foreground mb-3", children: title }),
|
|
913
|
+
updated && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mb-10", children: [
|
|
914
|
+
"Last updated:",
|
|
915
|
+
" ",
|
|
916
|
+
/* @__PURE__ */ jsx("time", { dateTime: page?.lastUpdated ?? void 0, children: updated })
|
|
917
|
+
] }),
|
|
918
|
+
isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", "data-testid": "legal-page-loading", children: [
|
|
919
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-3/4 rounded bg-muted animate-pulse" }),
|
|
920
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-full rounded bg-muted animate-pulse" }),
|
|
921
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-5/6 rounded bg-muted animate-pulse" })
|
|
922
|
+
] }) : page ? /* @__PURE__ */ jsx("div", { className: "boff-prose max-w-none", children: /* @__PURE__ */ jsx(ContentRenderer, { content: body, format: page.contentFormat }) }) : /* @__PURE__ */ jsxs(
|
|
923
|
+
"div",
|
|
924
|
+
{
|
|
925
|
+
role: "status",
|
|
926
|
+
className: "rounded-xl border border-border bg-muted/30 p-6",
|
|
927
|
+
children: [
|
|
928
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-foreground", children: "This document is not available right now." }),
|
|
929
|
+
contactEmail && /* @__PURE__ */ jsxs("p", { className: "mt-2 text-sm text-muted-foreground", children: [
|
|
930
|
+
"For a copy, contact",
|
|
931
|
+
" ",
|
|
932
|
+
/* @__PURE__ */ jsx(
|
|
933
|
+
"a",
|
|
934
|
+
{
|
|
935
|
+
className: "text-primary underline",
|
|
936
|
+
href: `mailto:${contactEmail}`,
|
|
937
|
+
children: contactEmail
|
|
938
|
+
}
|
|
939
|
+
),
|
|
940
|
+
"."
|
|
941
|
+
] })
|
|
942
|
+
]
|
|
943
|
+
}
|
|
944
|
+
)
|
|
945
|
+
]
|
|
946
|
+
}
|
|
947
|
+
)
|
|
948
|
+
] });
|
|
949
|
+
}
|
|
950
|
+
var PUBLIC_JOB_POSTING_FIELDS = (
|
|
951
|
+
/* GraphQL */
|
|
952
|
+
`
|
|
953
|
+
id
|
|
954
|
+
slug
|
|
955
|
+
title
|
|
956
|
+
department
|
|
957
|
+
location
|
|
958
|
+
employmentType
|
|
959
|
+
openings
|
|
960
|
+
description
|
|
961
|
+
overview
|
|
962
|
+
responsibilities
|
|
963
|
+
learnings
|
|
964
|
+
qualifications
|
|
965
|
+
rounds {
|
|
966
|
+
roundNumber
|
|
967
|
+
name
|
|
968
|
+
roundType
|
|
969
|
+
isRequired
|
|
970
|
+
description
|
|
971
|
+
}
|
|
972
|
+
`
|
|
973
|
+
);
|
|
974
|
+
var PUBLIC_JOB_POSTINGS_QUERY = (
|
|
975
|
+
/* GraphQL */
|
|
976
|
+
`
|
|
977
|
+
query PublicJobPostings($productId: ID, $limit: Int, $offset: Int) {
|
|
978
|
+
publicJobPostings(productId: $productId, limit: $limit, offset: $offset) {
|
|
979
|
+
${PUBLIC_JOB_POSTING_FIELDS}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
`
|
|
983
|
+
);
|
|
984
|
+
var PUBLIC_JOB_POSTING_QUERY = (
|
|
985
|
+
/* GraphQL */
|
|
986
|
+
`
|
|
987
|
+
query PublicJobPosting($slug: String!, $productId: ID) {
|
|
988
|
+
publicJobPosting(slug: $slug, productId: $productId) {
|
|
989
|
+
${PUBLIC_JOB_POSTING_FIELDS}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
`
|
|
993
|
+
);
|
|
994
|
+
var PUBLIC_JOB_POSTINGS_FOR_SUBMISSION_QUERY = (
|
|
995
|
+
/* GraphQL */
|
|
996
|
+
`
|
|
997
|
+
query PublicJobPostingsForSubmission(
|
|
998
|
+
$productId: ID
|
|
999
|
+
$limit: Int
|
|
1000
|
+
$offset: Int
|
|
1001
|
+
) {
|
|
1002
|
+
publicJobPostingsForSubmission(
|
|
1003
|
+
productId: $productId
|
|
1004
|
+
limit: $limit
|
|
1005
|
+
offset: $offset
|
|
1006
|
+
) {
|
|
1007
|
+
id
|
|
1008
|
+
title
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
`
|
|
1012
|
+
);
|
|
1013
|
+
async function fetchPublicJobPostings(client, options) {
|
|
1014
|
+
const result = await client.query(PUBLIC_JOB_POSTINGS_QUERY, {
|
|
1015
|
+
productId: options?.productId,
|
|
1016
|
+
limit: options?.limit ?? 50,
|
|
1017
|
+
offset: options?.offset ?? 0
|
|
1018
|
+
});
|
|
1019
|
+
if (result.errors?.length) {
|
|
1020
|
+
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
1021
|
+
}
|
|
1022
|
+
return result.data?.publicJobPostings ?? [];
|
|
1023
|
+
}
|
|
1024
|
+
async function fetchPublicJobPosting(client, slug, options) {
|
|
1025
|
+
const result = await client.query(PUBLIC_JOB_POSTING_QUERY, {
|
|
1026
|
+
slug,
|
|
1027
|
+
productId: options?.productId
|
|
1028
|
+
});
|
|
1029
|
+
if (result.errors?.length) {
|
|
1030
|
+
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
1031
|
+
}
|
|
1032
|
+
return result.data?.publicJobPosting ?? null;
|
|
1033
|
+
}
|
|
1034
|
+
async function fetchPublicJobPostingsForSubmission(client, options) {
|
|
1035
|
+
const result = await client.query(PUBLIC_JOB_POSTINGS_FOR_SUBMISSION_QUERY, {
|
|
1036
|
+
productId: options?.productId,
|
|
1037
|
+
limit: options?.limit ?? 50,
|
|
1038
|
+
offset: options?.offset ?? 0
|
|
1039
|
+
});
|
|
1040
|
+
if (result.errors?.length) {
|
|
1041
|
+
throw new Error(result.errors[0]?.message ?? "Unknown error");
|
|
1042
|
+
}
|
|
1043
|
+
return result.data?.publicJobPostingsForSubmission ?? [];
|
|
1044
|
+
}
|
|
1045
|
+
function usePublicJobPostings(options) {
|
|
1046
|
+
const client = useWebSDK();
|
|
1047
|
+
const config = useWebSDKConfig();
|
|
1048
|
+
const { product } = useProduct();
|
|
1049
|
+
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
1050
|
+
const [postings, setPostings] = useState([]);
|
|
1051
|
+
const [loading, setLoading] = useState(true);
|
|
1052
|
+
const [error, setError] = useState(null);
|
|
1053
|
+
const fetchPostings = useCallback(async () => {
|
|
1054
|
+
setLoading(true);
|
|
1055
|
+
setError(null);
|
|
1056
|
+
try {
|
|
1057
|
+
const items = await fetchPublicJobPostings(client, {
|
|
1058
|
+
productId: resolvedProductId,
|
|
1059
|
+
limit: options?.limit,
|
|
1060
|
+
offset: options?.offset
|
|
1061
|
+
});
|
|
1062
|
+
setPostings(items);
|
|
1063
|
+
} catch (err) {
|
|
1064
|
+
setError(
|
|
1065
|
+
err instanceof Error ? err.message : "Failed to fetch job postings"
|
|
1066
|
+
);
|
|
1067
|
+
setPostings([]);
|
|
1068
|
+
} finally {
|
|
1069
|
+
setLoading(false);
|
|
1070
|
+
}
|
|
1071
|
+
}, [client, resolvedProductId, options?.limit, options?.offset]);
|
|
1072
|
+
useEffect(() => {
|
|
1073
|
+
fetchPostings();
|
|
1074
|
+
}, [fetchPostings]);
|
|
1075
|
+
return { postings, loading, error, refetch: fetchPostings };
|
|
1076
|
+
}
|
|
1077
|
+
function usePublicJobPostingsForSubmission(options) {
|
|
1078
|
+
const client = useWebSDK();
|
|
1079
|
+
const config = useWebSDKConfig();
|
|
1080
|
+
const { product } = useProduct();
|
|
1081
|
+
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
1082
|
+
const [postings, setPostings] = useState([]);
|
|
1083
|
+
const [loading, setLoading] = useState(true);
|
|
1084
|
+
const [error, setError] = useState(null);
|
|
1085
|
+
const fetchPostings = useCallback(async () => {
|
|
1086
|
+
setLoading(true);
|
|
1087
|
+
setError(null);
|
|
1088
|
+
try {
|
|
1089
|
+
const items = await fetchPublicJobPostingsForSubmission(client, {
|
|
1090
|
+
productId: resolvedProductId,
|
|
1091
|
+
limit: options?.limit,
|
|
1092
|
+
offset: options?.offset
|
|
1093
|
+
});
|
|
1094
|
+
setPostings(items);
|
|
1095
|
+
} catch (err) {
|
|
1096
|
+
setError(
|
|
1097
|
+
err instanceof Error ? err.message : "Failed to fetch job postings"
|
|
1098
|
+
);
|
|
1099
|
+
setPostings([]);
|
|
1100
|
+
} finally {
|
|
1101
|
+
setLoading(false);
|
|
1102
|
+
}
|
|
1103
|
+
}, [client, resolvedProductId, options?.limit, options?.offset]);
|
|
1104
|
+
useEffect(() => {
|
|
1105
|
+
fetchPostings();
|
|
1106
|
+
}, [fetchPostings]);
|
|
1107
|
+
return { postings, loading, error, refetch: fetchPostings };
|
|
1108
|
+
}
|
|
1109
|
+
function usePublicJobPosting(slug, options) {
|
|
1110
|
+
const client = useWebSDK();
|
|
1111
|
+
const config = useWebSDKConfig();
|
|
1112
|
+
const { product } = useProduct();
|
|
1113
|
+
const resolvedProductId = options?.productId ?? product?.id ?? config.productId;
|
|
1114
|
+
const [posting, setPosting] = useState(null);
|
|
1115
|
+
const [loading, setLoading] = useState(true);
|
|
1116
|
+
const [error, setError] = useState(null);
|
|
1117
|
+
const fetchPosting = useCallback(async () => {
|
|
1118
|
+
if (!slug) {
|
|
1119
|
+
setPosting(null);
|
|
1120
|
+
setLoading(false);
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
setLoading(true);
|
|
1124
|
+
setError(null);
|
|
1125
|
+
try {
|
|
1126
|
+
const item = await fetchPublicJobPosting(client, slug, {
|
|
1127
|
+
productId: resolvedProductId
|
|
1128
|
+
});
|
|
1129
|
+
setPosting(item);
|
|
1130
|
+
} catch (err) {
|
|
1131
|
+
setError(
|
|
1132
|
+
err instanceof Error ? err.message : "Failed to fetch job posting"
|
|
1133
|
+
);
|
|
1134
|
+
setPosting(null);
|
|
1135
|
+
} finally {
|
|
1136
|
+
setLoading(false);
|
|
1137
|
+
}
|
|
1138
|
+
}, [client, resolvedProductId, slug]);
|
|
1139
|
+
useEffect(() => {
|
|
1140
|
+
fetchPosting();
|
|
1141
|
+
}, [fetchPosting]);
|
|
1142
|
+
return { posting, loading, error, refetch: fetchPosting };
|
|
1143
|
+
}
|
|
932
1144
|
var BLOG_POSTS_QUERY = `
|
|
933
1145
|
query BlogPosts($productId: String!, $limit: Int, $offset: Int) {
|
|
934
1146
|
publicContentPages(productId: $productId, limit: $limit, offset: $offset) {
|
|
@@ -3324,6 +3536,6 @@ function ContractsPage(props) {
|
|
|
3324
3536
|
] });
|
|
3325
3537
|
}
|
|
3326
3538
|
|
|
3327
|
-
export { BlogListPage, BlogPostPage, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ContentRenderer, ContractsPage, Markdown, PressKitPage, fetchPublicJobPosting, fetchPublicJobPostings, fetchPublicJobPostingsForSubmission, useContentPage, useContentPages, usePublicJobPosting, usePublicJobPostings, usePublicJobPostingsForSubmission };
|
|
3539
|
+
export { BlogListPage, BlogPostPage, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ContentRenderer, ContractsPage, LEGAL_DOCUMENTS, LEGAL_DOCUMENT_KEYS, LegalPage, Markdown, PressKitPage, fetchLegalContent, fetchLegalContentPage, fetchPublicJobPosting, fetchPublicJobPostings, fetchPublicJobPostingsForSubmission, findLegalDocument, formatLegalDate, splitLeadingHeading, useContentPage, useContentPages, usePublicJobPosting, usePublicJobPostings, usePublicJobPostingsForSubmission };
|
|
3328
3540
|
//# sourceMappingURL=index.mjs.map
|
|
3329
3541
|
//# sourceMappingURL=index.mjs.map
|