@cavuno/board 1.23.0 → 1.25.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/index.d.mts CHANGED
@@ -1,5 +1,61 @@
1
1
  interface components {
2
2
  schemas: {
3
+ AccessCheckoutBody: {
4
+ /**
5
+ * @description The offer tier to purchase (from `GET /paywall/offers/enabled`).
6
+ * @enum {string}
7
+ */
8
+ offerKey: "daily" | "weekly" | "monthly" | "quarterly" | "yearly" | "lifetime";
9
+ /** @description Relative path Stripe returns the buyer to on completion; `session_id` is appended. */
10
+ returnPath: string;
11
+ /** @enum {string} */
12
+ colorMode: "light" | "dark";
13
+ };
14
+ AccessCheckoutSession: {
15
+ /** @enum {string} */
16
+ object: "checkout_session";
17
+ sessionId: string;
18
+ /** @description The Checkout Session client secret to mount the embedded form. */
19
+ clientSecret: string;
20
+ /** @description The board’s connected Stripe account to initialise Stripe.js with. */
21
+ stripeAccountId: string;
22
+ /** @description The platform Stripe publishable key for `loadStripe`. */
23
+ publishableKey: string;
24
+ /**
25
+ * @description `recurring` grants get a manage-subscription portal; `lifetime` do not.
26
+ * @enum {string}
27
+ */
28
+ offerType: "recurring" | "lifetime";
29
+ };
30
+ AccessCheckoutSessionState: {
31
+ /** @enum {string} */
32
+ object: "checkout_session_state";
33
+ /** @enum {string} */
34
+ status: "open" | "complete" | "expired";
35
+ clientSecret: string | null;
36
+ };
37
+ AccessGrant: {
38
+ /** @enum {string} */
39
+ object: "access_grant";
40
+ hasAccess: boolean;
41
+ /** @enum {string|null} */
42
+ status: "active" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "canceled" | "pending" | null;
43
+ /** @enum {string|null} */
44
+ offerType: "recurring" | "lifetime" | null;
45
+ offerKey: string | null;
46
+ currentPeriodEnd: string | null;
47
+ cancelAtPeriodEnd: boolean;
48
+ };
49
+ AccessPortalBody: {
50
+ /** @description Relative path Stripe returns the buyer to; defaults to the board root. */
51
+ returnPath?: string;
52
+ };
53
+ AccessPortalSession: {
54
+ /** @enum {string} */
55
+ object: "portal_session";
56
+ /** Format: uri */
57
+ url: string;
58
+ };
3
59
  AddApplicantNoteBody: {
4
60
  /** @description The note text. */
5
61
  body: string;
@@ -1073,16 +1129,16 @@ interface components {
1073
1129
  name: string;
1074
1130
  };
1075
1131
  CustomFieldDefinition: {
1076
- /** @description Immutable per-board slug. Use this as the key in `customFieldValues` when writing values via POST/PATCH /v1/jobs. */
1132
+ /** @description Immutable per-board slug. The key in a job’s `customFieldValues`, and the frontend translation token (`customField.<key>.*`). */
1077
1133
  key: string;
1078
1134
  /** @description Authoring-default label; the localized public string lives in the board template. */
1079
1135
  label: string;
1080
1136
  /**
1081
- * @description Field type, which dictates the accepted value: `short_text`/`long_text` → string; `single_select` → one option key (string); `multi_select` → array of option keys; `boolean` → boolean; `number` → number.
1137
+ * @description Field type, which dictates the value: `short_text`/`long_text` → string; `single_select` → one option key; `multi_select` → array of option keys; `boolean` → boolean; `number` → number.
1082
1138
  * @enum {string}
1083
1139
  */
1084
1140
  type: "short_text" | "long_text" | "single_select" | "multi_select" | "boolean" | "number";
1085
- /** @description Present only for `single_select`/`multi_select`. A written value must be one (or, for multi, several) of these option `key`s — never a label. */
1141
+ /** @description Present only for `single_select`/`multi_select`. A stored value is one (or, for multi, several) of these option `key`s — never a label. */
1086
1142
  options?: components["schemas"]["CustomFieldOption"][];
1087
1143
  /** @description When true, the value cannot be cleared or left empty on a write (rejected with `custom_field_required`). */
1088
1144
  required: boolean;
@@ -1092,7 +1148,7 @@ interface components {
1092
1148
  max?: number;
1093
1149
  };
1094
1150
  CustomFieldOption: {
1095
- /** @description Stable option key — send this in a write, not the label. */
1151
+ /** @description Stable option key — the value stored on a job, not the label. */
1096
1152
  key: string;
1097
1153
  /** @description Display label (authoring default; localized per board in the template). */
1098
1154
  label: string;
@@ -2191,6 +2247,24 @@ interface components {
2191
2247
  [key: string]: unknown;
2192
2248
  };
2193
2249
  };
2250
+ PaywallOffer: {
2251
+ /** @enum {string} */
2252
+ object: "paywall_offer";
2253
+ /** @description The tier key posted to checkout (e.g. `monthly`, `lifetime`). */
2254
+ offerKey: string;
2255
+ label: string;
2256
+ billingLabel: string;
2257
+ amountCents: number;
2258
+ currency: string;
2259
+ /**
2260
+ * @description `recurring` tiers get a manage-subscription portal; `lifetime` do not.
2261
+ * @enum {string}
2262
+ */
2263
+ offerType: "recurring" | "lifetime";
2264
+ intervalUnit: string | null;
2265
+ intervalCount: number | null;
2266
+ isDefault: boolean;
2267
+ };
2194
2268
  Plan: {
2195
2269
  /** @enum {string} */
2196
2270
  object: "plan";
@@ -2343,6 +2417,8 @@ interface components {
2343
2417
  };
2344
2418
  };
2345
2419
  } | null;
2420
+ /** @description Operator-defined custom job-field definitions (CAV-294), in display order. Board-wide; the frontend uses these to render and localize each job's opaque `customFieldValues`. Empty when the board defines none. Display-only — not filterable or searchable in v1. */
2421
+ customFields: components["schemas"]["CustomFieldDefinition"][];
2346
2422
  };
2347
2423
  PublicCompaniesSearchBody: {
2348
2424
  /** @description Free-text search query matched against company name. Up to 200 characters. */
@@ -2477,6 +2553,10 @@ interface components {
2477
2553
  slug: string;
2478
2554
  name: string;
2479
2555
  }[];
2556
+ /** @description Opaque, display-only custom-field values (CAV-294), keyed by each field's `key`. Values are the option `key`(s) for select fields, or the raw boolean/number/text otherwise — resolve labels via the board's `customFields` definitions (see `GET /v1/boards/:identifier`). `{}` when the board defines no custom fields. Not filterable or searchable in v1. */
2557
+ customFieldValues: {
2558
+ [key: string]: string | string[] | boolean | number;
2559
+ };
2480
2560
  };
2481
2561
  PublicJobAlertConfirmation: {
2482
2562
  /** @enum {string} */
@@ -3650,102 +3730,6 @@ interface components {
3650
3730
  pathItems: never;
3651
3731
  }
3652
3732
 
3653
- type Schemas = components['schemas'];
3654
-
3655
- /**
3656
- * Stripe-shaped success envelopes (`01-conventions.md` §5.1). The
3657
- * server MAY add top-level fields; consumers MUST ignore unknown
3658
- * fields.
3659
- */
3660
- /**
3661
- * Medusa-style storefront pagination fields (ADR-0037 §7), populated only by
3662
- * the board jobs catalog reads (browse / search / company-jobs); absent on
3663
- * every other list/search. `nextCursor` is preserved alongside (offset-encoded).
3664
- */
3665
- interface StorefrontPagination {
3666
- /** Total matching results ("X jobs"). */
3667
- count?: number;
3668
- /** The page size used for this response. */
3669
- limit?: number;
3670
- /** Number of items skipped before this page. */
3671
- offset?: number;
3672
- /** Items hidden behind the candidate paywall for the current viewer; absent/0 when entitled. */
3673
- gatedCount?: number;
3674
- }
3675
- interface ListEnvelope<T> extends StorefrontPagination {
3676
- object: 'list';
3677
- url: string;
3678
- hasMore: boolean;
3679
- /** `null` when `hasMore` is false — always present, never undefined. */
3680
- nextCursor: string | null;
3681
- data: T[];
3682
- }
3683
- interface SearchEnvelope<T> extends StorefrontPagination {
3684
- object: 'search_result';
3685
- url: string;
3686
- hasMore: boolean;
3687
- nextCursor: string | null;
3688
- data: T[];
3689
- }
3690
-
3691
- type PublicJob = Schemas['PublicJob'];
3692
- type PublicJobCard = Schemas['PublicJobCard'];
3693
- type JobCompany = Schemas['JobCompany'];
3694
- type OfficeLocation = Schemas['JobOfficeLocation'];
3695
- type RemoteOption = NonNullable<PublicJob['remoteOption']>;
3696
- type EmploymentType = NonNullable<PublicJob['employmentType']>;
3697
- type Seniority = NonNullable<PublicJob['seniority']>;
3698
- /** Candidate-facing result ordering (ADR-0048); `relevance` is the default. */
3699
- type JobSort = NonNullable<Schemas['PublicSearchJobsBody']['sort']>;
3700
- type EducationRequirement = PublicJob['educationRequirements'][number];
3701
- type RemotePermit = PublicJob['remotePermits'][number];
3702
- type RemoteTimezone = PublicJob['remoteTimezones'][number];
3703
- /**
3704
- * Derived suggestion on a browse list (ADR-0037 §8): jobs surface `category`
3705
- * and `skill` terms; the companies list surfaces `market` terms.
3706
- */
3707
- interface RelatedSearch {
3708
- type: 'category' | 'skill' | 'market';
3709
- slug: string;
3710
- term: string;
3711
- count: number;
3712
- }
3713
- /** The browse list envelope — `PublicJobCard`s + storefront fields + `relatedSearches`. */
3714
- interface JobCardListEnvelope extends ListEnvelope<PublicJobCard> {
3715
- relatedSearches?: RelatedSearch[];
3716
- }
3717
- /** The search envelope — `PublicJobCard`s + storefront fields. */
3718
- type JobCardSearchEnvelope = SearchEnvelope<PublicJobCard>;
3719
- type JobsListQuery = {
3720
- cursor?: string;
3721
- /** 1–100. */
3722
- limit?: number;
3723
- /** Storefront page offset; takes precedence over `cursor`. `offset + limit` ≤ 10,000. */
3724
- offset?: number;
3725
- /** Repeated param (up to 10) — OR-matched. Repeat `companyId` per value. */
3726
- companyId?: string[];
3727
- remoteOption?: RemoteOption[];
3728
- employmentType?: EmploymentType[];
3729
- seniority?: Seniority[];
3730
- /** Result ordering (ADR-0048). Absent ⇒ `relevance` (the featured-ranked browse). */
3731
- sort?: JobSort;
3732
- /** Place slug for a geo radius search; unresolvable slugs are ignored. */
3733
- location?: string;
3734
- /** Radius in km around `location` (10–250; default 50). */
3735
- radius?: number;
3736
- /** Category slug seed (the `/jobs/[keyword]` page) — server resolves it to the English source name; unresolvable → 404. */
3737
- category?: string;
3738
- /** Skill slug seed (the `/jobs/skills/[skill]` page) — server-resolved; unresolvable → 404. */
3739
- skill?: string;
3740
- /** Sparse fieldset (Medusa-style `+field`). Only `'+description'` is supported — adds `description` to each card. */
3741
- fields?: string;
3742
- };
3743
- type JobsSimilarQuery = {
3744
- /** How many similar jobs to return (1–20; default 5). */
3745
- limit?: number;
3746
- };
3747
- type JobsSearchBody = Schemas['PublicSearchJobsBody'];
3748
-
3749
3733
  type Awaitable<T> = T | Promise<T>;
3750
3734
  /**
3751
3735
  * Async token storage. The SDK reads the access token from storage on
@@ -3865,7 +3849,9 @@ declare function isConflict(e: unknown): e is BoardApiError;
3865
3849
  * constant because the package is platform-neutral and cannot read
3866
3850
  * package.json at runtime.
3867
3851
  */
3868
- declare const SDK_VERSION = "1.23.0";
3852
+ declare const SDK_VERSION = "1.25.0";
3853
+
3854
+ type Schemas = components['schemas'];
3869
3855
 
3870
3856
  type BoardUser = Schemas['BoardUser'];
3871
3857
  type BoardAuthSession = Schemas['BoardAuthSession'];
@@ -3889,6 +3875,15 @@ type PublicBoard = Schemas['PublicBoardContext'];
3889
3875
  type PublicBoardFeatures = PublicBoard['features'];
3890
3876
  type PublicBoardAnalytics = PublicBoard['analytics'];
3891
3877
  type PublicBoardTheme = NonNullable<PublicBoard['theme']>;
3878
+ /**
3879
+ * An operator-defined custom job-field definition (CAV-294). Board-wide;
3880
+ * use it to render and localize a job's opaque `customFieldValues` (resolve
3881
+ * option `key`s → labels, honour field `type` and display order). Shared with
3882
+ * the Operator API's custom-field surface (one canonical schema).
3883
+ */
3884
+ type CustomFieldDefinition = Schemas['CustomFieldDefinition'];
3885
+ type CustomFieldType = CustomFieldDefinition['type'];
3886
+ type CustomFieldOption = Schemas['CustomFieldOption'];
3892
3887
 
3893
3888
  /**
3894
3889
  * The public SEO-infra payload (`board.seo()`) — the values a headless
@@ -3898,6 +3893,107 @@ type PublicBoardTheme = NonNullable<PublicBoard['theme']>;
3898
3893
  */
3899
3894
  type BoardSeo = Schemas['BoardSeo'];
3900
3895
 
3896
+ /**
3897
+ * Stripe-shaped success envelopes (`01-conventions.md` §5.1). The
3898
+ * server MAY add top-level fields; consumers MUST ignore unknown
3899
+ * fields.
3900
+ */
3901
+ /**
3902
+ * Medusa-style storefront pagination fields (ADR-0037 §7), populated only by
3903
+ * the board jobs catalog reads (browse / search / company-jobs); absent on
3904
+ * every other list/search. `nextCursor` is preserved alongside (offset-encoded).
3905
+ */
3906
+ interface StorefrontPagination {
3907
+ /** Total matching results ("X jobs"). */
3908
+ count?: number;
3909
+ /** The page size used for this response. */
3910
+ limit?: number;
3911
+ /** Number of items skipped before this page. */
3912
+ offset?: number;
3913
+ /** Items hidden behind the candidate paywall for the current viewer; absent/0 when entitled. */
3914
+ gatedCount?: number;
3915
+ }
3916
+ interface ListEnvelope<T> extends StorefrontPagination {
3917
+ object: 'list';
3918
+ url: string;
3919
+ hasMore: boolean;
3920
+ /** `null` when `hasMore` is false — always present, never undefined. */
3921
+ nextCursor: string | null;
3922
+ data: T[];
3923
+ }
3924
+ interface SearchEnvelope<T> extends StorefrontPagination {
3925
+ object: 'search_result';
3926
+ url: string;
3927
+ hasMore: boolean;
3928
+ nextCursor: string | null;
3929
+ data: T[];
3930
+ }
3931
+
3932
+ type PublicJob = Schemas['PublicJob'];
3933
+ type PublicJobCard = Schemas['PublicJobCard'];
3934
+ /**
3935
+ * A job's opaque, display-only custom-field values (CAV-294), keyed by each
3936
+ * field's `key`. Resolve labels via the board's `CustomFieldDefinition`s
3937
+ * (`board.context().customFields`).
3938
+ */
3939
+ type CustomFieldValues = PublicJob['customFieldValues'];
3940
+ type CustomFieldValue = CustomFieldValues[string];
3941
+ type JobCompany = Schemas['JobCompany'];
3942
+ type OfficeLocation = Schemas['JobOfficeLocation'];
3943
+ type RemoteOption = NonNullable<PublicJob['remoteOption']>;
3944
+ type EmploymentType = NonNullable<PublicJob['employmentType']>;
3945
+ type Seniority = NonNullable<PublicJob['seniority']>;
3946
+ /** Candidate-facing result ordering (ADR-0048); `relevance` is the default. */
3947
+ type JobSort = NonNullable<Schemas['PublicSearchJobsBody']['sort']>;
3948
+ type EducationRequirement = PublicJob['educationRequirements'][number];
3949
+ type RemotePermit = PublicJob['remotePermits'][number];
3950
+ type RemoteTimezone = PublicJob['remoteTimezones'][number];
3951
+ /**
3952
+ * Derived suggestion on a browse list (ADR-0037 §8): jobs surface `category`
3953
+ * and `skill` terms; the companies list surfaces `market` terms.
3954
+ */
3955
+ interface RelatedSearch {
3956
+ type: 'category' | 'skill' | 'market';
3957
+ slug: string;
3958
+ term: string;
3959
+ count: number;
3960
+ }
3961
+ /** The browse list envelope — `PublicJobCard`s + storefront fields + `relatedSearches`. */
3962
+ interface JobCardListEnvelope extends ListEnvelope<PublicJobCard> {
3963
+ relatedSearches?: RelatedSearch[];
3964
+ }
3965
+ /** The search envelope — `PublicJobCard`s + storefront fields. */
3966
+ type JobCardSearchEnvelope = SearchEnvelope<PublicJobCard>;
3967
+ type JobsListQuery = {
3968
+ cursor?: string;
3969
+ /** 1–100. */
3970
+ limit?: number;
3971
+ /** Storefront page offset; takes precedence over `cursor`. `offset + limit` ≤ 10,000. */
3972
+ offset?: number;
3973
+ /** Repeated param (up to 10) — OR-matched. Repeat `companyId` per value. */
3974
+ companyId?: string[];
3975
+ remoteOption?: RemoteOption[];
3976
+ employmentType?: EmploymentType[];
3977
+ seniority?: Seniority[];
3978
+ /** Result ordering (ADR-0048). Absent ⇒ `relevance` (the featured-ranked browse). */
3979
+ sort?: JobSort;
3980
+ /** Place slug for a geo radius search; unresolvable slugs are ignored. */
3981
+ location?: string;
3982
+ /** Radius in km around `location` (10–250; default 50). */
3983
+ radius?: number;
3984
+ /** Category slug seed (the `/jobs/[keyword]` page) — server resolves it to the English source name; unresolvable → 404. */
3985
+ category?: string;
3986
+ /** Skill slug seed (the `/jobs/skills/[skill]` page) — server-resolved; unresolvable → 404. */
3987
+ skill?: string;
3988
+ /** Sparse fieldset (Medusa-style `+field`). Only `'+description'` is supported — adds `description` to each card. */
3989
+ fields?: string;
3990
+ };
3991
+ type JobsSimilarQuery = {
3992
+ /** How many similar jobs to return (1–20; default 5). */
3993
+ limit?: number;
3994
+ };
3995
+ type JobsSearchBody = Schemas['PublicSearchJobsBody'];
3996
+
3901
3997
  type EmbedJobsQuery = {
3902
3998
  /** Free-text search query, up to 200 characters. */
3903
3999
  q?: string;
@@ -4051,6 +4147,26 @@ type PlansListQuery = {
4051
4147
  type PlanListEnvelope = ListEnvelope<Plan>;
4052
4148
  type SalesLedPlanListEnvelope = ListEnvelope<SalesLedPlan>;
4053
4149
 
4150
+ /** An enabled candidate-access paywall offer tier (public). */
4151
+ type PaywallOffer = Schemas['PaywallOffer'];
4152
+ /**
4153
+ * The connected-account embedded-checkout mount kit returned by
4154
+ * `board.me.access.checkout`. Mount with `loadStripe(publishableKey, {
4155
+ * stripeAccount: stripeAccountId })` then `initEmbeddedCheckout({ clientSecret })`.
4156
+ */
4157
+ type AccessCheckoutSession = Schemas['AccessCheckoutSession'];
4158
+ /** The polled state of a checkout session (`board.me.access.retrieveCheckout`). */
4159
+ type AccessCheckoutSessionState = Schemas['AccessCheckoutSessionState'];
4160
+ /** The viewer's candidate-access entitlement (`board.me.access.grant`). */
4161
+ type AccessGrant = Schemas['AccessGrant'];
4162
+ /** A minted Stripe billing-portal session (`board.me.access.portal`). */
4163
+ type AccessPortalSession = Schemas['AccessPortalSession'];
4164
+ /** Body for `board.me.access.checkout`. */
4165
+ type AccessCheckoutBody = Schemas['AccessCheckoutBody'];
4166
+ /** Body for `board.me.access.portal`. */
4167
+ type AccessPortalBody = Schemas['AccessPortalBody'];
4168
+ type PaywallOfferListEnvelope = ListEnvelope<PaywallOffer>;
4169
+
4054
4170
  type SavedJob = Schemas['SavedJob'];
4055
4171
  type SavedJobsListQuery = {
4056
4172
  cursor?: string;
@@ -4429,6 +4545,7 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
4429
4545
  };
4430
4546
  };
4431
4547
  } | null;
4548
+ customFields: components["schemas"]["CustomFieldDefinition"][];
4432
4549
  }>;
4433
4550
  /**
4434
4551
  * Board SEO infra — `ads.txt`, IndexNow key, Google site-verification, and
@@ -4514,6 +4631,9 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
4514
4631
  slug: string;
4515
4632
  name: string;
4516
4633
  }[];
4634
+ customFieldValues: {
4635
+ [key: string]: string | string[] | boolean | number;
4636
+ };
4517
4637
  }>;
4518
4638
  search(body: JobsSearchBody, query?: Record<string, never>, options?: FetchOptions): Promise<JobCardSearchEnvelope>;
4519
4639
  similar(jobSlug: string, query?: JobsSimilarQuery, options?: FetchOptions): Promise<ListEnvelope<{
@@ -5898,6 +6018,34 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
5898
6018
  blocked: boolean;
5899
6019
  }>;
5900
6020
  };
6021
+ access: {
6022
+ checkout(body: AccessCheckoutBody, options?: FetchOptions): Promise<{
6023
+ object: "checkout_session";
6024
+ sessionId: string;
6025
+ clientSecret: string;
6026
+ stripeAccountId: string;
6027
+ publishableKey: string;
6028
+ offerType: "recurring" | "lifetime";
6029
+ }>;
6030
+ retrieveCheckout(sessionId: string, options?: FetchOptions): Promise<{
6031
+ object: "checkout_session_state";
6032
+ status: "open" | "complete" | "expired";
6033
+ clientSecret: string | null;
6034
+ }>;
6035
+ grant(options?: FetchOptions): Promise<{
6036
+ object: "access_grant";
6037
+ hasAccess: boolean;
6038
+ status: "active" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "canceled" | "pending" | null;
6039
+ offerType: "recurring" | "lifetime" | null;
6040
+ offerKey: string | null;
6041
+ currentPeriodEnd: string | null;
6042
+ cancelAtPeriodEnd: boolean;
6043
+ }>;
6044
+ portal(body?: AccessPortalBody, options?: FetchOptions): Promise<{
6045
+ object: "portal_session";
6046
+ url: string;
6047
+ }>;
6048
+ };
5901
6049
  };
5902
6050
  password: {
5903
6051
  verify(password: string, options?: FetchOptions): Promise<BoardAccessGrant>;
@@ -6594,7 +6742,10 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
6594
6742
  list(query?: PlansListQuery, options?: FetchOptions): Promise<PlanListEnvelope>;
6595
6743
  salesLed(options?: FetchOptions): Promise<SalesLedPlanListEnvelope>;
6596
6744
  };
6745
+ paywall: {
6746
+ offers(options?: FetchOptions): Promise<PaywallOfferListEnvelope>;
6747
+ };
6597
6748
  };
6598
6749
  type BoardSdk = ReturnType<typeof createBoardClient>;
6599
6750
 
6600
- export { ACCESS_TOKEN_KEY, type AddApplicantNoteBody, type Alert, type AlertBody, type Application, type ApplicationsListQuery, type ApplyBody, type Awaitable, BOARD_ACCESS_GRANT_KEY, type Block, type BlockStatus, type BlockUserBody, type BlockedUser, type BlogAuthorEmbed, type BlogPostsListQuery, type BlogSearchBody, type BlogSimilarQuery, type BlogTagEmbed, type BoardAccessGrant, BoardApiError, type BoardAuthSession, BoardClient, type BoardRequest, type BoardSdk, type BoardSeo, type BoardUser, type BulkMoveApplicantsBody, type BulkRejectApplicantsBody, type CandidateAvatar, type CandidateEducation, type CandidateExperience, type CandidateLanguage, type CandidateProfile, type CandidateSkill, type ClaimableCompany, type CompaniesListQuery, type CompaniesSearchBody, type CompanyCategorySalary, type CompanyJobsListQuery, type CompanyListEnvelope, type CompanyMarket, type CompanyMarketRef, type CompanyMarketsListQuery, type CompanyMembership, type CompanySalary, type CompanySimilarQuery, type ConfirmWorkEmailBody, type ConsumeMagicLinkBody, type Conversation, type ConversationArchive, type ConversationDetail, type ConversationRef, type ConversationsListQuery, type CreateBoardClientOptions, type CreateCompanyBody, type CreateEducationBody, type CreateEmployerJobBody, type CreateExperienceBody, type CreateJobPostingInput, type CreatePipelineStageBody, type CustomStorage, type EditMessageBody, type EducationRequirement, type EmbedJobsQuery, type EmployerApplicant, type EmployerBillingOption, type EmployerCheckout, type EmployerCheckoutBody, type EmployerCompany, type EmployerCompanySearchQuery, type EmployerJob, type EmployerJobSummary, type EmployerJobsListQuery, type EmployerPipeline, type EmployerPipelineQuery, type EmployerPipelineStage, type EmploymentType, type FetchOptions, type FindExistingConversationQuery, type ForgotPasswordBody, type HandleAvailability, type JobAlertConfirmation, type JobAlertDeletePreferenceInput, type JobAlertFiltersInput, type JobAlertFrequency, type JobAlertManageQuery, type JobAlertManageResult, type JobAlertManageState, type JobAlertManageTokenInput, type JobAlertPreference, type JobAlertRemoteOption, type JobAlertResendResult, type JobAlertStoredFilters, type JobAlertSubscribeInput, type JobAlertSubscription, type JobAlertUpdatePreferenceInput, type JobCardListEnvelope, type JobCardSearchEnvelope, type JobCompany, type JobPostingBillingCheck, type JobPostingBillingOptions, type JobPostingBillingVerification, type JobPostingLogoResult, type JobPostingPlan, type JobPostingResult, type JobPostingSubscriptionEntitlements, type JobSort, type JobsListQuery, type JobsSearchBody, type LegalEntity, type LegalPageType, type ListEnvelope, type LocationSalaryDetail, type LocationSkillsIndex, type LocationTitlesIndex, type Logger, type LoginBody, type LogoutBody, type Message, type ModerationReport, type MoveApplicantStageBody, type NotificationPreference, type OAuthAuthorizationQuery, type OAuthAuthorizationUrl, type OAuthExchangeBody, type OAuthProvider, type OfficeLocation, type PlacesListQuery, type Plan, type PlanListEnvelope, type PlansListQuery, type PublicBlogAdjacentPosts, type PublicBlogAuthor, type PublicBlogPost, type PublicBlogPostSummary, type PublicBlogTag, type PublicBoard, type PublicBoardAnalytics, type PublicBoardFeatures, type PublicBoardTheme, type PublicCompany, type PublicCompanyDetail, type PublicJob, type PublicJobCard, type PublicLegalPage, type PublicPlace, REFRESH_TOKEN_KEY, type ReadReceipt, type RedirectResolution, type RefreshBody, type RegisterBody, type RelatedSearch, type RemoteOption, type RemotePermit, type RemoteTimezone, type ReorderPipelineStagesBody, type ReplyBody, type ReportBody, type RequestMagicLinkBody, type ResetPasswordBody, type Resume, type ResumeUploadOptions, SDK_VERSION, type SalaryCompany, type SalaryDetailQuery, type SalaryLocation, type SalarySkill, type SalaryTitle, type SalesLedPlan, type SalesLedPlanListEnvelope, type SaveJobBody, type SavedJob, type SavedJobsListQuery, type SearchEnvelope, type SendWorkEmailBody, type Seniority, type SkillLocationSalary, type SkillLocationsIndex, type SkillSalaryDetail, type StartAboutApplicationBody, type StartConversationBody, type StorageMode, type StorefrontPagination, type TalentDirectoryEntry, type TalentDirectoryListEnvelope, type TalentDirectoryQuery, type TalentProfile, type TaxonomyGeo, type TaxonomyResolution, type ThreadMessagesQuery, type TitleLocationSalary, type TitleLocationsIndex, type TitleSalaryDetail, type UnreadCount, type UnsubscribeBody, type UpdateApplicationFactsBody, type UpdateCandidateProfileBody, type UpdateEducationBody, type UpdateEmployerCompanyBody, type UpdateEmployerJobBody, type UpdateExperienceBody, type UpdateLanguagesBody, type UpdateNotificationPreferenceBody, type UpdatePipelineStageBody, type UpdateSkillsBody, type VerifyEmailBody, createBoardClient, isBoardApiError, isBoardPasswordRequired, isConflict, isForbidden, isNotFound, isRateLimited, isUnauthorized, isValidationError };
6751
+ export { ACCESS_TOKEN_KEY, type AccessCheckoutBody, type AccessCheckoutSession, type AccessCheckoutSessionState, type AccessGrant, type AccessPortalBody, type AccessPortalSession, type AddApplicantNoteBody, type Alert, type AlertBody, type Application, type ApplicationsListQuery, type ApplyBody, type Awaitable, BOARD_ACCESS_GRANT_KEY, type Block, type BlockStatus, type BlockUserBody, type BlockedUser, type BlogAuthorEmbed, type BlogPostsListQuery, type BlogSearchBody, type BlogSimilarQuery, type BlogTagEmbed, type BoardAccessGrant, BoardApiError, type BoardAuthSession, BoardClient, type BoardRequest, type BoardSdk, type BoardSeo, type BoardUser, type BulkMoveApplicantsBody, type BulkRejectApplicantsBody, type CandidateAvatar, type CandidateEducation, type CandidateExperience, type CandidateLanguage, type CandidateProfile, type CandidateSkill, type ClaimableCompany, type CompaniesListQuery, type CompaniesSearchBody, type CompanyCategorySalary, type CompanyJobsListQuery, type CompanyListEnvelope, type CompanyMarket, type CompanyMarketRef, type CompanyMarketsListQuery, type CompanyMembership, type CompanySalary, type CompanySimilarQuery, type ConfirmWorkEmailBody, type ConsumeMagicLinkBody, type Conversation, type ConversationArchive, type ConversationDetail, type ConversationRef, type ConversationsListQuery, type CreateBoardClientOptions, type CreateCompanyBody, type CreateEducationBody, type CreateEmployerJobBody, type CreateExperienceBody, type CreateJobPostingInput, type CreatePipelineStageBody, type CustomFieldDefinition, type CustomFieldOption, type CustomFieldType, type CustomFieldValue, type CustomFieldValues, type CustomStorage, type EditMessageBody, type EducationRequirement, type EmbedJobsQuery, type EmployerApplicant, type EmployerBillingOption, type EmployerCheckout, type EmployerCheckoutBody, type EmployerCompany, type EmployerCompanySearchQuery, type EmployerJob, type EmployerJobSummary, type EmployerJobsListQuery, type EmployerPipeline, type EmployerPipelineQuery, type EmployerPipelineStage, type EmploymentType, type FetchOptions, type FindExistingConversationQuery, type ForgotPasswordBody, type HandleAvailability, type JobAlertConfirmation, type JobAlertDeletePreferenceInput, type JobAlertFiltersInput, type JobAlertFrequency, type JobAlertManageQuery, type JobAlertManageResult, type JobAlertManageState, type JobAlertManageTokenInput, type JobAlertPreference, type JobAlertRemoteOption, type JobAlertResendResult, type JobAlertStoredFilters, type JobAlertSubscribeInput, type JobAlertSubscription, type JobAlertUpdatePreferenceInput, type JobCardListEnvelope, type JobCardSearchEnvelope, type JobCompany, type JobPostingBillingCheck, type JobPostingBillingOptions, type JobPostingBillingVerification, type JobPostingLogoResult, type JobPostingPlan, type JobPostingResult, type JobPostingSubscriptionEntitlements, type JobSort, type JobsListQuery, type JobsSearchBody, type JobsSimilarQuery, type LegalEntity, type LegalPageType, type ListEnvelope, type LocationSalaryDetail, type LocationSkillsIndex, type LocationTitlesIndex, type Logger, type LoginBody, type LogoutBody, type Message, type ModerationReport, type MoveApplicantStageBody, type NotificationPreference, type OAuthAuthorizationQuery, type OAuthAuthorizationUrl, type OAuthExchangeBody, type OAuthProvider, type OfficeLocation, type PaywallOffer, type PaywallOfferListEnvelope, type PlacesListQuery, type Plan, type PlanListEnvelope, type PlansListQuery, type PublicBlogAdjacentPosts, type PublicBlogAuthor, type PublicBlogPost, type PublicBlogPostSummary, type PublicBlogTag, type PublicBoard, type PublicBoardAnalytics, type PublicBoardFeatures, type PublicBoardTheme, type PublicCompany, type PublicCompanyDetail, type PublicJob, type PublicJobCard, type PublicLegalPage, type PublicPlace, REFRESH_TOKEN_KEY, type ReadReceipt, type RedirectResolution, type RefreshBody, type RegisterBody, type RelatedSearch, type RemoteOption, type RemotePermit, type RemoteTimezone, type ReorderPipelineStagesBody, type ReplyBody, type ReportBody, type RequestMagicLinkBody, type ResetPasswordBody, type Resume, type ResumeUploadOptions, SDK_VERSION, type SalaryCompany, type SalaryDetailQuery, type SalaryLocation, type SalarySkill, type SalaryTitle, type SalesLedPlan, type SalesLedPlanListEnvelope, type SaveJobBody, type SavedJob, type SavedJobsListQuery, type SearchEnvelope, type SendWorkEmailBody, type Seniority, type SkillLocationSalary, type SkillLocationsIndex, type SkillSalaryDetail, type StartAboutApplicationBody, type StartConversationBody, type StorageMode, type StorefrontPagination, type TalentDirectoryEntry, type TalentDirectoryListEnvelope, type TalentDirectoryQuery, type TalentProfile, type TaxonomyGeo, type TaxonomyResolution, type ThreadMessagesQuery, type TitleLocationSalary, type TitleLocationsIndex, type TitleSalaryDetail, type UnreadCount, type UnsubscribeBody, type UpdateApplicationFactsBody, type UpdateCandidateProfileBody, type UpdateEducationBody, type UpdateEmployerCompanyBody, type UpdateEmployerJobBody, type UpdateExperienceBody, type UpdateLanguagesBody, type UpdateNotificationPreferenceBody, type UpdatePipelineStageBody, type UpdateSkillsBody, type VerifyEmailBody, createBoardClient, isBoardApiError, isBoardPasswordRequired, isConflict, isForbidden, isNotFound, isRateLimited, isUnauthorized, isValidationError };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,61 @@
1
1
  interface components {
2
2
  schemas: {
3
+ AccessCheckoutBody: {
4
+ /**
5
+ * @description The offer tier to purchase (from `GET /paywall/offers/enabled`).
6
+ * @enum {string}
7
+ */
8
+ offerKey: "daily" | "weekly" | "monthly" | "quarterly" | "yearly" | "lifetime";
9
+ /** @description Relative path Stripe returns the buyer to on completion; `session_id` is appended. */
10
+ returnPath: string;
11
+ /** @enum {string} */
12
+ colorMode: "light" | "dark";
13
+ };
14
+ AccessCheckoutSession: {
15
+ /** @enum {string} */
16
+ object: "checkout_session";
17
+ sessionId: string;
18
+ /** @description The Checkout Session client secret to mount the embedded form. */
19
+ clientSecret: string;
20
+ /** @description The board’s connected Stripe account to initialise Stripe.js with. */
21
+ stripeAccountId: string;
22
+ /** @description The platform Stripe publishable key for `loadStripe`. */
23
+ publishableKey: string;
24
+ /**
25
+ * @description `recurring` grants get a manage-subscription portal; `lifetime` do not.
26
+ * @enum {string}
27
+ */
28
+ offerType: "recurring" | "lifetime";
29
+ };
30
+ AccessCheckoutSessionState: {
31
+ /** @enum {string} */
32
+ object: "checkout_session_state";
33
+ /** @enum {string} */
34
+ status: "open" | "complete" | "expired";
35
+ clientSecret: string | null;
36
+ };
37
+ AccessGrant: {
38
+ /** @enum {string} */
39
+ object: "access_grant";
40
+ hasAccess: boolean;
41
+ /** @enum {string|null} */
42
+ status: "active" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "canceled" | "pending" | null;
43
+ /** @enum {string|null} */
44
+ offerType: "recurring" | "lifetime" | null;
45
+ offerKey: string | null;
46
+ currentPeriodEnd: string | null;
47
+ cancelAtPeriodEnd: boolean;
48
+ };
49
+ AccessPortalBody: {
50
+ /** @description Relative path Stripe returns the buyer to; defaults to the board root. */
51
+ returnPath?: string;
52
+ };
53
+ AccessPortalSession: {
54
+ /** @enum {string} */
55
+ object: "portal_session";
56
+ /** Format: uri */
57
+ url: string;
58
+ };
3
59
  AddApplicantNoteBody: {
4
60
  /** @description The note text. */
5
61
  body: string;
@@ -1073,16 +1129,16 @@ interface components {
1073
1129
  name: string;
1074
1130
  };
1075
1131
  CustomFieldDefinition: {
1076
- /** @description Immutable per-board slug. Use this as the key in `customFieldValues` when writing values via POST/PATCH /v1/jobs. */
1132
+ /** @description Immutable per-board slug. The key in a job’s `customFieldValues`, and the frontend translation token (`customField.<key>.*`). */
1077
1133
  key: string;
1078
1134
  /** @description Authoring-default label; the localized public string lives in the board template. */
1079
1135
  label: string;
1080
1136
  /**
1081
- * @description Field type, which dictates the accepted value: `short_text`/`long_text` → string; `single_select` → one option key (string); `multi_select` → array of option keys; `boolean` → boolean; `number` → number.
1137
+ * @description Field type, which dictates the value: `short_text`/`long_text` → string; `single_select` → one option key; `multi_select` → array of option keys; `boolean` → boolean; `number` → number.
1082
1138
  * @enum {string}
1083
1139
  */
1084
1140
  type: "short_text" | "long_text" | "single_select" | "multi_select" | "boolean" | "number";
1085
- /** @description Present only for `single_select`/`multi_select`. A written value must be one (or, for multi, several) of these option `key`s — never a label. */
1141
+ /** @description Present only for `single_select`/`multi_select`. A stored value is one (or, for multi, several) of these option `key`s — never a label. */
1086
1142
  options?: components["schemas"]["CustomFieldOption"][];
1087
1143
  /** @description When true, the value cannot be cleared or left empty on a write (rejected with `custom_field_required`). */
1088
1144
  required: boolean;
@@ -1092,7 +1148,7 @@ interface components {
1092
1148
  max?: number;
1093
1149
  };
1094
1150
  CustomFieldOption: {
1095
- /** @description Stable option key — send this in a write, not the label. */
1151
+ /** @description Stable option key — the value stored on a job, not the label. */
1096
1152
  key: string;
1097
1153
  /** @description Display label (authoring default; localized per board in the template). */
1098
1154
  label: string;
@@ -2191,6 +2247,24 @@ interface components {
2191
2247
  [key: string]: unknown;
2192
2248
  };
2193
2249
  };
2250
+ PaywallOffer: {
2251
+ /** @enum {string} */
2252
+ object: "paywall_offer";
2253
+ /** @description The tier key posted to checkout (e.g. `monthly`, `lifetime`). */
2254
+ offerKey: string;
2255
+ label: string;
2256
+ billingLabel: string;
2257
+ amountCents: number;
2258
+ currency: string;
2259
+ /**
2260
+ * @description `recurring` tiers get a manage-subscription portal; `lifetime` do not.
2261
+ * @enum {string}
2262
+ */
2263
+ offerType: "recurring" | "lifetime";
2264
+ intervalUnit: string | null;
2265
+ intervalCount: number | null;
2266
+ isDefault: boolean;
2267
+ };
2194
2268
  Plan: {
2195
2269
  /** @enum {string} */
2196
2270
  object: "plan";
@@ -2343,6 +2417,8 @@ interface components {
2343
2417
  };
2344
2418
  };
2345
2419
  } | null;
2420
+ /** @description Operator-defined custom job-field definitions (CAV-294), in display order. Board-wide; the frontend uses these to render and localize each job's opaque `customFieldValues`. Empty when the board defines none. Display-only — not filterable or searchable in v1. */
2421
+ customFields: components["schemas"]["CustomFieldDefinition"][];
2346
2422
  };
2347
2423
  PublicCompaniesSearchBody: {
2348
2424
  /** @description Free-text search query matched against company name. Up to 200 characters. */
@@ -2477,6 +2553,10 @@ interface components {
2477
2553
  slug: string;
2478
2554
  name: string;
2479
2555
  }[];
2556
+ /** @description Opaque, display-only custom-field values (CAV-294), keyed by each field's `key`. Values are the option `key`(s) for select fields, or the raw boolean/number/text otherwise — resolve labels via the board's `customFields` definitions (see `GET /v1/boards/:identifier`). `{}` when the board defines no custom fields. Not filterable or searchable in v1. */
2557
+ customFieldValues: {
2558
+ [key: string]: string | string[] | boolean | number;
2559
+ };
2480
2560
  };
2481
2561
  PublicJobAlertConfirmation: {
2482
2562
  /** @enum {string} */
@@ -3650,102 +3730,6 @@ interface components {
3650
3730
  pathItems: never;
3651
3731
  }
3652
3732
 
3653
- type Schemas = components['schemas'];
3654
-
3655
- /**
3656
- * Stripe-shaped success envelopes (`01-conventions.md` §5.1). The
3657
- * server MAY add top-level fields; consumers MUST ignore unknown
3658
- * fields.
3659
- */
3660
- /**
3661
- * Medusa-style storefront pagination fields (ADR-0037 §7), populated only by
3662
- * the board jobs catalog reads (browse / search / company-jobs); absent on
3663
- * every other list/search. `nextCursor` is preserved alongside (offset-encoded).
3664
- */
3665
- interface StorefrontPagination {
3666
- /** Total matching results ("X jobs"). */
3667
- count?: number;
3668
- /** The page size used for this response. */
3669
- limit?: number;
3670
- /** Number of items skipped before this page. */
3671
- offset?: number;
3672
- /** Items hidden behind the candidate paywall for the current viewer; absent/0 when entitled. */
3673
- gatedCount?: number;
3674
- }
3675
- interface ListEnvelope<T> extends StorefrontPagination {
3676
- object: 'list';
3677
- url: string;
3678
- hasMore: boolean;
3679
- /** `null` when `hasMore` is false — always present, never undefined. */
3680
- nextCursor: string | null;
3681
- data: T[];
3682
- }
3683
- interface SearchEnvelope<T> extends StorefrontPagination {
3684
- object: 'search_result';
3685
- url: string;
3686
- hasMore: boolean;
3687
- nextCursor: string | null;
3688
- data: T[];
3689
- }
3690
-
3691
- type PublicJob = Schemas['PublicJob'];
3692
- type PublicJobCard = Schemas['PublicJobCard'];
3693
- type JobCompany = Schemas['JobCompany'];
3694
- type OfficeLocation = Schemas['JobOfficeLocation'];
3695
- type RemoteOption = NonNullable<PublicJob['remoteOption']>;
3696
- type EmploymentType = NonNullable<PublicJob['employmentType']>;
3697
- type Seniority = NonNullable<PublicJob['seniority']>;
3698
- /** Candidate-facing result ordering (ADR-0048); `relevance` is the default. */
3699
- type JobSort = NonNullable<Schemas['PublicSearchJobsBody']['sort']>;
3700
- type EducationRequirement = PublicJob['educationRequirements'][number];
3701
- type RemotePermit = PublicJob['remotePermits'][number];
3702
- type RemoteTimezone = PublicJob['remoteTimezones'][number];
3703
- /**
3704
- * Derived suggestion on a browse list (ADR-0037 §8): jobs surface `category`
3705
- * and `skill` terms; the companies list surfaces `market` terms.
3706
- */
3707
- interface RelatedSearch {
3708
- type: 'category' | 'skill' | 'market';
3709
- slug: string;
3710
- term: string;
3711
- count: number;
3712
- }
3713
- /** The browse list envelope — `PublicJobCard`s + storefront fields + `relatedSearches`. */
3714
- interface JobCardListEnvelope extends ListEnvelope<PublicJobCard> {
3715
- relatedSearches?: RelatedSearch[];
3716
- }
3717
- /** The search envelope — `PublicJobCard`s + storefront fields. */
3718
- type JobCardSearchEnvelope = SearchEnvelope<PublicJobCard>;
3719
- type JobsListQuery = {
3720
- cursor?: string;
3721
- /** 1–100. */
3722
- limit?: number;
3723
- /** Storefront page offset; takes precedence over `cursor`. `offset + limit` ≤ 10,000. */
3724
- offset?: number;
3725
- /** Repeated param (up to 10) — OR-matched. Repeat `companyId` per value. */
3726
- companyId?: string[];
3727
- remoteOption?: RemoteOption[];
3728
- employmentType?: EmploymentType[];
3729
- seniority?: Seniority[];
3730
- /** Result ordering (ADR-0048). Absent ⇒ `relevance` (the featured-ranked browse). */
3731
- sort?: JobSort;
3732
- /** Place slug for a geo radius search; unresolvable slugs are ignored. */
3733
- location?: string;
3734
- /** Radius in km around `location` (10–250; default 50). */
3735
- radius?: number;
3736
- /** Category slug seed (the `/jobs/[keyword]` page) — server resolves it to the English source name; unresolvable → 404. */
3737
- category?: string;
3738
- /** Skill slug seed (the `/jobs/skills/[skill]` page) — server-resolved; unresolvable → 404. */
3739
- skill?: string;
3740
- /** Sparse fieldset (Medusa-style `+field`). Only `'+description'` is supported — adds `description` to each card. */
3741
- fields?: string;
3742
- };
3743
- type JobsSimilarQuery = {
3744
- /** How many similar jobs to return (1–20; default 5). */
3745
- limit?: number;
3746
- };
3747
- type JobsSearchBody = Schemas['PublicSearchJobsBody'];
3748
-
3749
3733
  type Awaitable<T> = T | Promise<T>;
3750
3734
  /**
3751
3735
  * Async token storage. The SDK reads the access token from storage on
@@ -3865,7 +3849,9 @@ declare function isConflict(e: unknown): e is BoardApiError;
3865
3849
  * constant because the package is platform-neutral and cannot read
3866
3850
  * package.json at runtime.
3867
3851
  */
3868
- declare const SDK_VERSION = "1.23.0";
3852
+ declare const SDK_VERSION = "1.25.0";
3853
+
3854
+ type Schemas = components['schemas'];
3869
3855
 
3870
3856
  type BoardUser = Schemas['BoardUser'];
3871
3857
  type BoardAuthSession = Schemas['BoardAuthSession'];
@@ -3889,6 +3875,15 @@ type PublicBoard = Schemas['PublicBoardContext'];
3889
3875
  type PublicBoardFeatures = PublicBoard['features'];
3890
3876
  type PublicBoardAnalytics = PublicBoard['analytics'];
3891
3877
  type PublicBoardTheme = NonNullable<PublicBoard['theme']>;
3878
+ /**
3879
+ * An operator-defined custom job-field definition (CAV-294). Board-wide;
3880
+ * use it to render and localize a job's opaque `customFieldValues` (resolve
3881
+ * option `key`s → labels, honour field `type` and display order). Shared with
3882
+ * the Operator API's custom-field surface (one canonical schema).
3883
+ */
3884
+ type CustomFieldDefinition = Schemas['CustomFieldDefinition'];
3885
+ type CustomFieldType = CustomFieldDefinition['type'];
3886
+ type CustomFieldOption = Schemas['CustomFieldOption'];
3892
3887
 
3893
3888
  /**
3894
3889
  * The public SEO-infra payload (`board.seo()`) — the values a headless
@@ -3898,6 +3893,107 @@ type PublicBoardTheme = NonNullable<PublicBoard['theme']>;
3898
3893
  */
3899
3894
  type BoardSeo = Schemas['BoardSeo'];
3900
3895
 
3896
+ /**
3897
+ * Stripe-shaped success envelopes (`01-conventions.md` §5.1). The
3898
+ * server MAY add top-level fields; consumers MUST ignore unknown
3899
+ * fields.
3900
+ */
3901
+ /**
3902
+ * Medusa-style storefront pagination fields (ADR-0037 §7), populated only by
3903
+ * the board jobs catalog reads (browse / search / company-jobs); absent on
3904
+ * every other list/search. `nextCursor` is preserved alongside (offset-encoded).
3905
+ */
3906
+ interface StorefrontPagination {
3907
+ /** Total matching results ("X jobs"). */
3908
+ count?: number;
3909
+ /** The page size used for this response. */
3910
+ limit?: number;
3911
+ /** Number of items skipped before this page. */
3912
+ offset?: number;
3913
+ /** Items hidden behind the candidate paywall for the current viewer; absent/0 when entitled. */
3914
+ gatedCount?: number;
3915
+ }
3916
+ interface ListEnvelope<T> extends StorefrontPagination {
3917
+ object: 'list';
3918
+ url: string;
3919
+ hasMore: boolean;
3920
+ /** `null` when `hasMore` is false — always present, never undefined. */
3921
+ nextCursor: string | null;
3922
+ data: T[];
3923
+ }
3924
+ interface SearchEnvelope<T> extends StorefrontPagination {
3925
+ object: 'search_result';
3926
+ url: string;
3927
+ hasMore: boolean;
3928
+ nextCursor: string | null;
3929
+ data: T[];
3930
+ }
3931
+
3932
+ type PublicJob = Schemas['PublicJob'];
3933
+ type PublicJobCard = Schemas['PublicJobCard'];
3934
+ /**
3935
+ * A job's opaque, display-only custom-field values (CAV-294), keyed by each
3936
+ * field's `key`. Resolve labels via the board's `CustomFieldDefinition`s
3937
+ * (`board.context().customFields`).
3938
+ */
3939
+ type CustomFieldValues = PublicJob['customFieldValues'];
3940
+ type CustomFieldValue = CustomFieldValues[string];
3941
+ type JobCompany = Schemas['JobCompany'];
3942
+ type OfficeLocation = Schemas['JobOfficeLocation'];
3943
+ type RemoteOption = NonNullable<PublicJob['remoteOption']>;
3944
+ type EmploymentType = NonNullable<PublicJob['employmentType']>;
3945
+ type Seniority = NonNullable<PublicJob['seniority']>;
3946
+ /** Candidate-facing result ordering (ADR-0048); `relevance` is the default. */
3947
+ type JobSort = NonNullable<Schemas['PublicSearchJobsBody']['sort']>;
3948
+ type EducationRequirement = PublicJob['educationRequirements'][number];
3949
+ type RemotePermit = PublicJob['remotePermits'][number];
3950
+ type RemoteTimezone = PublicJob['remoteTimezones'][number];
3951
+ /**
3952
+ * Derived suggestion on a browse list (ADR-0037 §8): jobs surface `category`
3953
+ * and `skill` terms; the companies list surfaces `market` terms.
3954
+ */
3955
+ interface RelatedSearch {
3956
+ type: 'category' | 'skill' | 'market';
3957
+ slug: string;
3958
+ term: string;
3959
+ count: number;
3960
+ }
3961
+ /** The browse list envelope — `PublicJobCard`s + storefront fields + `relatedSearches`. */
3962
+ interface JobCardListEnvelope extends ListEnvelope<PublicJobCard> {
3963
+ relatedSearches?: RelatedSearch[];
3964
+ }
3965
+ /** The search envelope — `PublicJobCard`s + storefront fields. */
3966
+ type JobCardSearchEnvelope = SearchEnvelope<PublicJobCard>;
3967
+ type JobsListQuery = {
3968
+ cursor?: string;
3969
+ /** 1–100. */
3970
+ limit?: number;
3971
+ /** Storefront page offset; takes precedence over `cursor`. `offset + limit` ≤ 10,000. */
3972
+ offset?: number;
3973
+ /** Repeated param (up to 10) — OR-matched. Repeat `companyId` per value. */
3974
+ companyId?: string[];
3975
+ remoteOption?: RemoteOption[];
3976
+ employmentType?: EmploymentType[];
3977
+ seniority?: Seniority[];
3978
+ /** Result ordering (ADR-0048). Absent ⇒ `relevance` (the featured-ranked browse). */
3979
+ sort?: JobSort;
3980
+ /** Place slug for a geo radius search; unresolvable slugs are ignored. */
3981
+ location?: string;
3982
+ /** Radius in km around `location` (10–250; default 50). */
3983
+ radius?: number;
3984
+ /** Category slug seed (the `/jobs/[keyword]` page) — server resolves it to the English source name; unresolvable → 404. */
3985
+ category?: string;
3986
+ /** Skill slug seed (the `/jobs/skills/[skill]` page) — server-resolved; unresolvable → 404. */
3987
+ skill?: string;
3988
+ /** Sparse fieldset (Medusa-style `+field`). Only `'+description'` is supported — adds `description` to each card. */
3989
+ fields?: string;
3990
+ };
3991
+ type JobsSimilarQuery = {
3992
+ /** How many similar jobs to return (1–20; default 5). */
3993
+ limit?: number;
3994
+ };
3995
+ type JobsSearchBody = Schemas['PublicSearchJobsBody'];
3996
+
3901
3997
  type EmbedJobsQuery = {
3902
3998
  /** Free-text search query, up to 200 characters. */
3903
3999
  q?: string;
@@ -4051,6 +4147,26 @@ type PlansListQuery = {
4051
4147
  type PlanListEnvelope = ListEnvelope<Plan>;
4052
4148
  type SalesLedPlanListEnvelope = ListEnvelope<SalesLedPlan>;
4053
4149
 
4150
+ /** An enabled candidate-access paywall offer tier (public). */
4151
+ type PaywallOffer = Schemas['PaywallOffer'];
4152
+ /**
4153
+ * The connected-account embedded-checkout mount kit returned by
4154
+ * `board.me.access.checkout`. Mount with `loadStripe(publishableKey, {
4155
+ * stripeAccount: stripeAccountId })` then `initEmbeddedCheckout({ clientSecret })`.
4156
+ */
4157
+ type AccessCheckoutSession = Schemas['AccessCheckoutSession'];
4158
+ /** The polled state of a checkout session (`board.me.access.retrieveCheckout`). */
4159
+ type AccessCheckoutSessionState = Schemas['AccessCheckoutSessionState'];
4160
+ /** The viewer's candidate-access entitlement (`board.me.access.grant`). */
4161
+ type AccessGrant = Schemas['AccessGrant'];
4162
+ /** A minted Stripe billing-portal session (`board.me.access.portal`). */
4163
+ type AccessPortalSession = Schemas['AccessPortalSession'];
4164
+ /** Body for `board.me.access.checkout`. */
4165
+ type AccessCheckoutBody = Schemas['AccessCheckoutBody'];
4166
+ /** Body for `board.me.access.portal`. */
4167
+ type AccessPortalBody = Schemas['AccessPortalBody'];
4168
+ type PaywallOfferListEnvelope = ListEnvelope<PaywallOffer>;
4169
+
4054
4170
  type SavedJob = Schemas['SavedJob'];
4055
4171
  type SavedJobsListQuery = {
4056
4172
  cursor?: string;
@@ -4429,6 +4545,7 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
4429
4545
  };
4430
4546
  };
4431
4547
  } | null;
4548
+ customFields: components["schemas"]["CustomFieldDefinition"][];
4432
4549
  }>;
4433
4550
  /**
4434
4551
  * Board SEO infra — `ads.txt`, IndexNow key, Google site-verification, and
@@ -4514,6 +4631,9 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
4514
4631
  slug: string;
4515
4632
  name: string;
4516
4633
  }[];
4634
+ customFieldValues: {
4635
+ [key: string]: string | string[] | boolean | number;
4636
+ };
4517
4637
  }>;
4518
4638
  search(body: JobsSearchBody, query?: Record<string, never>, options?: FetchOptions): Promise<JobCardSearchEnvelope>;
4519
4639
  similar(jobSlug: string, query?: JobsSimilarQuery, options?: FetchOptions): Promise<ListEnvelope<{
@@ -5898,6 +6018,34 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
5898
6018
  blocked: boolean;
5899
6019
  }>;
5900
6020
  };
6021
+ access: {
6022
+ checkout(body: AccessCheckoutBody, options?: FetchOptions): Promise<{
6023
+ object: "checkout_session";
6024
+ sessionId: string;
6025
+ clientSecret: string;
6026
+ stripeAccountId: string;
6027
+ publishableKey: string;
6028
+ offerType: "recurring" | "lifetime";
6029
+ }>;
6030
+ retrieveCheckout(sessionId: string, options?: FetchOptions): Promise<{
6031
+ object: "checkout_session_state";
6032
+ status: "open" | "complete" | "expired";
6033
+ clientSecret: string | null;
6034
+ }>;
6035
+ grant(options?: FetchOptions): Promise<{
6036
+ object: "access_grant";
6037
+ hasAccess: boolean;
6038
+ status: "active" | "past_due" | "unpaid" | "incomplete" | "incomplete_expired" | "canceled" | "pending" | null;
6039
+ offerType: "recurring" | "lifetime" | null;
6040
+ offerKey: string | null;
6041
+ currentPeriodEnd: string | null;
6042
+ cancelAtPeriodEnd: boolean;
6043
+ }>;
6044
+ portal(body?: AccessPortalBody, options?: FetchOptions): Promise<{
6045
+ object: "portal_session";
6046
+ url: string;
6047
+ }>;
6048
+ };
5901
6049
  };
5902
6050
  password: {
5903
6051
  verify(password: string, options?: FetchOptions): Promise<BoardAccessGrant>;
@@ -6594,7 +6742,10 @@ declare function createBoardClient(options: CreateBoardClientOptions): {
6594
6742
  list(query?: PlansListQuery, options?: FetchOptions): Promise<PlanListEnvelope>;
6595
6743
  salesLed(options?: FetchOptions): Promise<SalesLedPlanListEnvelope>;
6596
6744
  };
6745
+ paywall: {
6746
+ offers(options?: FetchOptions): Promise<PaywallOfferListEnvelope>;
6747
+ };
6597
6748
  };
6598
6749
  type BoardSdk = ReturnType<typeof createBoardClient>;
6599
6750
 
6600
- export { ACCESS_TOKEN_KEY, type AddApplicantNoteBody, type Alert, type AlertBody, type Application, type ApplicationsListQuery, type ApplyBody, type Awaitable, BOARD_ACCESS_GRANT_KEY, type Block, type BlockStatus, type BlockUserBody, type BlockedUser, type BlogAuthorEmbed, type BlogPostsListQuery, type BlogSearchBody, type BlogSimilarQuery, type BlogTagEmbed, type BoardAccessGrant, BoardApiError, type BoardAuthSession, BoardClient, type BoardRequest, type BoardSdk, type BoardSeo, type BoardUser, type BulkMoveApplicantsBody, type BulkRejectApplicantsBody, type CandidateAvatar, type CandidateEducation, type CandidateExperience, type CandidateLanguage, type CandidateProfile, type CandidateSkill, type ClaimableCompany, type CompaniesListQuery, type CompaniesSearchBody, type CompanyCategorySalary, type CompanyJobsListQuery, type CompanyListEnvelope, type CompanyMarket, type CompanyMarketRef, type CompanyMarketsListQuery, type CompanyMembership, type CompanySalary, type CompanySimilarQuery, type ConfirmWorkEmailBody, type ConsumeMagicLinkBody, type Conversation, type ConversationArchive, type ConversationDetail, type ConversationRef, type ConversationsListQuery, type CreateBoardClientOptions, type CreateCompanyBody, type CreateEducationBody, type CreateEmployerJobBody, type CreateExperienceBody, type CreateJobPostingInput, type CreatePipelineStageBody, type CustomStorage, type EditMessageBody, type EducationRequirement, type EmbedJobsQuery, type EmployerApplicant, type EmployerBillingOption, type EmployerCheckout, type EmployerCheckoutBody, type EmployerCompany, type EmployerCompanySearchQuery, type EmployerJob, type EmployerJobSummary, type EmployerJobsListQuery, type EmployerPipeline, type EmployerPipelineQuery, type EmployerPipelineStage, type EmploymentType, type FetchOptions, type FindExistingConversationQuery, type ForgotPasswordBody, type HandleAvailability, type JobAlertConfirmation, type JobAlertDeletePreferenceInput, type JobAlertFiltersInput, type JobAlertFrequency, type JobAlertManageQuery, type JobAlertManageResult, type JobAlertManageState, type JobAlertManageTokenInput, type JobAlertPreference, type JobAlertRemoteOption, type JobAlertResendResult, type JobAlertStoredFilters, type JobAlertSubscribeInput, type JobAlertSubscription, type JobAlertUpdatePreferenceInput, type JobCardListEnvelope, type JobCardSearchEnvelope, type JobCompany, type JobPostingBillingCheck, type JobPostingBillingOptions, type JobPostingBillingVerification, type JobPostingLogoResult, type JobPostingPlan, type JobPostingResult, type JobPostingSubscriptionEntitlements, type JobSort, type JobsListQuery, type JobsSearchBody, type LegalEntity, type LegalPageType, type ListEnvelope, type LocationSalaryDetail, type LocationSkillsIndex, type LocationTitlesIndex, type Logger, type LoginBody, type LogoutBody, type Message, type ModerationReport, type MoveApplicantStageBody, type NotificationPreference, type OAuthAuthorizationQuery, type OAuthAuthorizationUrl, type OAuthExchangeBody, type OAuthProvider, type OfficeLocation, type PlacesListQuery, type Plan, type PlanListEnvelope, type PlansListQuery, type PublicBlogAdjacentPosts, type PublicBlogAuthor, type PublicBlogPost, type PublicBlogPostSummary, type PublicBlogTag, type PublicBoard, type PublicBoardAnalytics, type PublicBoardFeatures, type PublicBoardTheme, type PublicCompany, type PublicCompanyDetail, type PublicJob, type PublicJobCard, type PublicLegalPage, type PublicPlace, REFRESH_TOKEN_KEY, type ReadReceipt, type RedirectResolution, type RefreshBody, type RegisterBody, type RelatedSearch, type RemoteOption, type RemotePermit, type RemoteTimezone, type ReorderPipelineStagesBody, type ReplyBody, type ReportBody, type RequestMagicLinkBody, type ResetPasswordBody, type Resume, type ResumeUploadOptions, SDK_VERSION, type SalaryCompany, type SalaryDetailQuery, type SalaryLocation, type SalarySkill, type SalaryTitle, type SalesLedPlan, type SalesLedPlanListEnvelope, type SaveJobBody, type SavedJob, type SavedJobsListQuery, type SearchEnvelope, type SendWorkEmailBody, type Seniority, type SkillLocationSalary, type SkillLocationsIndex, type SkillSalaryDetail, type StartAboutApplicationBody, type StartConversationBody, type StorageMode, type StorefrontPagination, type TalentDirectoryEntry, type TalentDirectoryListEnvelope, type TalentDirectoryQuery, type TalentProfile, type TaxonomyGeo, type TaxonomyResolution, type ThreadMessagesQuery, type TitleLocationSalary, type TitleLocationsIndex, type TitleSalaryDetail, type UnreadCount, type UnsubscribeBody, type UpdateApplicationFactsBody, type UpdateCandidateProfileBody, type UpdateEducationBody, type UpdateEmployerCompanyBody, type UpdateEmployerJobBody, type UpdateExperienceBody, type UpdateLanguagesBody, type UpdateNotificationPreferenceBody, type UpdatePipelineStageBody, type UpdateSkillsBody, type VerifyEmailBody, createBoardClient, isBoardApiError, isBoardPasswordRequired, isConflict, isForbidden, isNotFound, isRateLimited, isUnauthorized, isValidationError };
6751
+ export { ACCESS_TOKEN_KEY, type AccessCheckoutBody, type AccessCheckoutSession, type AccessCheckoutSessionState, type AccessGrant, type AccessPortalBody, type AccessPortalSession, type AddApplicantNoteBody, type Alert, type AlertBody, type Application, type ApplicationsListQuery, type ApplyBody, type Awaitable, BOARD_ACCESS_GRANT_KEY, type Block, type BlockStatus, type BlockUserBody, type BlockedUser, type BlogAuthorEmbed, type BlogPostsListQuery, type BlogSearchBody, type BlogSimilarQuery, type BlogTagEmbed, type BoardAccessGrant, BoardApiError, type BoardAuthSession, BoardClient, type BoardRequest, type BoardSdk, type BoardSeo, type BoardUser, type BulkMoveApplicantsBody, type BulkRejectApplicantsBody, type CandidateAvatar, type CandidateEducation, type CandidateExperience, type CandidateLanguage, type CandidateProfile, type CandidateSkill, type ClaimableCompany, type CompaniesListQuery, type CompaniesSearchBody, type CompanyCategorySalary, type CompanyJobsListQuery, type CompanyListEnvelope, type CompanyMarket, type CompanyMarketRef, type CompanyMarketsListQuery, type CompanyMembership, type CompanySalary, type CompanySimilarQuery, type ConfirmWorkEmailBody, type ConsumeMagicLinkBody, type Conversation, type ConversationArchive, type ConversationDetail, type ConversationRef, type ConversationsListQuery, type CreateBoardClientOptions, type CreateCompanyBody, type CreateEducationBody, type CreateEmployerJobBody, type CreateExperienceBody, type CreateJobPostingInput, type CreatePipelineStageBody, type CustomFieldDefinition, type CustomFieldOption, type CustomFieldType, type CustomFieldValue, type CustomFieldValues, type CustomStorage, type EditMessageBody, type EducationRequirement, type EmbedJobsQuery, type EmployerApplicant, type EmployerBillingOption, type EmployerCheckout, type EmployerCheckoutBody, type EmployerCompany, type EmployerCompanySearchQuery, type EmployerJob, type EmployerJobSummary, type EmployerJobsListQuery, type EmployerPipeline, type EmployerPipelineQuery, type EmployerPipelineStage, type EmploymentType, type FetchOptions, type FindExistingConversationQuery, type ForgotPasswordBody, type HandleAvailability, type JobAlertConfirmation, type JobAlertDeletePreferenceInput, type JobAlertFiltersInput, type JobAlertFrequency, type JobAlertManageQuery, type JobAlertManageResult, type JobAlertManageState, type JobAlertManageTokenInput, type JobAlertPreference, type JobAlertRemoteOption, type JobAlertResendResult, type JobAlertStoredFilters, type JobAlertSubscribeInput, type JobAlertSubscription, type JobAlertUpdatePreferenceInput, type JobCardListEnvelope, type JobCardSearchEnvelope, type JobCompany, type JobPostingBillingCheck, type JobPostingBillingOptions, type JobPostingBillingVerification, type JobPostingLogoResult, type JobPostingPlan, type JobPostingResult, type JobPostingSubscriptionEntitlements, type JobSort, type JobsListQuery, type JobsSearchBody, type JobsSimilarQuery, type LegalEntity, type LegalPageType, type ListEnvelope, type LocationSalaryDetail, type LocationSkillsIndex, type LocationTitlesIndex, type Logger, type LoginBody, type LogoutBody, type Message, type ModerationReport, type MoveApplicantStageBody, type NotificationPreference, type OAuthAuthorizationQuery, type OAuthAuthorizationUrl, type OAuthExchangeBody, type OAuthProvider, type OfficeLocation, type PaywallOffer, type PaywallOfferListEnvelope, type PlacesListQuery, type Plan, type PlanListEnvelope, type PlansListQuery, type PublicBlogAdjacentPosts, type PublicBlogAuthor, type PublicBlogPost, type PublicBlogPostSummary, type PublicBlogTag, type PublicBoard, type PublicBoardAnalytics, type PublicBoardFeatures, type PublicBoardTheme, type PublicCompany, type PublicCompanyDetail, type PublicJob, type PublicJobCard, type PublicLegalPage, type PublicPlace, REFRESH_TOKEN_KEY, type ReadReceipt, type RedirectResolution, type RefreshBody, type RegisterBody, type RelatedSearch, type RemoteOption, type RemotePermit, type RemoteTimezone, type ReorderPipelineStagesBody, type ReplyBody, type ReportBody, type RequestMagicLinkBody, type ResetPasswordBody, type Resume, type ResumeUploadOptions, SDK_VERSION, type SalaryCompany, type SalaryDetailQuery, type SalaryLocation, type SalarySkill, type SalaryTitle, type SalesLedPlan, type SalesLedPlanListEnvelope, type SaveJobBody, type SavedJob, type SavedJobsListQuery, type SearchEnvelope, type SendWorkEmailBody, type Seniority, type SkillLocationSalary, type SkillLocationsIndex, type SkillSalaryDetail, type StartAboutApplicationBody, type StartConversationBody, type StorageMode, type StorefrontPagination, type TalentDirectoryEntry, type TalentDirectoryListEnvelope, type TalentDirectoryQuery, type TalentProfile, type TaxonomyGeo, type TaxonomyResolution, type ThreadMessagesQuery, type TitleLocationSalary, type TitleLocationsIndex, type TitleSalaryDetail, type UnreadCount, type UnsubscribeBody, type UpdateApplicationFactsBody, type UpdateCandidateProfileBody, type UpdateEducationBody, type UpdateEmployerCompanyBody, type UpdateEmployerJobBody, type UpdateExperienceBody, type UpdateLanguagesBody, type UpdateNotificationPreferenceBody, type UpdatePipelineStageBody, type UpdateSkillsBody, type VerifyEmailBody, createBoardClient, isBoardApiError, isBoardPasswordRequired, isConflict, isForbidden, isNotFound, isRateLimited, isUnauthorized, isValidationError };
package/dist/index.js CHANGED
@@ -149,7 +149,7 @@ async function clearSession(storage) {
149
149
  }
150
150
 
151
151
  // src/version.ts
152
- var SDK_VERSION = "1.23.0";
152
+ var SDK_VERSION = "1.25.0";
153
153
 
154
154
  // src/client.ts
155
155
  function isRawBody(body) {
@@ -2054,6 +2054,79 @@ function meNamespace(client) {
2054
2054
  { ...options, method: "POST", body }
2055
2055
  );
2056
2056
  }
2057
+ },
2058
+ /**
2059
+ * The candidate job-access paywall — the authenticated money flow (doc 36 /
2060
+ * ADR-0056). Enumerate offers publicly with `board.paywall.offers()`, then
2061
+ * `checkout` here; poll `retrieveCheckout` until complete and confirm with
2062
+ * `grant`. The SDK stays Stripe-agnostic — `checkout` returns a mount kit
2063
+ * and the frontend brings `@stripe/stripe-js`.
2064
+ */
2065
+ access: {
2066
+ /**
2067
+ * Start an embedded checkout for one offer and return a connected-account
2068
+ * mount kit `{ sessionId, clientSecret, stripeAccountId, publishableKey,
2069
+ * offerType }`. `returnPath` is a safe relative path. Requires a candidate
2070
+ * profile.
2071
+ *
2072
+ * @example
2073
+ * const kit = await board.me.access.checkout({
2074
+ * offerKey: 'monthly',
2075
+ * returnPath: '/account/access',
2076
+ * colorMode: 'light',
2077
+ * });
2078
+ * const stripe = await loadStripe(kit.publishableKey, {
2079
+ * stripeAccount: kit.stripeAccountId,
2080
+ * });
2081
+ */
2082
+ checkout(body, options) {
2083
+ return client.fetch("/me/access/checkout", {
2084
+ ...options,
2085
+ method: "POST",
2086
+ body
2087
+ });
2088
+ },
2089
+ /**
2090
+ * Poll a checkout session's state: `open` (re-mountable via
2091
+ * `clientSecret`), `complete`, or `expired`. On `complete`, re-read
2092
+ * `grant()` to confirm entitlement.
2093
+ *
2094
+ * @example
2095
+ * const s = await board.me.access.retrieveCheckout(kit.sessionId);
2096
+ */
2097
+ retrieveCheckout(sessionId, options) {
2098
+ return client.fetch(
2099
+ `/me/access/checkout/${encodeURIComponent(sessionId)}`,
2100
+ options
2101
+ );
2102
+ },
2103
+ /**
2104
+ * The viewer's candidate-access entitlement — always resolves (no-access
2105
+ * is `{ hasAccess: false, … }`, not an error). Gate the ungated jobs
2106
+ * listing on `hasAccess`.
2107
+ *
2108
+ * @example
2109
+ * const { hasAccess } = await board.me.access.grant();
2110
+ */
2111
+ grant(options) {
2112
+ return client.fetch("/me/access/grant", options);
2113
+ },
2114
+ /**
2115
+ * Open a Stripe billing-portal session to manage a recurring subscription
2116
+ * (only when the grant's `offerType` is `recurring`). Optional
2117
+ * `returnPath` threads through to Stripe's return URL.
2118
+ *
2119
+ * @example
2120
+ * const { url } = await board.me.access.portal({ returnPath: '/account' });
2121
+ * location.href = url;
2122
+ */
2123
+ portal(body, options) {
2124
+ return client.fetch("/me/access/portal", {
2125
+ ...options,
2126
+ method: "POST",
2127
+ body
2128
+ });
2129
+ }
2057
2130
  }
2058
2131
  };
2059
2132
  }
@@ -2082,6 +2155,27 @@ function passwordNamespace(client) {
2082
2155
  };
2083
2156
  }
2084
2157
 
2158
+ // src/namespaces/paywall.ts
2159
+ function paywallNamespace(client) {
2160
+ return {
2161
+ /**
2162
+ * List the board's enabled candidate-access paywall offers (public) — the
2163
+ * pricing tiers a candidate picks before starting checkout
2164
+ * (`board.me.access.checkout`). Returns `[]` when the paywall is disabled.
2165
+ * The internal Stripe price id is never exposed.
2166
+ *
2167
+ * @example
2168
+ * const { data } = await board.paywall.offers();
2169
+ */
2170
+ offers(options) {
2171
+ return client.fetch(
2172
+ "/paywall/offers/enabled",
2173
+ options
2174
+ );
2175
+ }
2176
+ };
2177
+ }
2178
+
2085
2179
  // src/namespaces/plans.ts
2086
2180
  function plansNamespace(client) {
2087
2181
  return {
@@ -2358,6 +2452,7 @@ function createBoardClient(options) {
2358
2452
  jobPosting: jobPostingNamespace(client),
2359
2453
  salaries: salariesNamespace(client),
2360
2454
  talent: talentNamespace(client),
2361
- plans: plansNamespace(client)
2455
+ plans: plansNamespace(client),
2456
+ paywall: paywallNamespace(client)
2362
2457
  };
2363
2458
  }
package/dist/index.mjs CHANGED
@@ -109,7 +109,7 @@ async function clearSession(storage) {
109
109
  }
110
110
 
111
111
  // src/version.ts
112
- var SDK_VERSION = "1.23.0";
112
+ var SDK_VERSION = "1.25.0";
113
113
 
114
114
  // src/client.ts
115
115
  function isRawBody(body) {
@@ -2014,6 +2014,79 @@ function meNamespace(client) {
2014
2014
  { ...options, method: "POST", body }
2015
2015
  );
2016
2016
  }
2017
+ },
2018
+ /**
2019
+ * The candidate job-access paywall — the authenticated money flow (doc 36 /
2020
+ * ADR-0056). Enumerate offers publicly with `board.paywall.offers()`, then
2021
+ * `checkout` here; poll `retrieveCheckout` until complete and confirm with
2022
+ * `grant`. The SDK stays Stripe-agnostic — `checkout` returns a mount kit
2023
+ * and the frontend brings `@stripe/stripe-js`.
2024
+ */
2025
+ access: {
2026
+ /**
2027
+ * Start an embedded checkout for one offer and return a connected-account
2028
+ * mount kit `{ sessionId, clientSecret, stripeAccountId, publishableKey,
2029
+ * offerType }`. `returnPath` is a safe relative path. Requires a candidate
2030
+ * profile.
2031
+ *
2032
+ * @example
2033
+ * const kit = await board.me.access.checkout({
2034
+ * offerKey: 'monthly',
2035
+ * returnPath: '/account/access',
2036
+ * colorMode: 'light',
2037
+ * });
2038
+ * const stripe = await loadStripe(kit.publishableKey, {
2039
+ * stripeAccount: kit.stripeAccountId,
2040
+ * });
2041
+ */
2042
+ checkout(body, options) {
2043
+ return client.fetch("/me/access/checkout", {
2044
+ ...options,
2045
+ method: "POST",
2046
+ body
2047
+ });
2048
+ },
2049
+ /**
2050
+ * Poll a checkout session's state: `open` (re-mountable via
2051
+ * `clientSecret`), `complete`, or `expired`. On `complete`, re-read
2052
+ * `grant()` to confirm entitlement.
2053
+ *
2054
+ * @example
2055
+ * const s = await board.me.access.retrieveCheckout(kit.sessionId);
2056
+ */
2057
+ retrieveCheckout(sessionId, options) {
2058
+ return client.fetch(
2059
+ `/me/access/checkout/${encodeURIComponent(sessionId)}`,
2060
+ options
2061
+ );
2062
+ },
2063
+ /**
2064
+ * The viewer's candidate-access entitlement — always resolves (no-access
2065
+ * is `{ hasAccess: false, … }`, not an error). Gate the ungated jobs
2066
+ * listing on `hasAccess`.
2067
+ *
2068
+ * @example
2069
+ * const { hasAccess } = await board.me.access.grant();
2070
+ */
2071
+ grant(options) {
2072
+ return client.fetch("/me/access/grant", options);
2073
+ },
2074
+ /**
2075
+ * Open a Stripe billing-portal session to manage a recurring subscription
2076
+ * (only when the grant's `offerType` is `recurring`). Optional
2077
+ * `returnPath` threads through to Stripe's return URL.
2078
+ *
2079
+ * @example
2080
+ * const { url } = await board.me.access.portal({ returnPath: '/account' });
2081
+ * location.href = url;
2082
+ */
2083
+ portal(body, options) {
2084
+ return client.fetch("/me/access/portal", {
2085
+ ...options,
2086
+ method: "POST",
2087
+ body
2088
+ });
2089
+ }
2017
2090
  }
2018
2091
  };
2019
2092
  }
@@ -2042,6 +2115,27 @@ function passwordNamespace(client) {
2042
2115
  };
2043
2116
  }
2044
2117
 
2118
+ // src/namespaces/paywall.ts
2119
+ function paywallNamespace(client) {
2120
+ return {
2121
+ /**
2122
+ * List the board's enabled candidate-access paywall offers (public) — the
2123
+ * pricing tiers a candidate picks before starting checkout
2124
+ * (`board.me.access.checkout`). Returns `[]` when the paywall is disabled.
2125
+ * The internal Stripe price id is never exposed.
2126
+ *
2127
+ * @example
2128
+ * const { data } = await board.paywall.offers();
2129
+ */
2130
+ offers(options) {
2131
+ return client.fetch(
2132
+ "/paywall/offers/enabled",
2133
+ options
2134
+ );
2135
+ }
2136
+ };
2137
+ }
2138
+
2045
2139
  // src/namespaces/plans.ts
2046
2140
  function plansNamespace(client) {
2047
2141
  return {
@@ -2318,7 +2412,8 @@ function createBoardClient(options) {
2318
2412
  jobPosting: jobPostingNamespace(client),
2319
2413
  salaries: salariesNamespace(client),
2320
2414
  talent: talentNamespace(client),
2321
- plans: plansNamespace(client)
2415
+ plans: plansNamespace(client),
2416
+ paywall: paywallNamespace(client)
2322
2417
  };
2323
2418
  }
2324
2419
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cavuno/board",
3
- "version": "1.23.0",
3
+ "version": "1.25.0",
4
4
  "description": "Typed isomorphic client for the Cavuno Board API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.23.0",
2
+ "version": "1.25.0",
3
3
  "skills": [
4
4
  {
5
5
  "name": "cavuno-board-auth",