@businessdash/sdk 0.9.81 → 0.9.90
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 +115 -902
- package/assets/{biab-sw.js → bd-sw.js} +2 -2
- package/dist/account-core/index.d.ts +1 -1
- package/dist/account-core/index.d.ts.map +1 -1
- package/dist/adapters-revalidate.d.ts +2 -2
- package/dist/adapters-revalidate.js +2 -2
- package/dist/adapters-revalidate.js.map +1 -1
- package/dist/analytics-core.d.ts +6 -6
- package/dist/analytics-core.d.ts.map +1 -1
- package/dist/analytics-core.js +4 -4
- package/dist/analytics-core.js.map +1 -1
- package/dist/analytics-server.d.ts +6 -6
- package/dist/analytics-server.d.ts.map +1 -1
- package/dist/analytics-server.js +5 -5
- package/dist/auth-handler.d.ts +14 -14
- package/dist/auth-handler.d.ts.map +1 -1
- package/dist/auth-handler.js +16 -16
- package/dist/auth-handler.js.map +1 -1
- package/dist/auth-links.d.ts +2 -2
- package/dist/auth-links.d.ts.map +1 -1
- package/dist/auth-links.js +2 -2
- package/dist/auth-links.js.map +1 -1
- package/dist/{biab-forms.css → bd-forms.css} +158 -158
- package/dist/cli.d.ts +4 -4
- package/dist/cli.js +78 -78
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +158 -147
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +156 -137
- package/dist/client.js.map +1 -1
- package/dist/consent-core/index.cjs +2 -2
- package/dist/consent-core/index.d.ts +2 -2
- package/dist/consent-core/index.d.ts.map +1 -1
- package/dist/consent-core/index.js +10 -8
- package/dist/consent-core/index.js.map +1 -1
- package/dist/contracts.d.ts +411 -52
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +89 -15
- package/dist/contracts.js.map +1 -1
- package/dist/data-model-schema.d.ts +15 -15
- package/dist/data-model-schema.d.ts.map +1 -1
- package/dist/data-model-schema.js +19 -17
- package/dist/data-model-schema.js.map +1 -1
- package/dist/distribution.d.ts +5 -5
- package/dist/distribution.d.ts.map +1 -1
- package/dist/distribution.js +4 -4
- package/dist/element.d.ts +36 -36
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +43 -43
- package/dist/element.js.map +1 -1
- package/dist/embed-protocol.d.ts +11 -11
- package/dist/embed-protocol.d.ts.map +1 -1
- package/dist/embed-protocol.js +1 -1
- package/dist/embed-protocol.js.map +1 -1
- package/dist/errors.d.ts +15 -15
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +18 -18
- package/dist/errors.js.map +1 -1
- package/dist/forms-core/autocomplete.d.ts +3 -3
- package/dist/forms-core/autocomplete.d.ts.map +1 -1
- package/dist/forms-core/autocomplete.js +2 -2
- package/dist/forms-core/controller.d.ts +10 -10
- package/dist/forms-core/controller.d.ts.map +1 -1
- package/dist/forms-core/controller.js +4 -4
- package/dist/forms-core/controller.js.map +1 -1
- package/dist/forms-core/elements.d.ts +4 -4
- package/dist/forms-core/elements.d.ts.map +1 -1
- package/dist/forms-core/elements.js +7 -7
- package/dist/forms-core/elements.js.map +1 -1
- package/dist/forms-core/formula.d.ts +1 -1
- package/dist/forms-core/formula.js +1 -1
- package/dist/forms-core/index.d.ts +6 -6
- package/dist/forms-core/index.d.ts.map +1 -1
- package/dist/forms-core/index.js +5 -5
- package/dist/forms-core/index.js.map +1 -1
- package/dist/forms-core/units.d.ts +1 -1
- package/dist/forms-core/units.js +1 -1
- package/dist/forms-core/us-states.d.ts +1 -1
- package/dist/forms-core/us-states.js +1 -1
- package/dist/forms-core/validation.d.ts +12 -3
- package/dist/forms-core/validation.d.ts.map +1 -1
- package/dist/forms-core/validation.js +152 -17
- package/dist/forms-core/validation.js.map +1 -1
- package/dist/forms.d.ts +2 -2
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +2 -2
- package/dist/forms.js.map +1 -1
- package/dist/framework-support.js +1 -1
- package/dist/framework-support.js.map +1 -1
- package/dist/gallery-types.d.ts +1 -1
- package/dist/graphql.d.ts +3 -3
- package/dist/graphql.d.ts.map +1 -1
- package/dist/graphql.js +3 -3
- package/dist/graphql.js.map +1 -1
- package/dist/index.cjs +350 -273
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/legal-core/index.cjs +8 -8
- package/dist/legal-core/index.d.ts +3 -3
- package/dist/legal-core/index.d.ts.map +1 -1
- package/dist/legal-core/index.js +11 -11
- package/dist/legal-core/index.js.map +1 -1
- package/dist/marketing-core/index.d.ts +51 -1
- package/dist/marketing-core/index.d.ts.map +1 -1
- package/dist/marketing-core/index.js +35 -0
- package/dist/marketing-core/index.js.map +1 -1
- package/dist/marketing-schema.d.ts +9 -9
- package/dist/marketing-schema.d.ts.map +1 -1
- package/dist/marketing-schema.js +1 -1
- package/dist/mcp.d.ts +4 -4
- package/dist/mcp.js +4 -4
- package/dist/native.d.ts +6 -6
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +4 -4
- package/dist/native.js.map +1 -1
- package/dist/next-revalidate.d.ts +8 -8
- package/dist/next-revalidate.d.ts.map +1 -1
- package/dist/next-revalidate.js +7 -7
- package/dist/next-revalidate.js.map +1 -1
- package/dist/notifications-core/index.d.ts +1 -1
- package/dist/notifications-core/index.js +1 -1
- package/dist/parallel-pages.d.ts +4 -4
- package/dist/parallel-pages.d.ts.map +1 -1
- package/dist/parallel-pages.js +5 -5
- package/dist/parallel-pages.js.map +1 -1
- package/dist/portal-core/index.d.ts +1 -1
- package/dist/portal-core/index.js +1 -1
- package/dist/proxy.d.ts +18 -18
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +10 -10
- package/dist/proxy.js.map +1 -1
- package/dist/push-core/index.cjs +1 -1
- package/dist/push-core/index.d.ts +1 -1
- package/dist/push-core/index.js +1 -1
- package/dist/push-core/index.js.map +1 -1
- package/dist/react-analytics.d.ts +14 -14
- package/dist/react-analytics.d.ts.map +1 -1
- package/dist/react-analytics.js +15 -15
- package/dist/react-analytics.js.map +1 -1
- package/dist/react-attribution.d.ts +2 -2
- package/dist/react-attribution.d.ts.map +1 -1
- package/dist/react-attribution.js +1 -1
- package/dist/react-marketing.js +5 -5
- package/dist/react-marketing.js.map +1 -1
- package/dist/react.d.ts +38 -61
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +247 -261
- package/dist/react.js.map +1 -1
- package/dist/reserved-paths.d.ts +2 -2
- package/dist/reserved-paths.js +3 -3
- package/dist/reserved-paths.js.map +1 -1
- package/dist/revalidate-verify.d.ts +3 -3
- package/dist/revalidate-verify.d.ts.map +1 -1
- package/dist/revalidate-verify.js +1 -1
- package/dist/revalidate-verify.js.map +1 -1
- package/dist/sdk.d.ts +49 -49
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +47 -51
- package/dist/sdk.js.map +1 -1
- package/dist/seed-core/index.js +8 -8
- package/dist/seed-core/index.js.map +1 -1
- package/dist/seo-core/blog.d.ts +1 -1
- package/dist/seo-core/blog.js +1 -1
- package/dist/seo-core/blog.js.map +1 -1
- package/dist/seo-core/index.cjs +2 -2
- package/dist/seo-core/index.js +1 -1
- package/dist/seo-core/index.js.map +1 -1
- package/dist/seo.d.ts +1 -1
- package/dist/seo.d.ts.map +1 -1
- package/dist/seo.js +1 -1
- package/dist/seo.js.map +1 -1
- package/dist/sitemap-core/index.cjs +3 -3
- package/dist/sitemap-core/index.js +2 -2
- package/dist/sitemap-core/index.js.map +1 -1
- package/dist/socials.d.ts +6 -6
- package/dist/socials.d.ts.map +1 -1
- package/dist/socials.js +5 -5
- package/dist/socials.js.map +1 -1
- package/dist/solid-compat.d.ts +1 -1
- package/dist/solid-compat.js +4 -4
- package/dist/solid-compat.js.map +1 -1
- package/dist/store-core/index.d.ts +1 -1
- package/dist/vanilla.d.ts +12 -12
- package/dist/vanilla.d.ts.map +1 -1
- package/dist/vanilla.js +192 -145
- package/dist/vanilla.js.map +1 -1
- package/openapi.json +264 -1
- package/package.json +8 -8
- package/src/account-core/index.ts +1 -1
- package/src/adapters-revalidate.ts +3 -3
- package/src/analytics-core.ts +8 -8
- package/src/analytics-server.ts +6 -6
- package/src/angular/{biab-form.component.ts → bd-form.component.ts} +269 -161
- package/src/angular/headless.ts +12 -12
- package/src/angular/index.ts +9 -9
- package/src/auth-handler.ts +22 -22
- package/src/auth-links.ts +2 -2
- package/src/cli.ts +81 -81
- package/src/client.ts +218 -193
- package/src/consent-core/index.ts +10 -8
- package/src/contracts.ts +99 -15
- package/src/data-model-schema.ts +29 -26
- package/src/distribution.ts +5 -5
- package/src/element.ts +54 -54
- package/src/embed-protocol.ts +14 -14
- package/src/errors.ts +27 -27
- package/src/forms-core/autocomplete.ts +3 -3
- package/src/forms-core/controller.ts +12 -12
- package/src/forms-core/elements.ts +7 -7
- package/src/forms-core/formula.ts +1 -1
- package/src/forms-core/index.ts +8 -8
- package/src/forms-core/units.ts +1 -1
- package/src/forms-core/us-states.ts +1 -1
- package/src/forms-core/validation.ts +158 -14
- package/src/forms.ts +2 -2
- package/src/framework-support.ts +1 -1
- package/src/gallery-types.ts +1 -1
- package/src/graphql.ts +4 -4
- package/src/index.ts +38 -38
- package/src/legal-core/index.ts +12 -12
- package/src/marketing-core/index.ts +62 -0
- package/src/marketing-schema.ts +9 -9
- package/src/mcp.ts +4 -4
- package/src/native.ts +14 -14
- package/src/next-revalidate.ts +10 -10
- package/src/notifications-core/index.ts +1 -1
- package/src/parallel-pages.ts +6 -6
- package/src/portal-core/index.ts +1 -1
- package/src/proxy.ts +28 -28
- package/src/push-core/index.ts +2 -2
- package/src/qwik.tsx +262 -166
- package/src/react-analytics.tsx +17 -17
- package/src/react-attribution.tsx +2 -2
- package/src/react-marketing.tsx +5 -5
- package/src/react.tsx +541 -500
- package/src/reserved-paths.ts +3 -3
- package/src/revalidate-verify.ts +5 -5
- package/src/sdk.ts +106 -110
- package/src/seed-core/index.ts +8 -8
- package/src/seo-core/blog.ts +2 -2
- package/src/seo-core/index.ts +1 -1
- package/src/seo.ts +1 -1
- package/src/sitemap-core/index.ts +2 -2
- package/src/socials.ts +6 -6
- package/src/solid-compat.tsx +5 -5
- package/src/solid-surfaces.tsx +28 -28
- package/src/solid.tsx +264 -175
- package/src/store-core/index.ts +1 -1
- package/src/styles/{biab-forms.css → bd-forms.css} +158 -158
- package/src/svelte/{BiabForm.svelte → BdForm.svelte} +240 -173
- package/src/svelte/context.ts +16 -16
- package/src/svelte/headless.ts +10 -10
- package/src/svelte/index.ts +16 -16
- package/src/vanilla.ts +250 -169
- package/src/vue/{BiabForm.vue → BdForm.vue} +270 -157
- package/src/vue/headless.ts +11 -11
- package/src/vue/index.ts +26 -26
package/dist/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { addressDetailsResponseSchema, addressFormValuesSchema, addressSearchInputSchema, addressSearchResponseSchema, addressVerifyResponseSchema, aiVisibilityInputSchema, aiVisibilityResponseSchema, attributionHeartbeatInputSchema, attributionHeartbeatResponseSchema, attributionPolicySchema, authIntrospectResponseSchema, blogCategoryListResponseSchema, blogCommentListResponseSchema, blogCommentPostInputSchema, blogCommentPostResponseSchema, blogLikeResponseSchema, blogListPostsResponseSchema, blogPostBySlugResponseSchema, blogSessionInputSchema, blogSessionResponseSchema, blogTagListResponseSchema, cartAddItemInputSchema, cartCouponInputSchema, cartSessionResponseSchema, cartSnapshotSchema, cartUpdateItemInputSchema, chatbotAppendMessageInputSchema, chatbotAvailabilitySchema, chatbotChatInputSchema, chatbotChatResponseSchema, chatbotConfigSchema, chatbotConfigUpdateInputSchema, chatbotFormDefinitionSchema, chatbotFormSubmitInputSchema, chatbotFormSubmitResponseSchema, chatbotMessagesResponseSchema, chatbotPersistedSessionInputSchema, chatbotPersistedSessionResponseSchema, chatbotRequestHumanInputSchema, chatbotRequestHumanResponseSchema, chatbotSessionResponseSchema, chatbotUploadUrlResponseSchema, checkoutSessionInputSchema, checkoutSessionResponseSchema, checkoutStartInputSchema, checkoutStartResponseSchema, checkoutStatusResponseSchema, confirmVerificationInputSchema, confirmVerificationResponseSchema, couponCreateInputSchema, couponCreateResponseSchema, couponListResponseSchema, couponValidateInputSchema, couponValidateResponseSchema, createCollectionInputSchema, createCollectionResponseSchema, createEmailTemplateInputSchema, createEmailTemplateResponseSchema, createEmailTemplateVersionInputSchema, createEmailTemplateVersionResponseSchema, customerContactCompanyInputSchema, customerContactCompanyResponseSchema, customerContractDetailSchema, customerContractListResponseSchema, customerContractSignResponseSchema, customerDownloadsResponseSchema, customerInviteResendResponseSchema, customerInvoiceDetailSchema, customerInvoiceListResponseSchema, customerInvoicePayInputSchema, customerInvoicePayResponseSchema, customerInvoicePdfSchema, customerJobActivityResponseSchema, customerJobCommentPostInputSchema, customerJobCommentSchema, customerJobCommentsListResponseSchema, customerJobDetailSchema, customerJobEtaResponseSchema, customerNotificationPreferencesResponseSchema, customerNotificationPreferencesUpdateInputSchema, customerNotificationPreferencesUpdateResponseSchema, customerNotReceivedResultSchema, customerOrderDetailSchema, customerOrderListResponseSchema, customerPaymentHistoryResponseSchema, customerPortalContextResponseSchema, customerPortalMessageListResponseSchema, customerPortalMessageSchema, customerPortalMessagesMarkReadResponseSchema, customerPortalOtherOrgsResponseSchema, customerPortalProfileSchema, customerPortalQuizResultsResponseSchema, customerPortalUpdateProfileInputSchema, customerPortalUpdateProfileResponseSchema, customerProductReviewCreatedSchema, customerProductReviewListSchema, customerPushConfigSchema, customerQuoteActionResponseSchema, customerQuoteDetailSchema, customerQuoteListResponseSchema, customerReferralHistoryResponseSchema, customerReferralPayoutsResponseSchema, customerReferralStatsSchema, customerReturnRequestCreatedSchema, customerReturnRequestInputSchema, customerReturnRequestListResponseSchema, customerReviewListResponseSchema, customerReviewSubmitInputSchema, customerReviewSubmitResponseSchema, customerShipmentListResponseSchema, customerShipmentTrackingSchema, customerSubscriberContentResponseSchema, customerSubscriptionCancelResponseSchema, customerSubscriptionResponseSchema, customerWorkBundleSchema, dashboardSessionResponseSchema, executeActionInputSchema, executeActionResponseSchema, followerEditInputSchema, followerEditResponseSchema, followerJoinInputSchema, followerJoinResponseSchema, followerLeaveInputSchema, followerLeaveResponseSchema, followerMeInputSchema, followerMeResponseSchema, getCollectionResponseSchema, getEmailTemplateResponseSchema, getMarketingLocalesResponseSchema, getMarketingPageBundleResponseSchema, getPublishedMarketingSchemaResponseSchema, getSiteMarketingPageResponseSchema, jobCategoryListResponseSchema, jobPostingListResponseSchema, jobPostingSchema, legalDocumentSchema, legalListResponseSchema, listCollectionsResponseSchema, listDataModelRecordsInputSchema, listDataModelRecordsResponseSchema, listEmailTemplatesInputSchema, listEmailTemplatesResponseSchema, listRowsInputSchema, listRowsResponseSchema, listSiteMarketingPagesResponseSchema, notificationPreferencesResponseSchema, notificationPreferencesUpdateInputSchema, pageViewsInputSchema, pageViewsResponseSchema, publishMarketingSectionsInputSchema, publishMarketingSectionsResponseSchema, queryRowsInputSchema, queryRowsResponseSchema, reviewWallListResponseSchema, schedulingBookingResultSchema, schedulingBookingViewSchema, schedulingCancelResultSchema, schedulingEventTypeDetailSchema, schedulingEventTypeListSchema, schedulingRescheduleResultSchema, schedulingSlotsResponseSchema, shippingRatesInputSchema, shippingRatesResponseSchema, shippingSettingsResponseSchema, shippingTrackResponseSchema, siteAssetInputSchema, siteBrandingSchema, startVerificationInputSchema, startVerificationResponseSchema, storefrontAddonsResponseSchema, storefrontCategoriesResponseSchema, storefrontListProductsResponseSchema, storefrontProductDetailSchema, storefrontProductReviewsResponseSchema, storefrontProductsWithMetaResponseSchema, storefrontRelatedProductsResponseSchema, storefrontSessionInputSchema, storefrontSessionResponseSchema, storefrontSyncToStripeResponseSchema, subscriptionCheckoutInputSchema, subscriptionCheckoutResponseSchema, subscriptionOfferingSchema, subscriptionOfferingsListResponseSchema, tenantAuthExchangeInputSchema, tenantAuthExchangeResponseSchema, tenantAuthMeResponseSchema, tenantAuthPasswordResetInputSchema, tenantAuthPasswordResetResponseSchema, tenantAuthSignOutResponseSchema, tenantAuthStartInputSchema, tenantAuthStartResponseSchema, uploadSiteAssetResponseSchema, upsertDraftMarketingSchemaInputSchema, upsertDraftMarketingSchemaResponseSchema, upsertRowInputSchema, upsertRowResponseSchema, } from "./contracts.js";
|
|
3
|
-
import { accessRejectionFromBody,
|
|
2
|
+
import { addressDetailsResponseSchema, addressFormValuesSchema, addressSearchInputSchema, addressSearchResponseSchema, addressVerifyResponseSchema, aiVisibilityInputSchema, aiVisibilityResponseSchema, attributionHeartbeatInputSchema, attributionHeartbeatResponseSchema, attributionPolicySchema, authIntrospectResponseSchema, blogCategoryListResponseSchema, blogCommentListResponseSchema, blogCommentPostInputSchema, blogCommentPostResponseSchema, blogLikeResponseSchema, blogListPostsResponseSchema, blogPostBySlugResponseSchema, blogSessionInputSchema, blogSessionResponseSchema, blogTagListResponseSchema, cartAddItemInputSchema, cartCouponInputSchema, cartSessionResponseSchema, cartSnapshotSchema, cartUpdateItemInputSchema, chatbotAppendMessageInputSchema, chatbotAvailabilitySchema, chatbotChatInputSchema, chatbotChatResponseSchema, chatbotConfigSchema, chatbotConfigUpdateInputSchema, chatbotFormDefinitionSchema, chatbotFormSubmitInputSchema, chatbotFormSubmitResponseSchema, chatbotMessagesResponseSchema, chatbotPersistedSessionInputSchema, chatbotPersistedSessionResponseSchema, chatbotRequestHumanInputSchema, chatbotRequestHumanResponseSchema, chatbotSessionResponseSchema, chatbotUploadUrlResponseSchema, checkoutSessionInputSchema, checkoutSessionResponseSchema, checkoutStartInputSchema, checkoutStartResponseSchema, checkoutStatusResponseSchema, confirmVerificationInputSchema, confirmVerificationResponseSchema, couponCreateInputSchema, couponCreateResponseSchema, couponListResponseSchema, couponValidateInputSchema, couponValidateResponseSchema, createCollectionInputSchema, createCollectionResponseSchema, createEmailTemplateInputSchema, createEmailTemplateResponseSchema, createEmailTemplateVersionInputSchema, createEmailTemplateVersionResponseSchema, customerContactCompanyInputSchema, customerContactCompanyResponseSchema, customerContractDetailSchema, customerContractListResponseSchema, customerContractSignResponseSchema, customerDownloadsResponseSchema, customerInviteResendResponseSchema, customerInvoiceDetailSchema, customerInvoiceListResponseSchema, customerInvoicePayInputSchema, customerInvoicePayResponseSchema, customerInvoicePdfSchema, customerJobActivityResponseSchema, customerJobCommentPostInputSchema, customerJobCommentSchema, customerJobCommentsListResponseSchema, customerJobDetailSchema, customerJobEtaResponseSchema, customerNotificationPreferencesResponseSchema, customerNotificationPreferencesUpdateInputSchema, customerNotificationPreferencesUpdateResponseSchema, customerNotReceivedResultSchema, customerOrderDetailSchema, customerOrderListResponseSchema, customerPaymentHistoryResponseSchema, customerPortalContextResponseSchema, customerPortalMessageListResponseSchema, customerPortalMessageSchema, customerPortalMessagesMarkReadResponseSchema, customerPortalOtherOrgsResponseSchema, customerPortalProfileSchema, customerPortalQuizResultsResponseSchema, customerPortalUpdateProfileInputSchema, customerPortalUpdateProfileResponseSchema, customerProductReviewCreatedSchema, customerProductReviewListSchema, customerProposalListResponseSchema, customerProposalSchema, customerPushConfigSchema, customerQuoteActionResponseSchema, customerQuoteDetailSchema, customerQuoteListResponseSchema, customerReferralHistoryResponseSchema, customerReferralPayoutsResponseSchema, customerReferralStatsSchema, customerReturnRequestCreatedSchema, customerReturnRequestInputSchema, customerReturnRequestListResponseSchema, customerReviewListResponseSchema, customerReviewSubmitInputSchema, customerReviewSubmitResponseSchema, customerShipmentListResponseSchema, customerShipmentTrackingSchema, customerSubscriberContentResponseSchema, customerSubscriptionCancelResponseSchema, customerSubscriptionResponseSchema, customerWorkBundleSchema, dashboardSessionResponseSchema, executeActionInputSchema, executeActionResponseSchema, followerEditInputSchema, followerEditResponseSchema, followerJoinInputSchema, followerJoinResponseSchema, followerLeaveInputSchema, followerLeaveResponseSchema, followerMeInputSchema, followerMeResponseSchema, getCollectionResponseSchema, getEmailTemplateResponseSchema, getMarketingLocalesResponseSchema, getMarketingPageBundleResponseSchema, getPublishedMarketingSchemaResponseSchema, getSiteMarketingPageResponseSchema, jobCategoryListResponseSchema, jobPostingListResponseSchema, jobPostingSchema, legalDocumentSchema, legalListResponseSchema, listCollectionsResponseSchema, listDataModelRecordsInputSchema, listDataModelRecordsResponseSchema, listEmailTemplatesInputSchema, listEmailTemplatesResponseSchema, listRowsInputSchema, listRowsResponseSchema, listSiteMarketingPagesResponseSchema, notificationPreferencesResponseSchema, notificationPreferencesUpdateInputSchema, pageViewsInputSchema, pageViewsResponseSchema, publishMarketingSectionsInputSchema, publishMarketingSectionsResponseSchema, queryRowsInputSchema, queryRowsResponseSchema, reviewWallListResponseSchema, schedulingBookingResultSchema, schedulingBookingViewSchema, schedulingCancelResultSchema, schedulingEventTypeDetailSchema, schedulingEventTypeListSchema, schedulingRescheduleResultSchema, schedulingSlotsResponseSchema, shippingRatesInputSchema, shippingRatesResponseSchema, shippingSettingsResponseSchema, shippingTrackResponseSchema, siteAssetInputSchema, siteBrandingSchema, startVerificationInputSchema, startVerificationResponseSchema, storefrontAddonsResponseSchema, storefrontCategoriesResponseSchema, storefrontListProductsResponseSchema, storefrontProductDetailSchema, storefrontProductReviewsResponseSchema, storefrontProductsWithMetaResponseSchema, storefrontRelatedProductsResponseSchema, storefrontSessionInputSchema, storefrontSessionResponseSchema, storefrontSyncToStripeResponseSchema, subscriptionCheckoutInputSchema, subscriptionCheckoutResponseSchema, subscriptionOfferingSchema, subscriptionOfferingsListResponseSchema, tenantAuthExchangeInputSchema, tenantAuthExchangeResponseSchema, tenantAuthMeResponseSchema, tenantAuthPasswordResetInputSchema, tenantAuthPasswordResetResponseSchema, tenantAuthSignOutResponseSchema, tenantAuthStartInputSchema, tenantAuthStartResponseSchema, uploadSiteAssetResponseSchema, upsertDraftMarketingSchemaInputSchema, upsertDraftMarketingSchemaResponseSchema, upsertRowInputSchema, upsertRowResponseSchema, } from "./contracts.js";
|
|
3
|
+
import { accessRejectionFromBody, BdApiError, isBdPlanGateBody, } from "./errors.js";
|
|
4
4
|
function buildUrl(baseUrl, path, query) {
|
|
5
5
|
/**
|
|
6
6
|
* Strip any leading slash from `path` so it is treated as a relative path and
|
|
@@ -66,13 +66,13 @@ function extractErrorMessage(body, fallback) {
|
|
|
66
66
|
return fallback;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* Typed client for the
|
|
69
|
+
* Typed client for the BD package HTTP API.
|
|
70
70
|
*
|
|
71
71
|
* @remarks
|
|
72
72
|
* **Alpha:** This SDK is in alpha. Surfaces and behavior may change without semver guarantees.
|
|
73
73
|
* Do not rely on it for production workloads—use development, staging, or experiments only.
|
|
74
74
|
*/
|
|
75
|
-
export class
|
|
75
|
+
export class BdApiClient {
|
|
76
76
|
baseUrl;
|
|
77
77
|
apiKey;
|
|
78
78
|
fetchImpl;
|
|
@@ -96,47 +96,47 @@ export class BiabDevClient {
|
|
|
96
96
|
}
|
|
97
97
|
siteOrigin;
|
|
98
98
|
site(siteId) {
|
|
99
|
-
return new
|
|
99
|
+
return new BdSiteClient(this, siteId);
|
|
100
100
|
}
|
|
101
101
|
get emailTemplates() {
|
|
102
|
-
return new
|
|
102
|
+
return new BdEmailTemplatesClient(this);
|
|
103
103
|
}
|
|
104
104
|
get dashboard() {
|
|
105
|
-
return new
|
|
105
|
+
return new BdDashboardClient(this);
|
|
106
106
|
}
|
|
107
107
|
get storefront() {
|
|
108
|
-
return new
|
|
108
|
+
return new BdStorefrontClient(this);
|
|
109
109
|
}
|
|
110
110
|
get cart() {
|
|
111
|
-
return new
|
|
111
|
+
return new BdCartClient(this);
|
|
112
112
|
}
|
|
113
113
|
get checkout() {
|
|
114
|
-
return new
|
|
114
|
+
return new BdCheckoutClient(this);
|
|
115
115
|
}
|
|
116
116
|
get coupons() {
|
|
117
|
-
return new
|
|
117
|
+
return new BdCouponsClient(this);
|
|
118
118
|
}
|
|
119
119
|
get subscriptions() {
|
|
120
|
-
return new
|
|
120
|
+
return new BdSubscriptionsClient(this);
|
|
121
121
|
}
|
|
122
122
|
get shipping() {
|
|
123
|
-
return new
|
|
123
|
+
return new BdShippingClient(this);
|
|
124
124
|
}
|
|
125
125
|
/** Customer-portal invitations — currently resend. */
|
|
126
126
|
get customerInvites() {
|
|
127
|
-
return new
|
|
127
|
+
return new BdCustomerInvitesClient(this);
|
|
128
128
|
}
|
|
129
129
|
get notifications() {
|
|
130
|
-
return new
|
|
130
|
+
return new BdNotificationsClient(this);
|
|
131
131
|
}
|
|
132
132
|
get address() {
|
|
133
|
-
return new
|
|
133
|
+
return new BdAddressClient(this);
|
|
134
134
|
}
|
|
135
135
|
get blog() {
|
|
136
|
-
return new
|
|
136
|
+
return new BdBlogClient(this);
|
|
137
137
|
}
|
|
138
138
|
get reviews() {
|
|
139
|
-
return new
|
|
139
|
+
return new BdReviewsClient(this);
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
* Tracking consent for this org's site.
|
|
@@ -145,11 +145,11 @@ export class BiabDevClient {
|
|
|
145
145
|
* and gives you a gate to check before starting analytics.
|
|
146
146
|
*/
|
|
147
147
|
get consent() {
|
|
148
|
-
return new
|
|
148
|
+
return new BdConsentClient(this);
|
|
149
149
|
}
|
|
150
150
|
/** Public job postings — build a careers page on your own domain. */
|
|
151
151
|
get hiring() {
|
|
152
|
-
return new
|
|
152
|
+
return new BdHiringClient(this);
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* The org's published legal pages — privacy, terms, refund policy, whatever
|
|
@@ -159,23 +159,23 @@ export class BiabDevClient {
|
|
|
159
159
|
* per document.
|
|
160
160
|
*/
|
|
161
161
|
get legal() {
|
|
162
|
-
return new
|
|
162
|
+
return new BdLegalClient(this);
|
|
163
163
|
}
|
|
164
164
|
get chatbot() {
|
|
165
|
-
return new
|
|
165
|
+
return new BdChatbotClient(this);
|
|
166
166
|
}
|
|
167
167
|
get auth() {
|
|
168
|
-
return new
|
|
168
|
+
return new BdAuthClient(this);
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
|
-
* Customer-portal client. Pin to a specific
|
|
171
|
+
* Customer-portal client. Pin to a specific BD organization id so the
|
|
172
172
|
* caller never sees data from any other org (recommended). Omit
|
|
173
173
|
* `organizationId` to fall back to the user's currently-active session
|
|
174
174
|
* org — only use that on first-party hosts where the host already pins
|
|
175
175
|
* the org.
|
|
176
176
|
*/
|
|
177
177
|
customerPortal(organizationId) {
|
|
178
|
-
return new
|
|
178
|
+
return new BdCustomerPortalClient(this, organizationId ?? null);
|
|
179
179
|
}
|
|
180
180
|
async introspect() {
|
|
181
181
|
return this.request({
|
|
@@ -206,12 +206,12 @@ export class BiabDevClient {
|
|
|
206
206
|
const body = await parseResponseBody(response);
|
|
207
207
|
// Access gate — 200 (reads, body-only signal) and 402 (writes)
|
|
208
208
|
// both surface as a typed error so consumer code is uniform.
|
|
209
|
-
// Three flavours: plan-required (
|
|
210
|
-
// payment-required (
|
|
211
|
-
// (
|
|
209
|
+
// Three flavours: plan-required (BdFeatureNotEntitledError),
|
|
210
|
+
// payment-required (BdPaymentLapsedError), service-suspended
|
|
211
|
+
// (BdServiceSuspendedError) — all extend BdAccessRejectedError
|
|
212
212
|
// for "catch any" patterns. `unwrapAccess()` is the opt-in
|
|
213
213
|
// Result-shape escape hatch.
|
|
214
|
-
if (
|
|
214
|
+
if (isBdPlanGateBody(body)) {
|
|
215
215
|
throw accessRejectionFromBody({
|
|
216
216
|
body,
|
|
217
217
|
path: url.pathname,
|
|
@@ -219,17 +219,17 @@ export class BiabDevClient {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
if (!response.ok) {
|
|
222
|
-
throw new
|
|
222
|
+
throw new BdApiError({
|
|
223
223
|
status: response.status,
|
|
224
224
|
path: url.pathname,
|
|
225
|
-
message: extractErrorMessage(body, `
|
|
225
|
+
message: extractErrorMessage(body, `BD API request failed with status ${response.status}.`),
|
|
226
226
|
body,
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
return options.responseSchema.parse(body);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
export class
|
|
232
|
+
export class BdSiteClient {
|
|
233
233
|
client;
|
|
234
234
|
siteId;
|
|
235
235
|
collections;
|
|
@@ -237,18 +237,18 @@ export class BiabDevSiteClient {
|
|
|
237
237
|
/**
|
|
238
238
|
* The org's custom database — the tables from `defineDataModel()`.
|
|
239
239
|
* Distinct from `collections`/`rows`, which are Site Data. See
|
|
240
|
-
* {@link
|
|
240
|
+
* {@link BdDataModelClient}.
|
|
241
241
|
*/
|
|
242
242
|
dataModel;
|
|
243
243
|
/**
|
|
244
244
|
* Read your site's visitor counts back (the counterpart to the
|
|
245
|
-
* `<
|
|
246
|
-
* {@link
|
|
245
|
+
* `<BDAnalytics/>` tracker, which only records). See
|
|
246
|
+
* {@link BdAnalyticsClient}.
|
|
247
247
|
*/
|
|
248
248
|
analytics;
|
|
249
249
|
/**
|
|
250
250
|
* The "Powered by BusinessDash" badge's policy + heartbeat. See
|
|
251
|
-
* {@link
|
|
251
|
+
* {@link BdAttributionClient}.
|
|
252
252
|
*/
|
|
253
253
|
attribution;
|
|
254
254
|
assets;
|
|
@@ -257,7 +257,7 @@ export class BiabDevSiteClient {
|
|
|
257
257
|
marketingPages;
|
|
258
258
|
/**
|
|
259
259
|
* Schema-driven marketing flow (Phase 2). Pair with the SDK's
|
|
260
|
-
* `defineSiteMarketingSchema()` builder + the `
|
|
260
|
+
* `defineSiteMarketingSchema()` builder + the `bd sync-schema`
|
|
261
261
|
* CLI for the authoring side; this client is the live-site read
|
|
262
262
|
* path (`getPageBundle`) and the upload entry point for the CLI.
|
|
263
263
|
*/
|
|
@@ -274,18 +274,18 @@ export class BiabDevSiteClient {
|
|
|
274
274
|
constructor(client, siteId) {
|
|
275
275
|
this.client = client;
|
|
276
276
|
this.siteId = siteId;
|
|
277
|
-
this.collections = new
|
|
278
|
-
this.scheduling = new
|
|
279
|
-
this.rows = new
|
|
280
|
-
this.dataModel = new
|
|
281
|
-
this.analytics = new
|
|
282
|
-
this.attribution = new
|
|
283
|
-
this.assets = new
|
|
284
|
-
this.actions = new
|
|
285
|
-
this.followers = new
|
|
286
|
-
this.marketingPages = new
|
|
287
|
-
this.marketing = new
|
|
288
|
-
this.parallelPages = new
|
|
277
|
+
this.collections = new BdCollectionsClient(client, siteId);
|
|
278
|
+
this.scheduling = new BdSchedulingClient(client, siteId);
|
|
279
|
+
this.rows = new BdRowsClient(client, siteId);
|
|
280
|
+
this.dataModel = new BdDataModelClient(client, siteId);
|
|
281
|
+
this.analytics = new BdAnalyticsClient(client, siteId);
|
|
282
|
+
this.attribution = new BdAttributionClient(client, siteId);
|
|
283
|
+
this.assets = new BdAssetsClient(client, siteId);
|
|
284
|
+
this.actions = new BdActionsClient(client, siteId);
|
|
285
|
+
this.followers = new BdFollowersClient(client, siteId);
|
|
286
|
+
this.marketingPages = new BdMarketingPagesClient(client, siteId);
|
|
287
|
+
this.marketing = new BdMarketingClient(client, siteId);
|
|
288
|
+
this.parallelPages = new BdParallelPagesClient(client, siteId);
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
291
|
* The org's storefront branding — logo + favicon (site static media) plus
|
|
@@ -389,7 +389,7 @@ export const parallelPagesRenderResponseSchema = z.object({
|
|
|
389
389
|
* return <RenderTemplate bundle={bundle} />;
|
|
390
390
|
* }
|
|
391
391
|
*/
|
|
392
|
-
export class
|
|
392
|
+
export class BdParallelPagesClient {
|
|
393
393
|
client;
|
|
394
394
|
siteId;
|
|
395
395
|
constructor(client, siteId) {
|
|
@@ -477,7 +477,7 @@ export function clearMarketingCache(siteId) {
|
|
|
477
477
|
* checksum = `noop: true`).
|
|
478
478
|
* - `getLocales()` — enabled locales + brand-token map.
|
|
479
479
|
*/
|
|
480
|
-
export class
|
|
480
|
+
export class BdMarketingClient {
|
|
481
481
|
client;
|
|
482
482
|
siteId;
|
|
483
483
|
constructor(client, siteId) {
|
|
@@ -544,15 +544,15 @@ export class BiabDevMarketingClient {
|
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
/**
|
|
547
|
-
* Bulk-upsert section values. Used by `
|
|
548
|
-
* local JSON content to
|
|
547
|
+
* Bulk-upsert section values. Used by `bd sync-content` to push
|
|
548
|
+
* local JSON content to BD. Server caps each request at 256 items;
|
|
549
549
|
* larger imports are batched by the CLI. Per-item failures are
|
|
550
550
|
* reported in the response (`results[].ok === false`) without aborting
|
|
551
551
|
* the rest of the batch.
|
|
552
552
|
*
|
|
553
553
|
* The CLI's `--lax` flag sets `validate: false` for first-time imports
|
|
554
554
|
* of legacy content that doesn't yet match the published schema —
|
|
555
|
-
* useful so writers can pull existing content into
|
|
555
|
+
* useful so writers can pull existing content into BD and fix
|
|
556
556
|
* validation errors in the dashboard incrementally.
|
|
557
557
|
*/
|
|
558
558
|
async publishSections(input) {
|
|
@@ -580,7 +580,7 @@ export class BiabDevMarketingClient {
|
|
|
580
580
|
}
|
|
581
581
|
/**
|
|
582
582
|
* Process-wide cache for marketing-page payloads, keyed by `(siteId, pageKey)`.
|
|
583
|
-
* Shared across `
|
|
583
|
+
* Shared across `BdMarketingPagesClient` instances so that
|
|
584
584
|
* `prefetch(pageKey)` warms the same store `get(pageKey)` reads on demand.
|
|
585
585
|
*
|
|
586
586
|
* Lives on a module-level `Map` rather than instance state because consumers
|
|
@@ -620,7 +620,7 @@ export function clearMarketingPageCache(siteId, pageKey) {
|
|
|
620
620
|
* `list()` (no payloads) with `get(pageKey)` / `prefetch(pageKey)` to load
|
|
621
621
|
* pages on demand instead of paying the full-content cost up front.
|
|
622
622
|
*/
|
|
623
|
-
export class
|
|
623
|
+
export class BdMarketingPagesClient {
|
|
624
624
|
client;
|
|
625
625
|
siteId;
|
|
626
626
|
constructor(client, siteId) {
|
|
@@ -681,7 +681,7 @@ export class BiabDevMarketingPagesClient {
|
|
|
681
681
|
return this.get(pageKey);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
export class
|
|
684
|
+
export class BdCollectionsClient {
|
|
685
685
|
client;
|
|
686
686
|
siteId;
|
|
687
687
|
constructor(client, siteId) {
|
|
@@ -710,7 +710,7 @@ export class BiabDevCollectionsClient {
|
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
export class
|
|
713
|
+
export class BdRowsClient {
|
|
714
714
|
client;
|
|
715
715
|
siteId;
|
|
716
716
|
constructor(client, siteId) {
|
|
@@ -746,11 +746,11 @@ export class BiabDevRowsClient {
|
|
|
746
746
|
}
|
|
747
747
|
/**
|
|
748
748
|
* Read rows out of the org's CUSTOM DATABASE — the tables you declare with
|
|
749
|
-
* `defineDataModel()` and push with `
|
|
749
|
+
* `defineDataModel()` and push with `bd sync-data-model`.
|
|
750
750
|
*
|
|
751
751
|
* ⚠️ Not the same thing as `.collections` / `.rows`. Those read Site Data (the
|
|
752
752
|
* site builder's tables, `site_data_rows`). Rows seeded with
|
|
753
|
-
* `
|
|
753
|
+
* `bd sync-records` live in `org_object_records` and are reachable only
|
|
754
754
|
* through here — no `collections:*` call will ever return one.
|
|
755
755
|
*
|
|
756
756
|
* Requires the `metadata:read_records` scope. What a key can actually read is
|
|
@@ -766,7 +766,7 @@ export class BiabDevRowsClient {
|
|
|
766
766
|
* private one never is. Open a table by declaring `visibility` in your model.
|
|
767
767
|
*
|
|
768
768
|
* ```ts
|
|
769
|
-
* const result = await
|
|
769
|
+
* const result = await bd.site(siteId).dataModel.listRecords({
|
|
770
770
|
* object: TECH_OBJECT_ID, // the universalIdentifier from your config
|
|
771
771
|
* });
|
|
772
772
|
* if (!result.available) return <UpgradeCard feature={result.requiredFeature} />;
|
|
@@ -776,7 +776,7 @@ export class BiabDevRowsClient {
|
|
|
776
776
|
* }
|
|
777
777
|
* ```
|
|
778
778
|
*/
|
|
779
|
-
export class
|
|
779
|
+
export class BdDataModelClient {
|
|
780
780
|
client;
|
|
781
781
|
siteId;
|
|
782
782
|
constructor(client, siteId) {
|
|
@@ -828,20 +828,20 @@ export class BiabDevDataModelClient {
|
|
|
828
828
|
/**
|
|
829
829
|
* Read your site's visitor counts back.
|
|
830
830
|
*
|
|
831
|
-
* The `<
|
|
831
|
+
* The `<BDAnalytics/>` tracker (`@businessdash/sdk/react-analytics`) RECORDS
|
|
832
832
|
* pageviews; this READS the totals, so you can put a number on the page instead
|
|
833
833
|
* of only feeding the dashboard.
|
|
834
834
|
*
|
|
835
835
|
* ```ts
|
|
836
836
|
* // Site-wide, all time
|
|
837
|
-
* const all = await
|
|
837
|
+
* const all = await bd.site(siteId).analytics.pageViews();
|
|
838
838
|
* if (all.available) console.log(`${all.total.views} views`);
|
|
839
839
|
*
|
|
840
840
|
* // One page, last 30 days
|
|
841
|
-
* const home = await
|
|
841
|
+
* const home = await bd.site(siteId).analytics.pageViews({ paths: ['/'], days: 30 });
|
|
842
842
|
*
|
|
843
843
|
* // A batch of pages in one round-trip
|
|
844
|
-
* const list = await
|
|
844
|
+
* const list = await bd.site(siteId).analytics.pageViews({
|
|
845
845
|
* paths: ['/tech/typescript', '/tech/rust'],
|
|
846
846
|
* });
|
|
847
847
|
* // list.paths → [{ path, views, visitors }, …], every requested path present
|
|
@@ -851,7 +851,7 @@ export class BiabDevDataModelClient {
|
|
|
851
851
|
* Requires the `analytics.web` entitlement — an org without it gets
|
|
852
852
|
* `{ available: false }`, so branch on `.available`.
|
|
853
853
|
*/
|
|
854
|
-
export class
|
|
854
|
+
export class BdAnalyticsClient {
|
|
855
855
|
client;
|
|
856
856
|
siteId;
|
|
857
857
|
constructor(client, siteId) {
|
|
@@ -886,7 +886,7 @@ export class BiabDevAnalyticsClient {
|
|
|
886
886
|
* to a 30-day window.
|
|
887
887
|
*
|
|
888
888
|
* ```ts
|
|
889
|
-
* const ai = await
|
|
889
|
+
* const ai = await bd.site(siteId).analytics.aiVisibility({ days: 30 });
|
|
890
890
|
* if (ai.available) {
|
|
891
891
|
* for (const c of ai.crawlers)
|
|
892
892
|
* console.log(`${c.name}: ${c.fetches} fetches over ${c.distinctPages} pages`);
|
|
@@ -913,7 +913,7 @@ export class BiabDevAnalyticsClient {
|
|
|
913
913
|
* verifies the badge by fetching your live domain, not by trusting this call. So
|
|
914
914
|
* don't build logic on the heartbeat; do honor `policy().required`.
|
|
915
915
|
*/
|
|
916
|
-
export class
|
|
916
|
+
export class BdAttributionClient {
|
|
917
917
|
client;
|
|
918
918
|
siteId;
|
|
919
919
|
constructor(client, siteId) {
|
|
@@ -946,7 +946,7 @@ export class BiabDevAttributionClient {
|
|
|
946
946
|
});
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
export class
|
|
949
|
+
export class BdAssetsClient {
|
|
950
950
|
client;
|
|
951
951
|
siteId;
|
|
952
952
|
constructor(client, siteId) {
|
|
@@ -963,7 +963,7 @@ export class BiabDevAssetsClient {
|
|
|
963
963
|
});
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
|
-
export class
|
|
966
|
+
export class BdActionsClient {
|
|
967
967
|
client;
|
|
968
968
|
siteId;
|
|
969
969
|
constructor(client, siteId) {
|
|
@@ -980,7 +980,7 @@ export class BiabDevActionsClient {
|
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
export class
|
|
983
|
+
export class BdEmailTemplatesClient {
|
|
984
984
|
client;
|
|
985
985
|
constructor(client) {
|
|
986
986
|
this.client = client;
|
|
@@ -1018,7 +1018,7 @@ export class BiabDevEmailTemplatesClient {
|
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
export class
|
|
1021
|
+
export class BdFollowersClient {
|
|
1022
1022
|
client;
|
|
1023
1023
|
siteId;
|
|
1024
1024
|
constructor(client, siteId) {
|
|
@@ -1073,7 +1073,7 @@ export class BiabDevFollowersClient {
|
|
|
1073
1073
|
return followerLeaveResponseSchema.parse(response.result);
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
1076
|
-
export class
|
|
1076
|
+
export class BdDashboardClient {
|
|
1077
1077
|
client;
|
|
1078
1078
|
constructor(client) {
|
|
1079
1079
|
this.client = client;
|
|
@@ -1086,7 +1086,7 @@ export class BiabDevDashboardClient {
|
|
|
1086
1086
|
});
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
|
-
export class
|
|
1089
|
+
export class BdStorefrontClient {
|
|
1090
1090
|
client;
|
|
1091
1091
|
constructor(client) {
|
|
1092
1092
|
this.client = client;
|
|
@@ -1094,7 +1094,7 @@ export class BiabDevStorefrontClient {
|
|
|
1094
1094
|
/**
|
|
1095
1095
|
* Legacy embed-session mint (kept for iframe-widget consumers).
|
|
1096
1096
|
* The programmatic methods below let consumer sites render their
|
|
1097
|
-
* own native product catalog using
|
|
1097
|
+
* own native product catalog using BD as the data layer.
|
|
1098
1098
|
*/
|
|
1099
1099
|
async createSession(input) {
|
|
1100
1100
|
const body = storefrontSessionInputSchema.parse(input ?? undefined);
|
|
@@ -1125,7 +1125,7 @@ export class BiabDevStorefrontClient {
|
|
|
1125
1125
|
* ```ts
|
|
1126
1126
|
* let remaining = 1;
|
|
1127
1127
|
* while (remaining > 0) {
|
|
1128
|
-
* const res = await
|
|
1128
|
+
* const res = await bd.storefront.syncToStripe();
|
|
1129
1129
|
* remaining = res.remaining;
|
|
1130
1130
|
* }
|
|
1131
1131
|
* ```
|
|
@@ -1201,7 +1201,7 @@ export class BiabDevStorefrontClient {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
/**
|
|
1203
1203
|
* Full product detail with variants + per-image rows. Returns 404
|
|
1204
|
-
* via `
|
|
1204
|
+
* via `BdApiError` if the product isn't live or doesn't belong
|
|
1205
1205
|
* to the org bound to the API key.
|
|
1206
1206
|
*/
|
|
1207
1207
|
/**
|
|
@@ -1216,7 +1216,7 @@ export class BiabDevStorefrontClient {
|
|
|
1216
1216
|
* The platform withholds the raw URL from every product payload on purpose:
|
|
1217
1217
|
* CAD files are the largest thing it serves and are the org's intellectual
|
|
1218
1218
|
* property, so a catalog of naked URLs is a design library published to
|
|
1219
|
-
* anyone willing to write a loop. This endpoint requires a `
|
|
1219
|
+
* anyone willing to write a loop. This endpoint requires a `bd_cad` cookie
|
|
1220
1220
|
* on the incoming request, rate-limits per IP, and re-checks the
|
|
1221
1221
|
* `ecommerce.product_3d` entitlement before answering.
|
|
1222
1222
|
*
|
|
@@ -1275,7 +1275,7 @@ export class BiabDevStorefrontClient {
|
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
|
-
export class
|
|
1278
|
+
export class BdCartClient {
|
|
1279
1279
|
client;
|
|
1280
1280
|
visitorToken;
|
|
1281
1281
|
sessionToken;
|
|
@@ -1290,7 +1290,7 @@ export class BiabDevCartClient {
|
|
|
1290
1290
|
* sign-in required.
|
|
1291
1291
|
*/
|
|
1292
1292
|
forVisitor(visitorToken) {
|
|
1293
|
-
return new
|
|
1293
|
+
return new BdCartClient(this.client, visitorToken, null);
|
|
1294
1294
|
}
|
|
1295
1295
|
/**
|
|
1296
1296
|
* Use a tenantAuth session token instead of a visitor token.
|
|
@@ -1298,14 +1298,14 @@ export class BiabDevCartClient {
|
|
|
1298
1298
|
* across devices.
|
|
1299
1299
|
*/
|
|
1300
1300
|
withSession(sessionToken) {
|
|
1301
|
-
return new
|
|
1301
|
+
return new BdCartClient(this.client, null, sessionToken);
|
|
1302
1302
|
}
|
|
1303
1303
|
headers() {
|
|
1304
1304
|
const out = {};
|
|
1305
1305
|
if (this.visitorToken)
|
|
1306
|
-
out["X-
|
|
1306
|
+
out["X-BD-Cart-Visitor"] = this.visitorToken;
|
|
1307
1307
|
if (this.sessionToken)
|
|
1308
|
-
out["X-
|
|
1308
|
+
out["X-BD-Session-Token"] = this.sessionToken;
|
|
1309
1309
|
return out;
|
|
1310
1310
|
}
|
|
1311
1311
|
/**
|
|
@@ -1404,7 +1404,7 @@ export class BiabDevCartClient {
|
|
|
1404
1404
|
});
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
|
-
export class
|
|
1407
|
+
export class BdCheckoutClient {
|
|
1408
1408
|
client;
|
|
1409
1409
|
visitorToken;
|
|
1410
1410
|
sessionToken;
|
|
@@ -1418,7 +1418,7 @@ export class BiabDevCheckoutClient {
|
|
|
1418
1418
|
* (visitor-token cart). Same UUID you used with `client.cart.forVisitor(...)`.
|
|
1419
1419
|
*/
|
|
1420
1420
|
forVisitor(visitorToken) {
|
|
1421
|
-
return new
|
|
1421
|
+
return new BdCheckoutClient(this.client, visitorToken, null);
|
|
1422
1422
|
}
|
|
1423
1423
|
/**
|
|
1424
1424
|
* Authenticate as a signed-in customer (tenantAuth session token).
|
|
@@ -1426,14 +1426,14 @@ export class BiabDevCheckoutClient {
|
|
|
1426
1426
|
* customer's saved cart.
|
|
1427
1427
|
*/
|
|
1428
1428
|
withSession(sessionToken) {
|
|
1429
|
-
return new
|
|
1429
|
+
return new BdCheckoutClient(this.client, null, sessionToken);
|
|
1430
1430
|
}
|
|
1431
1431
|
headers() {
|
|
1432
1432
|
const out = {};
|
|
1433
1433
|
if (this.visitorToken)
|
|
1434
|
-
out["X-
|
|
1434
|
+
out["X-BD-Cart-Visitor"] = this.visitorToken;
|
|
1435
1435
|
if (this.sessionToken)
|
|
1436
|
-
out["X-
|
|
1436
|
+
out["X-BD-Session-Token"] = this.sessionToken;
|
|
1437
1437
|
return out;
|
|
1438
1438
|
}
|
|
1439
1439
|
/**
|
|
@@ -1451,7 +1451,7 @@ export class BiabDevCheckoutClient {
|
|
|
1451
1451
|
});
|
|
1452
1452
|
}
|
|
1453
1453
|
/**
|
|
1454
|
-
* Convert the caller's saved
|
|
1454
|
+
* Convert the caller's saved BD cart (resolved via visitor token
|
|
1455
1455
|
* or session token) into a Stripe Checkout Session. Returns the
|
|
1456
1456
|
* Stripe-hosted URL; redirect the browser there to collect payment.
|
|
1457
1457
|
*
|
|
@@ -1483,7 +1483,7 @@ export class BiabDevCheckoutClient {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
/**
|
|
1486
|
-
* White-glove Google Places proxy.
|
|
1486
|
+
* White-glove Google Places proxy. BD owns the API key — consumer
|
|
1487
1487
|
* code never sees it. Use at the checkout delivery-address input
|
|
1488
1488
|
* to give shoppers text-search predictions + verify deliverability
|
|
1489
1489
|
* before submitting the order.
|
|
@@ -1508,7 +1508,7 @@ export class BiabDevCheckoutClient {
|
|
|
1508
1508
|
* // When user picks a prediction:
|
|
1509
1509
|
* const detail = await client.address.getDetails(prediction.place_id);
|
|
1510
1510
|
* if (detail.enabled && detail.address) {
|
|
1511
|
-
* const form =
|
|
1511
|
+
* const form = BdAddressClient.googleToFormValues(detail.address);
|
|
1512
1512
|
* reactHookForm.reset(form);
|
|
1513
1513
|
* }
|
|
1514
1514
|
*
|
|
@@ -1517,7 +1517,7 @@ export class BiabDevCheckoutClient {
|
|
|
1517
1517
|
* if (!v.isVerified) showDidYouMean(v.googleAddress);
|
|
1518
1518
|
* ```
|
|
1519
1519
|
*/
|
|
1520
|
-
export class
|
|
1520
|
+
export class BdAddressClient {
|
|
1521
1521
|
client;
|
|
1522
1522
|
constructor(client) {
|
|
1523
1523
|
this.client = client;
|
|
@@ -1579,7 +1579,7 @@ export class BiabDevAddressClient {
|
|
|
1579
1579
|
* dashboard's "Sync to Stripe" action — otherwise `startCheckout`
|
|
1580
1580
|
* returns 409 `subscription_not_synced`.
|
|
1581
1581
|
*/
|
|
1582
|
-
export class
|
|
1582
|
+
export class BdSubscriptionsClient {
|
|
1583
1583
|
client;
|
|
1584
1584
|
constructor(client) {
|
|
1585
1585
|
this.client = client;
|
|
@@ -1606,7 +1606,7 @@ export class BiabDevSubscriptionsClient {
|
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
1609
|
-
export class
|
|
1609
|
+
export class BdCouponsClient {
|
|
1610
1610
|
client;
|
|
1611
1611
|
constructor(client) {
|
|
1612
1612
|
this.client = client;
|
|
@@ -1642,7 +1642,7 @@ export class BiabDevCouponsClient {
|
|
|
1642
1642
|
* Requires a SECRET key holding `storefront:write`.
|
|
1643
1643
|
*
|
|
1644
1644
|
* ```ts
|
|
1645
|
-
* const { coupon, stripeSynced } = await
|
|
1645
|
+
* const { coupon, stripeSynced } = await bd.coupons.create({
|
|
1646
1646
|
* code: 'WELCOME10',
|
|
1647
1647
|
* discountType: 'percent',
|
|
1648
1648
|
* value: 10,
|
|
@@ -1681,10 +1681,10 @@ export class BiabDevCouponsClient {
|
|
|
1681
1681
|
}
|
|
1682
1682
|
/**
|
|
1683
1683
|
* Shipping: rate lookups + on-demand tracking. White-glove model —
|
|
1684
|
-
*
|
|
1684
|
+
* BD owns the carrier integration; consumer code never sees the
|
|
1685
1685
|
* underlying provider name. Gated on `ecommerce.shipping` so calls
|
|
1686
1686
|
* from orgs on the Launch plan return the standard plan-gate body
|
|
1687
|
-
* via {@link
|
|
1687
|
+
* via {@link BdApiError} (status 403).
|
|
1688
1688
|
*
|
|
1689
1689
|
* @example
|
|
1690
1690
|
* ```ts
|
|
@@ -1701,7 +1701,7 @@ export class BiabDevCouponsClient {
|
|
|
1701
1701
|
* }
|
|
1702
1702
|
* ```
|
|
1703
1703
|
*/
|
|
1704
|
-
export class
|
|
1704
|
+
export class BdShippingClient {
|
|
1705
1705
|
client;
|
|
1706
1706
|
visitorToken;
|
|
1707
1707
|
sessionToken;
|
|
@@ -1711,17 +1711,17 @@ export class BiabDevShippingClient {
|
|
|
1711
1711
|
this.sessionToken = sessionToken;
|
|
1712
1712
|
}
|
|
1713
1713
|
forVisitor(visitorToken) {
|
|
1714
|
-
return new
|
|
1714
|
+
return new BdShippingClient(this.client, visitorToken, null);
|
|
1715
1715
|
}
|
|
1716
1716
|
withSession(sessionToken) {
|
|
1717
|
-
return new
|
|
1717
|
+
return new BdShippingClient(this.client, null, sessionToken);
|
|
1718
1718
|
}
|
|
1719
1719
|
headers() {
|
|
1720
1720
|
const out = {};
|
|
1721
1721
|
if (this.visitorToken)
|
|
1722
|
-
out["X-
|
|
1722
|
+
out["X-BD-Cart-Visitor"] = this.visitorToken;
|
|
1723
1723
|
if (this.sessionToken)
|
|
1724
|
-
out["X-
|
|
1724
|
+
out["X-BD-Session-Token"] = this.sessionToken;
|
|
1725
1725
|
return out;
|
|
1726
1726
|
}
|
|
1727
1727
|
/**
|
|
@@ -1786,11 +1786,11 @@ export class BiabDevShippingClient {
|
|
|
1786
1786
|
* - `order.return_label_created`
|
|
1787
1787
|
*
|
|
1788
1788
|
* The webhook payload is JSON + signed with the customer's saved
|
|
1789
|
-
* `webhookSigningSecret` via `X-
|
|
1789
|
+
* `webhookSigningSecret` via `X-BD-Signature: <hex hmac-sha256>`.
|
|
1790
1790
|
* Consumer's receiver verifies via:
|
|
1791
1791
|
* crypto.createHmac('sha256', secret).update(rawBody).digest('hex')
|
|
1792
1792
|
*/
|
|
1793
|
-
export class
|
|
1793
|
+
export class BdNotificationsClient {
|
|
1794
1794
|
client;
|
|
1795
1795
|
sessionToken;
|
|
1796
1796
|
constructor(client, sessionToken = null) {
|
|
@@ -1798,12 +1798,10 @@ export class BiabDevNotificationsClient {
|
|
|
1798
1798
|
this.sessionToken = sessionToken;
|
|
1799
1799
|
}
|
|
1800
1800
|
withSession(sessionToken) {
|
|
1801
|
-
return new
|
|
1801
|
+
return new BdNotificationsClient(this.client, sessionToken);
|
|
1802
1802
|
}
|
|
1803
1803
|
headers() {
|
|
1804
|
-
return this.sessionToken
|
|
1805
|
-
? { "X-BIAB-Session-Token": this.sessionToken }
|
|
1806
|
-
: {};
|
|
1804
|
+
return this.sessionToken ? { "X-BD-Session-Token": this.sessionToken } : {};
|
|
1807
1805
|
}
|
|
1808
1806
|
async getPreferences() {
|
|
1809
1807
|
return this.client.request({
|
|
@@ -1856,7 +1854,7 @@ export class BiabDevNotificationsClient {
|
|
|
1856
1854
|
});
|
|
1857
1855
|
}
|
|
1858
1856
|
}
|
|
1859
|
-
export class
|
|
1857
|
+
export class BdBlogClient {
|
|
1860
1858
|
client;
|
|
1861
1859
|
sessionToken;
|
|
1862
1860
|
constructor(client, sessionToken = null) {
|
|
@@ -1875,12 +1873,10 @@ export class BiabDevBlogClient {
|
|
|
1875
1873
|
* ```
|
|
1876
1874
|
*/
|
|
1877
1875
|
withSession(sessionToken) {
|
|
1878
|
-
return new
|
|
1876
|
+
return new BdBlogClient(this.client, sessionToken);
|
|
1879
1877
|
}
|
|
1880
1878
|
headers() {
|
|
1881
|
-
return this.sessionToken
|
|
1882
|
-
? { "X-BIAB-Session-Token": this.sessionToken }
|
|
1883
|
-
: {};
|
|
1879
|
+
return this.sessionToken ? { "X-BD-Session-Token": this.sessionToken } : {};
|
|
1884
1880
|
}
|
|
1885
1881
|
/**
|
|
1886
1882
|
* Legacy embed-session mint (kept for backwards compat with
|
|
@@ -2010,7 +2006,7 @@ export class BiabDevBlogClient {
|
|
|
2010
2006
|
* }
|
|
2011
2007
|
* ```
|
|
2012
2008
|
*/
|
|
2013
|
-
export class
|
|
2009
|
+
export class BdReviewsClient {
|
|
2014
2010
|
client;
|
|
2015
2011
|
constructor(client) {
|
|
2016
2012
|
this.client = client;
|
|
@@ -2053,7 +2049,7 @@ export class BiabDevReviewsClient {
|
|
|
2053
2049
|
* }
|
|
2054
2050
|
* ```
|
|
2055
2051
|
*/
|
|
2056
|
-
export class
|
|
2052
|
+
export class BdHiringClient {
|
|
2057
2053
|
client;
|
|
2058
2054
|
constructor(client) {
|
|
2059
2055
|
this.client = client;
|
|
@@ -2117,7 +2113,7 @@ export class BiabDevHiringClient {
|
|
|
2117
2113
|
* const privacy = await client.legal.get("privacy");
|
|
2118
2114
|
* ```
|
|
2119
2115
|
*/
|
|
2120
|
-
export class
|
|
2116
|
+
export class BdLegalClient {
|
|
2121
2117
|
client;
|
|
2122
2118
|
constructor(client) {
|
|
2123
2119
|
this.client = client;
|
|
@@ -2166,11 +2162,11 @@ const consentStateSchema = z.object({
|
|
|
2166
2162
|
* that could read or write another org's consent — consent is given to a
|
|
2167
2163
|
* controller, and one controller's record is not another's to act on.
|
|
2168
2164
|
*
|
|
2169
|
-
* The visitor is identified by an `x-
|
|
2165
|
+
* The visitor is identified by an `x-bd-visitor` header carrying an opaque id
|
|
2170
2166
|
* from the caller's own first-party cookie. `@businessdash/sdk/consent` manages
|
|
2171
2167
|
* that for you; these methods are the transport underneath it.
|
|
2172
2168
|
*/
|
|
2173
|
-
export class
|
|
2169
|
+
export class BdConsentClient {
|
|
2174
2170
|
client;
|
|
2175
2171
|
constructor(client) {
|
|
2176
2172
|
this.client = client;
|
|
@@ -2180,7 +2176,7 @@ export class BiabDevConsentClient {
|
|
|
2180
2176
|
return this.client.request({
|
|
2181
2177
|
path: "consent",
|
|
2182
2178
|
responseSchema: consentStateSchema,
|
|
2183
|
-
...(visitorKey ? { headers: { "x-
|
|
2179
|
+
...(visitorKey ? { headers: { "x-bd-visitor": visitorKey } } : {}),
|
|
2184
2180
|
});
|
|
2185
2181
|
}
|
|
2186
2182
|
/**
|
|
@@ -2198,12 +2194,12 @@ export class BiabDevConsentClient {
|
|
|
2198
2194
|
noticeVersion: input.noticeVersion,
|
|
2199
2195
|
source: input.source ?? "banner",
|
|
2200
2196
|
},
|
|
2201
|
-
headers: { "x-
|
|
2197
|
+
headers: { "x-bd-visitor": input.visitorKey },
|
|
2202
2198
|
responseSchema: z.object({ ok: z.boolean() }),
|
|
2203
2199
|
});
|
|
2204
2200
|
}
|
|
2205
2201
|
}
|
|
2206
|
-
export class
|
|
2202
|
+
export class BdChatbotClient {
|
|
2207
2203
|
client;
|
|
2208
2204
|
constructor(client) {
|
|
2209
2205
|
this.client = client;
|
|
@@ -2443,7 +2439,7 @@ export class BiabDevChatbotClient {
|
|
|
2443
2439
|
*
|
|
2444
2440
|
* @remarks
|
|
2445
2441
|
* **Privacy:** When `organizationId` is set, every request is pinned to that
|
|
2446
|
-
* org via the `X-
|
|
2442
|
+
* org via the `X-BD-Customer-Portal-Org` header. The server-side
|
|
2447
2443
|
* `customerPortalProcedure` will reject any access to a different org, so a
|
|
2448
2444
|
* customer browsing a Dominoes-branded site can never accidentally see Pizza
|
|
2449
2445
|
* Hut data even if their account is linked to both. This is the recommended
|
|
@@ -2461,14 +2457,14 @@ function decodeBase64ToBytes(base64) {
|
|
|
2461
2457
|
}
|
|
2462
2458
|
return bytes;
|
|
2463
2459
|
}
|
|
2464
|
-
export class
|
|
2460
|
+
export class BdCustomerPortalClient {
|
|
2465
2461
|
client;
|
|
2466
2462
|
organizationId;
|
|
2467
2463
|
sessionToken;
|
|
2468
2464
|
constructor(client, organizationId,
|
|
2469
2465
|
/**
|
|
2470
2466
|
* Optional tenantAuth session token. When set, requests include
|
|
2471
|
-
* an `X-
|
|
2467
|
+
* an `X-BD-Session-Token` header and the BD customer-portal
|
|
2472
2468
|
* routes resolve the calling user via the session payload
|
|
2473
2469
|
* instead of the API key's user binding.
|
|
2474
2470
|
*
|
|
@@ -2500,15 +2496,15 @@ export class BiabDevCustomerPortalClient {
|
|
|
2500
2496
|
* ```
|
|
2501
2497
|
*/
|
|
2502
2498
|
withSession(sessionToken) {
|
|
2503
|
-
return new
|
|
2499
|
+
return new BdCustomerPortalClient(this.client, this.organizationId, sessionToken);
|
|
2504
2500
|
}
|
|
2505
2501
|
headers() {
|
|
2506
2502
|
const out = {};
|
|
2507
2503
|
if (this.organizationId) {
|
|
2508
|
-
out["X-
|
|
2504
|
+
out["X-BD-Customer-Portal-Org"] = this.organizationId;
|
|
2509
2505
|
}
|
|
2510
2506
|
if (this.sessionToken) {
|
|
2511
|
-
out["X-
|
|
2507
|
+
out["X-BD-Session-Token"] = this.sessionToken;
|
|
2512
2508
|
}
|
|
2513
2509
|
return out;
|
|
2514
2510
|
}
|
|
@@ -2638,6 +2634,29 @@ export class BiabDevCustomerPortalClient {
|
|
|
2638
2634
|
headers: this.headers(),
|
|
2639
2635
|
});
|
|
2640
2636
|
}
|
|
2637
|
+
/**
|
|
2638
|
+
* Designed proposals the customer has been sent.
|
|
2639
|
+
*
|
|
2640
|
+
* Separate from `listQuotes` because a proposal is the document built
|
|
2641
|
+
* around a quote, not the quote: `kind` decides whether a consumer offers
|
|
2642
|
+
* a download or frames a page, and a UI that guessed would get one of the
|
|
2643
|
+
* two wrong every time.
|
|
2644
|
+
*/
|
|
2645
|
+
async listProposals() {
|
|
2646
|
+
return this.client.request({
|
|
2647
|
+
path: "customer-portal/proposals",
|
|
2648
|
+
responseSchema: customerProposalListResponseSchema,
|
|
2649
|
+
headers: this.headers(),
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2652
|
+
/** One proposal the customer owns. */
|
|
2653
|
+
async getProposal(proposalId) {
|
|
2654
|
+
return this.client.request({
|
|
2655
|
+
path: `customer-portal/proposals/${encodeURIComponent(proposalId)}`,
|
|
2656
|
+
responseSchema: customerProposalSchema,
|
|
2657
|
+
headers: this.headers(),
|
|
2658
|
+
});
|
|
2659
|
+
}
|
|
2641
2660
|
/** Read a single quote the signed-in customer owns. */
|
|
2642
2661
|
async getQuote(quoteId) {
|
|
2643
2662
|
return this.client.request({
|
|
@@ -2745,7 +2764,7 @@ export class BiabDevCustomerPortalClient {
|
|
|
2745
2764
|
/**
|
|
2746
2765
|
* Begin signing a contract the customer owns. Returns a ready, absolute
|
|
2747
2766
|
* signing URL on the org's branded hostname — redirect the customer there
|
|
2748
|
-
* to
|
|
2767
|
+
* to BD's hosted e-sign page, which captures the signature and generates
|
|
2749
2768
|
* the executed PDF. No signature payload is collected client-side, so the
|
|
2750
2769
|
* legal record stays consistent across consumers.
|
|
2751
2770
|
*
|
|
@@ -3269,7 +3288,7 @@ export class BiabDevCustomerPortalClient {
|
|
|
3269
3288
|
/**
|
|
3270
3289
|
* List the digital downloads the customer is entitled to for a paid order
|
|
3271
3290
|
* (P10d). Each item is a ready-to-use URL — a short-lived presigned link for
|
|
3272
|
-
*
|
|
3291
|
+
* BD-hosted files (`expiresInSeconds` set) or the org's external link.
|
|
3273
3292
|
* Returns an empty list until the order's payment settles.
|
|
3274
3293
|
*
|
|
3275
3294
|
* @example
|
|
@@ -3415,21 +3434,21 @@ export class BiabDevCustomerPortalClient {
|
|
|
3415
3434
|
}
|
|
3416
3435
|
}
|
|
3417
3436
|
/**
|
|
3418
|
-
* Creates a {@link
|
|
3437
|
+
* Creates a {@link BdApiClient} for the given host `baseUrl` and package API key.
|
|
3419
3438
|
*
|
|
3420
3439
|
* @remarks
|
|
3421
3440
|
* **Alpha:** This package is still in alpha release. APIs may change; it is **not** intended
|
|
3422
3441
|
* for production use yet. Prefer non-production environments until a stable major is published.
|
|
3423
3442
|
*/
|
|
3424
|
-
export function
|
|
3425
|
-
return new
|
|
3443
|
+
export function createBdApiClient(options) {
|
|
3444
|
+
return new BdApiClient(options);
|
|
3426
3445
|
}
|
|
3427
3446
|
/**
|
|
3428
3447
|
* Per-tenant auth: hosted sign-in/sign-up scoped to the org bound to
|
|
3429
3448
|
* the API key. Used by the SDK's `createAuthHandler` (server) and
|
|
3430
3449
|
* `<SignIn />` / `<SignUp />` / `<SignOut />` components (client).
|
|
3431
3450
|
*/
|
|
3432
|
-
export class
|
|
3451
|
+
export class BdAuthClient {
|
|
3433
3452
|
client;
|
|
3434
3453
|
constructor(client) {
|
|
3435
3454
|
this.client = client;
|
|
@@ -3479,7 +3498,7 @@ export class BiabDevAuthClient {
|
|
|
3479
3498
|
return this.client.request({
|
|
3480
3499
|
method: "GET",
|
|
3481
3500
|
path: "auth/me",
|
|
3482
|
-
headers: { "x-
|
|
3501
|
+
headers: { "x-bd-session": input.sessionToken },
|
|
3483
3502
|
responseSchema: tenantAuthMeResponseSchema,
|
|
3484
3503
|
});
|
|
3485
3504
|
}
|
|
@@ -3539,7 +3558,7 @@ export class BiabDevAuthClient {
|
|
|
3539
3558
|
*
|
|
3540
3559
|
* For an org running its own admin tooling rather than the dashboard.
|
|
3541
3560
|
*/
|
|
3542
|
-
export class
|
|
3561
|
+
export class BdCustomerInvitesClient {
|
|
3543
3562
|
client;
|
|
3544
3563
|
constructor(client) {
|
|
3545
3564
|
this.client = client;
|
|
@@ -3575,7 +3594,7 @@ export class BiabDevCustomerInvitesClient {
|
|
|
3575
3594
|
});
|
|
3576
3595
|
}
|
|
3577
3596
|
}
|
|
3578
|
-
export class
|
|
3597
|
+
export class BdSchedulingClient {
|
|
3579
3598
|
client;
|
|
3580
3599
|
siteId;
|
|
3581
3600
|
constructor(client, siteId) {
|