@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/index.cjs
CHANGED
|
@@ -1094,35 +1094,35 @@ var require_jsbi_cjs = __commonJS({
|
|
|
1094
1094
|
// src/index.ts
|
|
1095
1095
|
var index_exports = {};
|
|
1096
1096
|
__export(index_exports, {
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1097
|
+
BdAccessRejectedError: () => BdAccessRejectedError,
|
|
1098
|
+
BdActionsClient: () => BdActionsClient,
|
|
1099
|
+
BdAnalyticsClient: () => BdAnalyticsClient,
|
|
1100
|
+
BdApiClient: () => BdApiClient,
|
|
1101
|
+
BdApiError: () => BdApiError,
|
|
1102
|
+
BdAssetsClient: () => BdAssetsClient,
|
|
1103
|
+
BdAttributionClient: () => BdAttributionClient,
|
|
1104
|
+
BdAuthClient: () => BdAuthClient,
|
|
1105
|
+
BdBlogClient: () => BdBlogClient,
|
|
1106
|
+
BdCartClient: () => BdCartClient,
|
|
1107
|
+
BdChatbotClient: () => BdChatbotClient,
|
|
1108
|
+
BdCheckoutClient: () => BdCheckoutClient,
|
|
1109
|
+
BdCollectionsClient: () => BdCollectionsClient,
|
|
1110
|
+
BdCustomerPortalClient: () => BdCustomerPortalClient,
|
|
1111
|
+
BdDashboardClient: () => BdDashboardClient,
|
|
1112
|
+
BdDataModelClient: () => BdDataModelClient,
|
|
1113
|
+
BdEmailTemplatesClient: () => BdEmailTemplatesClient,
|
|
1114
|
+
BdFeatureNotEntitledError: () => BdFeatureNotEntitledError,
|
|
1115
|
+
BdFollowersClient: () => BdFollowersClient,
|
|
1116
|
+
BdHiringClient: () => BdHiringClient,
|
|
1117
|
+
BdMarketingClient: () => BdMarketingClient,
|
|
1118
|
+
BdMarketingPagesClient: () => BdMarketingPagesClient,
|
|
1119
|
+
BdParallelPagesClient: () => BdParallelPagesClient,
|
|
1120
|
+
BdPaymentLapsedError: () => BdPaymentLapsedError,
|
|
1121
|
+
BdReviewsClient: () => BdReviewsClient,
|
|
1122
|
+
BdRowsClient: () => BdRowsClient,
|
|
1123
|
+
BdServiceSuspendedError: () => BdServiceSuspendedError,
|
|
1124
|
+
BdSiteClient: () => BdSiteClient,
|
|
1125
|
+
BdStorefrontClient: () => BdStorefrontClient,
|
|
1126
1126
|
DEFAULT_AUTH_BASE_PATH: () => DEFAULT_AUTH_BASE_PATH,
|
|
1127
1127
|
DEFAULT_AUTH_COOKIE_NAME: () => DEFAULT_AUTH_COOKIE_NAME,
|
|
1128
1128
|
Enums: () => Enums,
|
|
@@ -1140,7 +1140,7 @@ __export(index_exports, {
|
|
|
1140
1140
|
article: () => article,
|
|
1141
1141
|
authIntrospectResponseSchema: () => authIntrospectResponseSchema,
|
|
1142
1142
|
bd: () => bd,
|
|
1143
|
-
|
|
1143
|
+
bdSchemas: () => bdSchemas,
|
|
1144
1144
|
blogSessionInputSchema: () => blogSessionInputSchema,
|
|
1145
1145
|
blogSessionResponseSchema: () => blogSessionResponseSchema,
|
|
1146
1146
|
breadcrumb: () => breadcrumb,
|
|
@@ -1175,8 +1175,8 @@ __export(index_exports, {
|
|
|
1175
1175
|
computeDataModelChecksum: () => computeDataModelChecksum,
|
|
1176
1176
|
computeSiteMarketingSchemaChecksum: () => computeSiteMarketingSchemaChecksum,
|
|
1177
1177
|
createAuthHandler: () => createAuthHandler,
|
|
1178
|
-
|
|
1179
|
-
|
|
1178
|
+
createBdApiClient: () => createBdApiClient,
|
|
1179
|
+
createBdClient: () => createBdClient,
|
|
1180
1180
|
createBrowserCustomerPortalClient: () => createBrowserCustomerPortalClient,
|
|
1181
1181
|
createCollectionInputSchema: () => createCollectionInputSchema,
|
|
1182
1182
|
createCollectionResponseSchema: () => createCollectionResponseSchema,
|
|
@@ -1233,7 +1233,7 @@ __export(index_exports, {
|
|
|
1233
1233
|
getPublishedMarketingSchemaResponseSchema: () => getPublishedMarketingSchemaResponseSchema,
|
|
1234
1234
|
getSiteMarketingPageResponseSchema: () => getSiteMarketingPageResponseSchema,
|
|
1235
1235
|
getTenantSession: () => getTenantSession,
|
|
1236
|
-
|
|
1236
|
+
isBdPlanGateBody: () => isBdPlanGateBody,
|
|
1237
1237
|
isFieldType: () => isFieldType,
|
|
1238
1238
|
isFormFileValue: () => isFormFileValue,
|
|
1239
1239
|
isParallelPageDefinition: () => isParallelPageDefinition,
|
|
@@ -9962,7 +9962,7 @@ var createEmailTemplateVersionResponseSchema = external_exports.object({
|
|
|
9962
9962
|
var customerPortalOrgSchema = external_exports.object({
|
|
9963
9963
|
id: external_exports.string().uuid(),
|
|
9964
9964
|
name: external_exports.string().nullable(),
|
|
9965
|
-
/** @deprecated Internal auth-provider org id — use `id` (the
|
|
9965
|
+
/** @deprecated Internal auth-provider org id — use `id` (the BD org id).
|
|
9966
9966
|
* Kept for backwards compatibility; will be removed in a future release. */
|
|
9967
9967
|
workosOrganizationId: external_exports.string().nullable().optional()
|
|
9968
9968
|
});
|
|
@@ -10016,7 +10016,7 @@ var customerPortalUpdateProfileResponseSchema = external_exports.object({
|
|
|
10016
10016
|
var customerPortalOtherOrgSchema = external_exports.object({
|
|
10017
10017
|
orgId: external_exports.string().uuid(),
|
|
10018
10018
|
name: external_exports.string().nullable(),
|
|
10019
|
-
/** @deprecated Internal auth-provider org id — use `orgId` (the
|
|
10019
|
+
/** @deprecated Internal auth-provider org id — use `orgId` (the BD org id).
|
|
10020
10020
|
* Kept for backwards compatibility; will be removed in a future release. */
|
|
10021
10021
|
workosOrganizationId: external_exports.string().nullable().optional()
|
|
10022
10022
|
});
|
|
@@ -10083,7 +10083,11 @@ var customerQuoteSummarySchema = external_exports.object({
|
|
|
10083
10083
|
),
|
|
10084
10084
|
totalAmount: external_exports.number(),
|
|
10085
10085
|
validUntil: external_exports.string(),
|
|
10086
|
-
publicAcceptUrl: external_exports.string().nullable()
|
|
10086
|
+
publicAcceptUrl: external_exports.string().nullable(),
|
|
10087
|
+
/** True when the quote carries a narrative — a PROPOSAL rather than a
|
|
10088
|
+
* bare price. Optional so an older server that does not send it still
|
|
10089
|
+
* parses; treat a missing value as false. */
|
|
10090
|
+
isProposal: external_exports.boolean().optional()
|
|
10087
10091
|
});
|
|
10088
10092
|
var customerInvoiceSummarySchema = external_exports.object({
|
|
10089
10093
|
id: external_exports.string(),
|
|
@@ -10142,6 +10146,37 @@ var customerWorkBundleSchema = external_exports.object({
|
|
|
10142
10146
|
})
|
|
10143
10147
|
}).passthrough();
|
|
10144
10148
|
var customerJobDetailSchema = customerJobSummarySchema.passthrough();
|
|
10149
|
+
var customerQuoteLineItemSchema = external_exports.object({
|
|
10150
|
+
description: external_exports.string(),
|
|
10151
|
+
quantity: external_exports.number(),
|
|
10152
|
+
unitPrice: external_exports.number(),
|
|
10153
|
+
total: external_exports.number(),
|
|
10154
|
+
manufacturer: external_exports.string().optional(),
|
|
10155
|
+
modelNo: external_exports.string().optional(),
|
|
10156
|
+
type: external_exports.string().optional(),
|
|
10157
|
+
category: external_exports.string().optional()
|
|
10158
|
+
}).passthrough();
|
|
10159
|
+
var customerQuoteSectionSchema = external_exports.object({
|
|
10160
|
+
id: external_exports.string(),
|
|
10161
|
+
title: external_exports.string(),
|
|
10162
|
+
body: external_exports.string()
|
|
10163
|
+
});
|
|
10164
|
+
var customerProposalSchema = external_exports.object({
|
|
10165
|
+
id: external_exports.string(),
|
|
10166
|
+
quoteId: external_exports.string(),
|
|
10167
|
+
/** `pdf` — fetch `pdfUrl`. `web` — frame `pageUrl`. */
|
|
10168
|
+
kind: openEnum("pdf", "web"),
|
|
10169
|
+
title: external_exports.string(),
|
|
10170
|
+
/** Host-less path, like every other URL in this contract, so a storefront
|
|
10171
|
+
* on any domain can resolve it against its own origin. */
|
|
10172
|
+
pdfUrl: external_exports.string().nullable().default(null),
|
|
10173
|
+
pageUrl: external_exports.string().nullable().default(null),
|
|
10174
|
+
createdAt: external_exports.string(),
|
|
10175
|
+
renderedAt: external_exports.string().nullable().default(null)
|
|
10176
|
+
});
|
|
10177
|
+
var customerProposalListResponseSchema = external_exports.object({
|
|
10178
|
+
items: external_exports.array(customerProposalSchema)
|
|
10179
|
+
});
|
|
10145
10180
|
var customerQuoteDetailSchema = external_exports.object({
|
|
10146
10181
|
id: external_exports.string(),
|
|
10147
10182
|
quoteNumber: external_exports.string(),
|
|
@@ -10154,7 +10189,7 @@ var customerQuoteDetailSchema = external_exports.object({
|
|
|
10154
10189
|
"converted",
|
|
10155
10190
|
"expired"
|
|
10156
10191
|
),
|
|
10157
|
-
items: external_exports.array(
|
|
10192
|
+
items: external_exports.array(customerQuoteLineItemSchema),
|
|
10158
10193
|
subtotalAmount: external_exports.number(),
|
|
10159
10194
|
discountAmount: external_exports.number(),
|
|
10160
10195
|
taxRate: external_exports.number(),
|
|
@@ -10162,7 +10197,28 @@ var customerQuoteDetailSchema = external_exports.object({
|
|
|
10162
10197
|
totalAmount: external_exports.number(),
|
|
10163
10198
|
validUntil: external_exports.string(),
|
|
10164
10199
|
publicAcceptUrl: external_exports.string().nullable(),
|
|
10165
|
-
notes: external_exports.string().nullable()
|
|
10200
|
+
notes: external_exports.string().nullable(),
|
|
10201
|
+
/**
|
|
10202
|
+
* The proposal narrative — cover letter, scope of work, terms. Empty
|
|
10203
|
+
* for a plain quote. This is the half that makes a quote a sales
|
|
10204
|
+
* proposal; rendering only `items` gives the customer a price list
|
|
10205
|
+
* where they were sent an argument.
|
|
10206
|
+
*/
|
|
10207
|
+
sections: external_exports.array(customerQuoteSectionSchema).default([]),
|
|
10208
|
+
/** Derived from `sections`, so it can never disagree with them. */
|
|
10209
|
+
isProposal: external_exports.boolean().default(false),
|
|
10210
|
+
/** Captured at send-time, so a proposal stays reproducible after the
|
|
10211
|
+
* org's billing details change. */
|
|
10212
|
+
senderName: external_exports.string().nullable().default(null),
|
|
10213
|
+
senderEmail: external_exports.string().nullable().default(null),
|
|
10214
|
+
sentAt: external_exports.string().nullable().default(null),
|
|
10215
|
+
acceptedAt: external_exports.string().nullable().default(null),
|
|
10216
|
+
rejectedAt: external_exports.string().nullable().default(null),
|
|
10217
|
+
/** Whether `acceptQuote` would succeed right now: sent, in date, not
|
|
10218
|
+
* already decided. Do not re-derive this from `status` — expiry is a
|
|
10219
|
+
* date comparison the server has already made. */
|
|
10220
|
+
canAccept: external_exports.boolean().default(false),
|
|
10221
|
+
expired: external_exports.boolean().default(false)
|
|
10166
10222
|
}).passthrough();
|
|
10167
10223
|
var customerPaymentHistoryEntrySchema = external_exports.object({
|
|
10168
10224
|
id: external_exports.string(),
|
|
@@ -10230,7 +10286,7 @@ var customerInvoiceDetailSchema = external_exports.object({
|
|
|
10230
10286
|
notes: external_exports.string().nullable(),
|
|
10231
10287
|
terms: external_exports.string().nullable(),
|
|
10232
10288
|
publicPayUrl: external_exports.string().nullable(),
|
|
10233
|
-
// Optional so the SDK stays compatible with older
|
|
10289
|
+
// Optional so the SDK stays compatible with older BD deployments
|
|
10234
10290
|
// that don't return these yet.
|
|
10235
10291
|
/** Recorded payments/refunds, oldest first. */
|
|
10236
10292
|
payments: external_exports.array(customerInvoicePaymentSchema).optional(),
|
|
@@ -10437,7 +10493,7 @@ var customerOrderDetailSchema = external_exports.object({
|
|
|
10437
10493
|
createdAt: external_exports.string(),
|
|
10438
10494
|
items: external_exports.array(customerOrderItemSchema),
|
|
10439
10495
|
shipments: external_exports.array(customerShipmentSchema),
|
|
10440
|
-
// Optional for back-compat with older
|
|
10496
|
+
// Optional for back-compat with older BD deployments.
|
|
10441
10497
|
returnRequests: external_exports.array(customerReturnRequestSchema).optional()
|
|
10442
10498
|
});
|
|
10443
10499
|
var customerReturnRequestInputSchema = external_exports.object({
|
|
@@ -10725,7 +10781,7 @@ var customerProductReviewCreatedSchema = external_exports.object({
|
|
|
10725
10781
|
var customerDownloadSchema = external_exports.object({
|
|
10726
10782
|
productName: external_exports.string(),
|
|
10727
10783
|
fileName: external_exports.string().nullable(),
|
|
10728
|
-
/** Short-lived presigned URL (
|
|
10784
|
+
/** Short-lived presigned URL (BD-hosted) or the org's external link. */
|
|
10729
10785
|
url: external_exports.string(),
|
|
10730
10786
|
/** Seconds until `url` expires; null for a non-expiring external link. */
|
|
10731
10787
|
expiresInSeconds: external_exports.number().nullable()
|
|
@@ -12028,7 +12084,7 @@ var jobPostingSchema = external_exports.object({
|
|
|
12028
12084
|
salaryMax: external_exports.number().nullable(),
|
|
12029
12085
|
currency: external_exports.string().nullable(),
|
|
12030
12086
|
/**
|
|
12031
|
-
* Pass to `client.forms.schema()` / `<
|
|
12087
|
+
* Pass to `client.forms.schema()` / `<BdForm/>` to render the application
|
|
12032
12088
|
* form. `null` means the posting is listed but not yet accepting applications.
|
|
12033
12089
|
*/
|
|
12034
12090
|
applicationFormId: external_exports.string().nullable(),
|
|
@@ -12047,19 +12103,19 @@ var jobCategoryListResponseSchema = external_exports.object({
|
|
|
12047
12103
|
});
|
|
12048
12104
|
|
|
12049
12105
|
// src/errors.ts
|
|
12050
|
-
var
|
|
12106
|
+
var BdApiError = class extends Error {
|
|
12051
12107
|
status;
|
|
12052
12108
|
body;
|
|
12053
12109
|
path;
|
|
12054
12110
|
constructor(input) {
|
|
12055
12111
|
super(input.message);
|
|
12056
|
-
this.name = "
|
|
12112
|
+
this.name = "BdApiError";
|
|
12057
12113
|
this.status = input.status;
|
|
12058
12114
|
this.body = input.body;
|
|
12059
12115
|
this.path = input.path;
|
|
12060
12116
|
}
|
|
12061
12117
|
};
|
|
12062
|
-
function
|
|
12118
|
+
function isBdPlanGateBody(value) {
|
|
12063
12119
|
if (!value || typeof value !== "object") return false;
|
|
12064
12120
|
const v2 = value;
|
|
12065
12121
|
if (v2["available"] !== false) return false;
|
|
@@ -12068,7 +12124,7 @@ function isBiabPlanGateBody(value) {
|
|
|
12068
12124
|
}
|
|
12069
12125
|
return typeof v2["upgradeUrl"] === "string" && typeof v2["message"] === "string";
|
|
12070
12126
|
}
|
|
12071
|
-
var
|
|
12127
|
+
var BdAccessRejectedError = class extends Error {
|
|
12072
12128
|
reason;
|
|
12073
12129
|
upgradeUrl;
|
|
12074
12130
|
featureMessage;
|
|
@@ -12076,7 +12132,7 @@ var BiabAccessRejectedError = class extends Error {
|
|
|
12076
12132
|
status;
|
|
12077
12133
|
constructor(input) {
|
|
12078
12134
|
super(input.body.message);
|
|
12079
|
-
this.name = "
|
|
12135
|
+
this.name = "BdAccessRejectedError";
|
|
12080
12136
|
this.reason = input.body.reason;
|
|
12081
12137
|
this.upgradeUrl = input.body.upgradeUrl;
|
|
12082
12138
|
this.featureMessage = input.body.message;
|
|
@@ -12084,52 +12140,52 @@ var BiabAccessRejectedError = class extends Error {
|
|
|
12084
12140
|
this.status = input.status;
|
|
12085
12141
|
}
|
|
12086
12142
|
};
|
|
12087
|
-
var
|
|
12143
|
+
var BdFeatureNotEntitledError = class extends BdAccessRejectedError {
|
|
12088
12144
|
feature;
|
|
12089
12145
|
requiredPlan;
|
|
12090
12146
|
planDisplayName;
|
|
12091
12147
|
constructor(input) {
|
|
12092
12148
|
super(input);
|
|
12093
|
-
this.name = "
|
|
12149
|
+
this.name = "BdFeatureNotEntitledError";
|
|
12094
12150
|
this.feature = input.body.requiredFeature;
|
|
12095
12151
|
this.requiredPlan = input.body.requiredPlan;
|
|
12096
12152
|
this.planDisplayName = input.body.planDisplayName;
|
|
12097
12153
|
}
|
|
12098
12154
|
};
|
|
12099
|
-
var
|
|
12155
|
+
var BdPaymentLapsedError = class extends BdAccessRejectedError {
|
|
12100
12156
|
daysLapsed;
|
|
12101
12157
|
daysUntilSuspension;
|
|
12102
12158
|
constructor(input) {
|
|
12103
12159
|
super(input);
|
|
12104
|
-
this.name = "
|
|
12160
|
+
this.name = "BdPaymentLapsedError";
|
|
12105
12161
|
this.daysLapsed = input.body.daysLapsed;
|
|
12106
12162
|
this.daysUntilSuspension = input.body.daysUntilSuspension;
|
|
12107
12163
|
}
|
|
12108
12164
|
};
|
|
12109
|
-
var
|
|
12165
|
+
var BdServiceSuspendedError = class extends BdAccessRejectedError {
|
|
12110
12166
|
daysLapsed;
|
|
12111
12167
|
constructor(input) {
|
|
12112
12168
|
super(input);
|
|
12113
|
-
this.name = "
|
|
12169
|
+
this.name = "BdServiceSuspendedError";
|
|
12114
12170
|
this.daysLapsed = input.body.daysLapsed;
|
|
12115
12171
|
}
|
|
12116
12172
|
};
|
|
12117
12173
|
function accessRejectionFromBody(input) {
|
|
12118
12174
|
switch (input.body.reason) {
|
|
12119
12175
|
case "plan_required":
|
|
12120
|
-
return new
|
|
12176
|
+
return new BdFeatureNotEntitledError({
|
|
12121
12177
|
body: input.body,
|
|
12122
12178
|
path: input.path,
|
|
12123
12179
|
status: input.status
|
|
12124
12180
|
});
|
|
12125
12181
|
case "payment_required":
|
|
12126
|
-
return new
|
|
12182
|
+
return new BdPaymentLapsedError({
|
|
12127
12183
|
body: input.body,
|
|
12128
12184
|
path: input.path,
|
|
12129
12185
|
status: input.status
|
|
12130
12186
|
});
|
|
12131
12187
|
case "service_suspended":
|
|
12132
|
-
return new
|
|
12188
|
+
return new BdServiceSuspendedError({
|
|
12133
12189
|
body: input.body,
|
|
12134
12190
|
path: input.path,
|
|
12135
12191
|
status: input.status
|
|
@@ -12141,7 +12197,7 @@ async function unwrapAccess(fn2) {
|
|
|
12141
12197
|
const data = await fn2();
|
|
12142
12198
|
return { data, rejected: null };
|
|
12143
12199
|
} catch (err) {
|
|
12144
|
-
if (err instanceof
|
|
12200
|
+
if (err instanceof BdFeatureNotEntitledError) {
|
|
12145
12201
|
return {
|
|
12146
12202
|
data: null,
|
|
12147
12203
|
rejected: {
|
|
@@ -12154,7 +12210,7 @@ async function unwrapAccess(fn2) {
|
|
|
12154
12210
|
}
|
|
12155
12211
|
};
|
|
12156
12212
|
}
|
|
12157
|
-
if (err instanceof
|
|
12213
|
+
if (err instanceof BdPaymentLapsedError) {
|
|
12158
12214
|
return {
|
|
12159
12215
|
data: null,
|
|
12160
12216
|
rejected: {
|
|
@@ -12166,7 +12222,7 @@ async function unwrapAccess(fn2) {
|
|
|
12166
12222
|
}
|
|
12167
12223
|
};
|
|
12168
12224
|
}
|
|
12169
|
-
if (err instanceof
|
|
12225
|
+
if (err instanceof BdServiceSuspendedError) {
|
|
12170
12226
|
return {
|
|
12171
12227
|
data: null,
|
|
12172
12228
|
rejected: {
|
|
@@ -12185,7 +12241,7 @@ async function unwrapEntitlement(fn2) {
|
|
|
12185
12241
|
const data = await fn2();
|
|
12186
12242
|
return { data, notEntitled: null };
|
|
12187
12243
|
} catch (err) {
|
|
12188
|
-
if (err instanceof
|
|
12244
|
+
if (err instanceof BdFeatureNotEntitledError) {
|
|
12189
12245
|
return {
|
|
12190
12246
|
data: null,
|
|
12191
12247
|
notEntitled: {
|
|
@@ -12245,7 +12301,7 @@ function extractErrorMessage(body, fallback) {
|
|
|
12245
12301
|
}
|
|
12246
12302
|
return fallback;
|
|
12247
12303
|
}
|
|
12248
|
-
var
|
|
12304
|
+
var BdApiClient = class {
|
|
12249
12305
|
baseUrl;
|
|
12250
12306
|
apiKey;
|
|
12251
12307
|
fetchImpl;
|
|
@@ -12259,47 +12315,47 @@ var BiabDevClient = class {
|
|
|
12259
12315
|
}
|
|
12260
12316
|
siteOrigin;
|
|
12261
12317
|
site(siteId) {
|
|
12262
|
-
return new
|
|
12318
|
+
return new BdSiteClient(this, siteId);
|
|
12263
12319
|
}
|
|
12264
12320
|
get emailTemplates() {
|
|
12265
|
-
return new
|
|
12321
|
+
return new BdEmailTemplatesClient(this);
|
|
12266
12322
|
}
|
|
12267
12323
|
get dashboard() {
|
|
12268
|
-
return new
|
|
12324
|
+
return new BdDashboardClient(this);
|
|
12269
12325
|
}
|
|
12270
12326
|
get storefront() {
|
|
12271
|
-
return new
|
|
12327
|
+
return new BdStorefrontClient(this);
|
|
12272
12328
|
}
|
|
12273
12329
|
get cart() {
|
|
12274
|
-
return new
|
|
12330
|
+
return new BdCartClient(this);
|
|
12275
12331
|
}
|
|
12276
12332
|
get checkout() {
|
|
12277
|
-
return new
|
|
12333
|
+
return new BdCheckoutClient(this);
|
|
12278
12334
|
}
|
|
12279
12335
|
get coupons() {
|
|
12280
|
-
return new
|
|
12336
|
+
return new BdCouponsClient(this);
|
|
12281
12337
|
}
|
|
12282
12338
|
get subscriptions() {
|
|
12283
|
-
return new
|
|
12339
|
+
return new BdSubscriptionsClient(this);
|
|
12284
12340
|
}
|
|
12285
12341
|
get shipping() {
|
|
12286
|
-
return new
|
|
12342
|
+
return new BdShippingClient(this);
|
|
12287
12343
|
}
|
|
12288
12344
|
/** Customer-portal invitations — currently resend. */
|
|
12289
12345
|
get customerInvites() {
|
|
12290
|
-
return new
|
|
12346
|
+
return new BdCustomerInvitesClient(this);
|
|
12291
12347
|
}
|
|
12292
12348
|
get notifications() {
|
|
12293
|
-
return new
|
|
12349
|
+
return new BdNotificationsClient(this);
|
|
12294
12350
|
}
|
|
12295
12351
|
get address() {
|
|
12296
|
-
return new
|
|
12352
|
+
return new BdAddressClient(this);
|
|
12297
12353
|
}
|
|
12298
12354
|
get blog() {
|
|
12299
|
-
return new
|
|
12355
|
+
return new BdBlogClient(this);
|
|
12300
12356
|
}
|
|
12301
12357
|
get reviews() {
|
|
12302
|
-
return new
|
|
12358
|
+
return new BdReviewsClient(this);
|
|
12303
12359
|
}
|
|
12304
12360
|
/**
|
|
12305
12361
|
* Tracking consent for this org's site.
|
|
@@ -12308,11 +12364,11 @@ var BiabDevClient = class {
|
|
|
12308
12364
|
* and gives you a gate to check before starting analytics.
|
|
12309
12365
|
*/
|
|
12310
12366
|
get consent() {
|
|
12311
|
-
return new
|
|
12367
|
+
return new BdConsentClient(this);
|
|
12312
12368
|
}
|
|
12313
12369
|
/** Public job postings — build a careers page on your own domain. */
|
|
12314
12370
|
get hiring() {
|
|
12315
|
-
return new
|
|
12371
|
+
return new BdHiringClient(this);
|
|
12316
12372
|
}
|
|
12317
12373
|
/**
|
|
12318
12374
|
* The org's published legal pages — privacy, terms, refund policy, whatever
|
|
@@ -12322,23 +12378,23 @@ var BiabDevClient = class {
|
|
|
12322
12378
|
* per document.
|
|
12323
12379
|
*/
|
|
12324
12380
|
get legal() {
|
|
12325
|
-
return new
|
|
12381
|
+
return new BdLegalClient(this);
|
|
12326
12382
|
}
|
|
12327
12383
|
get chatbot() {
|
|
12328
|
-
return new
|
|
12384
|
+
return new BdChatbotClient(this);
|
|
12329
12385
|
}
|
|
12330
12386
|
get auth() {
|
|
12331
|
-
return new
|
|
12387
|
+
return new BdAuthClient(this);
|
|
12332
12388
|
}
|
|
12333
12389
|
/**
|
|
12334
|
-
* Customer-portal client. Pin to a specific
|
|
12390
|
+
* Customer-portal client. Pin to a specific BD organization id so the
|
|
12335
12391
|
* caller never sees data from any other org (recommended). Omit
|
|
12336
12392
|
* `organizationId` to fall back to the user's currently-active session
|
|
12337
12393
|
* org — only use that on first-party hosts where the host already pins
|
|
12338
12394
|
* the org.
|
|
12339
12395
|
*/
|
|
12340
12396
|
customerPortal(organizationId) {
|
|
12341
|
-
return new
|
|
12397
|
+
return new BdCustomerPortalClient(this, organizationId ?? null);
|
|
12342
12398
|
}
|
|
12343
12399
|
async introspect() {
|
|
12344
12400
|
return this.request({
|
|
@@ -12365,7 +12421,7 @@ var BiabDevClient = class {
|
|
|
12365
12421
|
}
|
|
12366
12422
|
const response = await this.fetchImpl(url, init);
|
|
12367
12423
|
const body = await parseResponseBody(response);
|
|
12368
|
-
if (
|
|
12424
|
+
if (isBdPlanGateBody(body)) {
|
|
12369
12425
|
throw accessRejectionFromBody({
|
|
12370
12426
|
body,
|
|
12371
12427
|
path: url.pathname,
|
|
@@ -12373,12 +12429,12 @@ var BiabDevClient = class {
|
|
|
12373
12429
|
});
|
|
12374
12430
|
}
|
|
12375
12431
|
if (!response.ok) {
|
|
12376
|
-
throw new
|
|
12432
|
+
throw new BdApiError({
|
|
12377
12433
|
status: response.status,
|
|
12378
12434
|
path: url.pathname,
|
|
12379
12435
|
message: extractErrorMessage(
|
|
12380
12436
|
body,
|
|
12381
|
-
`
|
|
12437
|
+
`BD API request failed with status ${response.status}.`
|
|
12382
12438
|
),
|
|
12383
12439
|
body
|
|
12384
12440
|
});
|
|
@@ -12386,22 +12442,22 @@ var BiabDevClient = class {
|
|
|
12386
12442
|
return options.responseSchema.parse(body);
|
|
12387
12443
|
}
|
|
12388
12444
|
};
|
|
12389
|
-
var
|
|
12445
|
+
var BdSiteClient = class {
|
|
12390
12446
|
constructor(client, siteId) {
|
|
12391
12447
|
this.client = client;
|
|
12392
12448
|
this.siteId = siteId;
|
|
12393
|
-
this.collections = new
|
|
12394
|
-
this.scheduling = new
|
|
12395
|
-
this.rows = new
|
|
12396
|
-
this.dataModel = new
|
|
12397
|
-
this.analytics = new
|
|
12398
|
-
this.attribution = new
|
|
12399
|
-
this.assets = new
|
|
12400
|
-
this.actions = new
|
|
12401
|
-
this.followers = new
|
|
12402
|
-
this.marketingPages = new
|
|
12403
|
-
this.marketing = new
|
|
12404
|
-
this.parallelPages = new
|
|
12449
|
+
this.collections = new BdCollectionsClient(client, siteId);
|
|
12450
|
+
this.scheduling = new BdSchedulingClient(client, siteId);
|
|
12451
|
+
this.rows = new BdRowsClient(client, siteId);
|
|
12452
|
+
this.dataModel = new BdDataModelClient(client, siteId);
|
|
12453
|
+
this.analytics = new BdAnalyticsClient(client, siteId);
|
|
12454
|
+
this.attribution = new BdAttributionClient(client, siteId);
|
|
12455
|
+
this.assets = new BdAssetsClient(client, siteId);
|
|
12456
|
+
this.actions = new BdActionsClient(client, siteId);
|
|
12457
|
+
this.followers = new BdFollowersClient(client, siteId);
|
|
12458
|
+
this.marketingPages = new BdMarketingPagesClient(client, siteId);
|
|
12459
|
+
this.marketing = new BdMarketingClient(client, siteId);
|
|
12460
|
+
this.parallelPages = new BdParallelPagesClient(client, siteId);
|
|
12405
12461
|
}
|
|
12406
12462
|
client;
|
|
12407
12463
|
siteId;
|
|
@@ -12410,18 +12466,18 @@ var BiabDevSiteClient = class {
|
|
|
12410
12466
|
/**
|
|
12411
12467
|
* The org's custom database — the tables from `defineDataModel()`.
|
|
12412
12468
|
* Distinct from `collections`/`rows`, which are Site Data. See
|
|
12413
|
-
* {@link
|
|
12469
|
+
* {@link BdDataModelClient}.
|
|
12414
12470
|
*/
|
|
12415
12471
|
dataModel;
|
|
12416
12472
|
/**
|
|
12417
12473
|
* Read your site's visitor counts back (the counterpart to the
|
|
12418
|
-
* `<
|
|
12419
|
-
* {@link
|
|
12474
|
+
* `<BDAnalytics/>` tracker, which only records). See
|
|
12475
|
+
* {@link BdAnalyticsClient}.
|
|
12420
12476
|
*/
|
|
12421
12477
|
analytics;
|
|
12422
12478
|
/**
|
|
12423
12479
|
* The "Powered by BusinessDash" badge's policy + heartbeat. See
|
|
12424
|
-
* {@link
|
|
12480
|
+
* {@link BdAttributionClient}.
|
|
12425
12481
|
*/
|
|
12426
12482
|
attribution;
|
|
12427
12483
|
assets;
|
|
@@ -12430,7 +12486,7 @@ var BiabDevSiteClient = class {
|
|
|
12430
12486
|
marketingPages;
|
|
12431
12487
|
/**
|
|
12432
12488
|
* Schema-driven marketing flow (Phase 2). Pair with the SDK's
|
|
12433
|
-
* `defineSiteMarketingSchema()` builder + the `
|
|
12489
|
+
* `defineSiteMarketingSchema()` builder + the `bd sync-schema`
|
|
12434
12490
|
* CLI for the authoring side; this client is the live-site read
|
|
12435
12491
|
* path (`getPageBundle`) and the upload entry point for the CLI.
|
|
12436
12492
|
*/
|
|
@@ -12529,7 +12585,7 @@ var parallelPagesRenderResponseSchema = external_exports.object({
|
|
|
12529
12585
|
meta: parallelPageMetaSchema,
|
|
12530
12586
|
body: external_exports.unknown().nullable()
|
|
12531
12587
|
});
|
|
12532
|
-
var
|
|
12588
|
+
var BdParallelPagesClient = class {
|
|
12533
12589
|
constructor(client, siteId) {
|
|
12534
12590
|
this.client = client;
|
|
12535
12591
|
this.siteId = siteId;
|
|
@@ -12589,7 +12645,7 @@ function clearMarketingCache(siteId) {
|
|
|
12589
12645
|
marketingSchemaCache.delete(siteId);
|
|
12590
12646
|
marketingLocalesCache.delete(siteId);
|
|
12591
12647
|
}
|
|
12592
|
-
var
|
|
12648
|
+
var BdMarketingClient = class {
|
|
12593
12649
|
constructor(client, siteId) {
|
|
12594
12650
|
this.client = client;
|
|
12595
12651
|
this.siteId = siteId;
|
|
@@ -12648,15 +12704,15 @@ var BiabDevMarketingClient = class {
|
|
|
12648
12704
|
});
|
|
12649
12705
|
}
|
|
12650
12706
|
/**
|
|
12651
|
-
* Bulk-upsert section values. Used by `
|
|
12652
|
-
* local JSON content to
|
|
12707
|
+
* Bulk-upsert section values. Used by `bd sync-content` to push
|
|
12708
|
+
* local JSON content to BD. Server caps each request at 256 items;
|
|
12653
12709
|
* larger imports are batched by the CLI. Per-item failures are
|
|
12654
12710
|
* reported in the response (`results[].ok === false`) without aborting
|
|
12655
12711
|
* the rest of the batch.
|
|
12656
12712
|
*
|
|
12657
12713
|
* The CLI's `--lax` flag sets `validate: false` for first-time imports
|
|
12658
12714
|
* of legacy content that doesn't yet match the published schema —
|
|
12659
|
-
* useful so writers can pull existing content into
|
|
12715
|
+
* useful so writers can pull existing content into BD and fix
|
|
12660
12716
|
* validation errors in the dashboard incrementally.
|
|
12661
12717
|
*/
|
|
12662
12718
|
async publishSections(input) {
|
|
@@ -12695,7 +12751,7 @@ function clearMarketingPageCache(siteId, pageKey) {
|
|
|
12695
12751
|
if (key.startsWith(prefix)) marketingPageCache.delete(key);
|
|
12696
12752
|
}
|
|
12697
12753
|
}
|
|
12698
|
-
var
|
|
12754
|
+
var BdMarketingPagesClient = class {
|
|
12699
12755
|
constructor(client, siteId) {
|
|
12700
12756
|
this.client = client;
|
|
12701
12757
|
this.siteId = siteId;
|
|
@@ -12754,7 +12810,7 @@ var BiabDevMarketingPagesClient = class {
|
|
|
12754
12810
|
return this.get(pageKey);
|
|
12755
12811
|
}
|
|
12756
12812
|
};
|
|
12757
|
-
var
|
|
12813
|
+
var BdCollectionsClient = class {
|
|
12758
12814
|
constructor(client, siteId) {
|
|
12759
12815
|
this.client = client;
|
|
12760
12816
|
this.siteId = siteId;
|
|
@@ -12783,7 +12839,7 @@ var BiabDevCollectionsClient = class {
|
|
|
12783
12839
|
});
|
|
12784
12840
|
}
|
|
12785
12841
|
};
|
|
12786
|
-
var
|
|
12842
|
+
var BdRowsClient = class {
|
|
12787
12843
|
constructor(client, siteId) {
|
|
12788
12844
|
this.client = client;
|
|
12789
12845
|
this.siteId = siteId;
|
|
@@ -12817,7 +12873,7 @@ var BiabDevRowsClient = class {
|
|
|
12817
12873
|
});
|
|
12818
12874
|
}
|
|
12819
12875
|
};
|
|
12820
|
-
var
|
|
12876
|
+
var BdDataModelClient = class {
|
|
12821
12877
|
constructor(client, siteId) {
|
|
12822
12878
|
this.client = client;
|
|
12823
12879
|
this.siteId = siteId;
|
|
@@ -12865,7 +12921,7 @@ var BiabDevDataModelClient = class {
|
|
|
12865
12921
|
return { available: true, records, nextCursor: null };
|
|
12866
12922
|
}
|
|
12867
12923
|
};
|
|
12868
|
-
var
|
|
12924
|
+
var BdAnalyticsClient = class {
|
|
12869
12925
|
constructor(client, siteId) {
|
|
12870
12926
|
this.client = client;
|
|
12871
12927
|
this.siteId = siteId;
|
|
@@ -12900,7 +12956,7 @@ var BiabDevAnalyticsClient = class {
|
|
|
12900
12956
|
* to a 30-day window.
|
|
12901
12957
|
*
|
|
12902
12958
|
* ```ts
|
|
12903
|
-
* const ai = await
|
|
12959
|
+
* const ai = await bd.site(siteId).analytics.aiVisibility({ days: 30 });
|
|
12904
12960
|
* if (ai.available) {
|
|
12905
12961
|
* for (const c of ai.crawlers)
|
|
12906
12962
|
* console.log(`${c.name}: ${c.fetches} fetches over ${c.distinctPages} pages`);
|
|
@@ -12916,7 +12972,7 @@ var BiabDevAnalyticsClient = class {
|
|
|
12916
12972
|
});
|
|
12917
12973
|
}
|
|
12918
12974
|
};
|
|
12919
|
-
var
|
|
12975
|
+
var BdAttributionClient = class {
|
|
12920
12976
|
constructor(client, siteId) {
|
|
12921
12977
|
this.client = client;
|
|
12922
12978
|
this.siteId = siteId;
|
|
@@ -12949,7 +13005,7 @@ var BiabDevAttributionClient = class {
|
|
|
12949
13005
|
});
|
|
12950
13006
|
}
|
|
12951
13007
|
};
|
|
12952
|
-
var
|
|
13008
|
+
var BdAssetsClient = class {
|
|
12953
13009
|
constructor(client, siteId) {
|
|
12954
13010
|
this.client = client;
|
|
12955
13011
|
this.siteId = siteId;
|
|
@@ -12966,7 +13022,7 @@ var BiabDevAssetsClient = class {
|
|
|
12966
13022
|
});
|
|
12967
13023
|
}
|
|
12968
13024
|
};
|
|
12969
|
-
var
|
|
13025
|
+
var BdActionsClient = class {
|
|
12970
13026
|
constructor(client, siteId) {
|
|
12971
13027
|
this.client = client;
|
|
12972
13028
|
this.siteId = siteId;
|
|
@@ -12983,7 +13039,7 @@ var BiabDevActionsClient = class {
|
|
|
12983
13039
|
});
|
|
12984
13040
|
}
|
|
12985
13041
|
};
|
|
12986
|
-
var
|
|
13042
|
+
var BdEmailTemplatesClient = class {
|
|
12987
13043
|
constructor(client) {
|
|
12988
13044
|
this.client = client;
|
|
12989
13045
|
}
|
|
@@ -13021,7 +13077,7 @@ var BiabDevEmailTemplatesClient = class {
|
|
|
13021
13077
|
});
|
|
13022
13078
|
}
|
|
13023
13079
|
};
|
|
13024
|
-
var
|
|
13080
|
+
var BdFollowersClient = class {
|
|
13025
13081
|
constructor(client, siteId) {
|
|
13026
13082
|
this.client = client;
|
|
13027
13083
|
this.siteId = siteId;
|
|
@@ -13076,7 +13132,7 @@ var BiabDevFollowersClient = class {
|
|
|
13076
13132
|
return followerLeaveResponseSchema.parse(response.result);
|
|
13077
13133
|
}
|
|
13078
13134
|
};
|
|
13079
|
-
var
|
|
13135
|
+
var BdDashboardClient = class {
|
|
13080
13136
|
constructor(client) {
|
|
13081
13137
|
this.client = client;
|
|
13082
13138
|
}
|
|
@@ -13089,7 +13145,7 @@ var BiabDevDashboardClient = class {
|
|
|
13089
13145
|
});
|
|
13090
13146
|
}
|
|
13091
13147
|
};
|
|
13092
|
-
var
|
|
13148
|
+
var BdStorefrontClient = class {
|
|
13093
13149
|
constructor(client) {
|
|
13094
13150
|
this.client = client;
|
|
13095
13151
|
}
|
|
@@ -13097,7 +13153,7 @@ var BiabDevStorefrontClient = class {
|
|
|
13097
13153
|
/**
|
|
13098
13154
|
* Legacy embed-session mint (kept for iframe-widget consumers).
|
|
13099
13155
|
* The programmatic methods below let consumer sites render their
|
|
13100
|
-
* own native product catalog using
|
|
13156
|
+
* own native product catalog using BD as the data layer.
|
|
13101
13157
|
*/
|
|
13102
13158
|
async createSession(input) {
|
|
13103
13159
|
const body = storefrontSessionInputSchema.parse(input ?? void 0);
|
|
@@ -13128,7 +13184,7 @@ var BiabDevStorefrontClient = class {
|
|
|
13128
13184
|
* ```ts
|
|
13129
13185
|
* let remaining = 1;
|
|
13130
13186
|
* while (remaining > 0) {
|
|
13131
|
-
* const res = await
|
|
13187
|
+
* const res = await bd.storefront.syncToStripe();
|
|
13132
13188
|
* remaining = res.remaining;
|
|
13133
13189
|
* }
|
|
13134
13190
|
* ```
|
|
@@ -13195,7 +13251,7 @@ var BiabDevStorefrontClient = class {
|
|
|
13195
13251
|
}
|
|
13196
13252
|
/**
|
|
13197
13253
|
* Full product detail with variants + per-image rows. Returns 404
|
|
13198
|
-
* via `
|
|
13254
|
+
* via `BdApiError` if the product isn't live or doesn't belong
|
|
13199
13255
|
* to the org bound to the API key.
|
|
13200
13256
|
*/
|
|
13201
13257
|
/**
|
|
@@ -13210,7 +13266,7 @@ var BiabDevStorefrontClient = class {
|
|
|
13210
13266
|
* The platform withholds the raw URL from every product payload on purpose:
|
|
13211
13267
|
* CAD files are the largest thing it serves and are the org's intellectual
|
|
13212
13268
|
* property, so a catalog of naked URLs is a design library published to
|
|
13213
|
-
* anyone willing to write a loop. This endpoint requires a `
|
|
13269
|
+
* anyone willing to write a loop. This endpoint requires a `bd_cad` cookie
|
|
13214
13270
|
* on the incoming request, rate-limits per IP, and re-checks the
|
|
13215
13271
|
* `ecommerce.product_3d` entitlement before answering.
|
|
13216
13272
|
*
|
|
@@ -13266,7 +13322,7 @@ var BiabDevStorefrontClient = class {
|
|
|
13266
13322
|
});
|
|
13267
13323
|
}
|
|
13268
13324
|
};
|
|
13269
|
-
var
|
|
13325
|
+
var BdCartClient = class _BdCartClient {
|
|
13270
13326
|
constructor(client, visitorToken = null, sessionToken = null) {
|
|
13271
13327
|
this.client = client;
|
|
13272
13328
|
this.visitorToken = visitorToken;
|
|
@@ -13281,7 +13337,7 @@ var BiabDevCartClient = class _BiabDevCartClient {
|
|
|
13281
13337
|
* sign-in required.
|
|
13282
13338
|
*/
|
|
13283
13339
|
forVisitor(visitorToken) {
|
|
13284
|
-
return new
|
|
13340
|
+
return new _BdCartClient(this.client, visitorToken, null);
|
|
13285
13341
|
}
|
|
13286
13342
|
/**
|
|
13287
13343
|
* Use a tenantAuth session token instead of a visitor token.
|
|
@@ -13289,12 +13345,12 @@ var BiabDevCartClient = class _BiabDevCartClient {
|
|
|
13289
13345
|
* across devices.
|
|
13290
13346
|
*/
|
|
13291
13347
|
withSession(sessionToken) {
|
|
13292
|
-
return new
|
|
13348
|
+
return new _BdCartClient(this.client, null, sessionToken);
|
|
13293
13349
|
}
|
|
13294
13350
|
headers() {
|
|
13295
13351
|
const out = {};
|
|
13296
|
-
if (this.visitorToken) out["X-
|
|
13297
|
-
if (this.sessionToken) out["X-
|
|
13352
|
+
if (this.visitorToken) out["X-BD-Cart-Visitor"] = this.visitorToken;
|
|
13353
|
+
if (this.sessionToken) out["X-BD-Session-Token"] = this.sessionToken;
|
|
13298
13354
|
return out;
|
|
13299
13355
|
}
|
|
13300
13356
|
/**
|
|
@@ -13393,7 +13449,7 @@ var BiabDevCartClient = class _BiabDevCartClient {
|
|
|
13393
13449
|
});
|
|
13394
13450
|
}
|
|
13395
13451
|
};
|
|
13396
|
-
var
|
|
13452
|
+
var BdCheckoutClient = class _BdCheckoutClient {
|
|
13397
13453
|
constructor(client, visitorToken = null, sessionToken = null) {
|
|
13398
13454
|
this.client = client;
|
|
13399
13455
|
this.visitorToken = visitorToken;
|
|
@@ -13407,7 +13463,7 @@ var BiabDevCheckoutClient = class _BiabDevCheckoutClient {
|
|
|
13407
13463
|
* (visitor-token cart). Same UUID you used with `client.cart.forVisitor(...)`.
|
|
13408
13464
|
*/
|
|
13409
13465
|
forVisitor(visitorToken) {
|
|
13410
|
-
return new
|
|
13466
|
+
return new _BdCheckoutClient(this.client, visitorToken, null);
|
|
13411
13467
|
}
|
|
13412
13468
|
/**
|
|
13413
13469
|
* Authenticate as a signed-in customer (tenantAuth session token).
|
|
@@ -13415,12 +13471,12 @@ var BiabDevCheckoutClient = class _BiabDevCheckoutClient {
|
|
|
13415
13471
|
* customer's saved cart.
|
|
13416
13472
|
*/
|
|
13417
13473
|
withSession(sessionToken) {
|
|
13418
|
-
return new
|
|
13474
|
+
return new _BdCheckoutClient(this.client, null, sessionToken);
|
|
13419
13475
|
}
|
|
13420
13476
|
headers() {
|
|
13421
13477
|
const out = {};
|
|
13422
|
-
if (this.visitorToken) out["X-
|
|
13423
|
-
if (this.sessionToken) out["X-
|
|
13478
|
+
if (this.visitorToken) out["X-BD-Cart-Visitor"] = this.visitorToken;
|
|
13479
|
+
if (this.sessionToken) out["X-BD-Session-Token"] = this.sessionToken;
|
|
13424
13480
|
return out;
|
|
13425
13481
|
}
|
|
13426
13482
|
/**
|
|
@@ -13438,7 +13494,7 @@ var BiabDevCheckoutClient = class _BiabDevCheckoutClient {
|
|
|
13438
13494
|
});
|
|
13439
13495
|
}
|
|
13440
13496
|
/**
|
|
13441
|
-
* Convert the caller's saved
|
|
13497
|
+
* Convert the caller's saved BD cart (resolved via visitor token
|
|
13442
13498
|
* or session token) into a Stripe Checkout Session. Returns the
|
|
13443
13499
|
* Stripe-hosted URL; redirect the browser there to collect payment.
|
|
13444
13500
|
*
|
|
@@ -13469,7 +13525,7 @@ var BiabDevCheckoutClient = class _BiabDevCheckoutClient {
|
|
|
13469
13525
|
});
|
|
13470
13526
|
}
|
|
13471
13527
|
};
|
|
13472
|
-
var
|
|
13528
|
+
var BdAddressClient = class {
|
|
13473
13529
|
constructor(client) {
|
|
13474
13530
|
this.client = client;
|
|
13475
13531
|
}
|
|
@@ -13521,7 +13577,7 @@ var BiabDevAddressClient = class {
|
|
|
13521
13577
|
};
|
|
13522
13578
|
}
|
|
13523
13579
|
};
|
|
13524
|
-
var
|
|
13580
|
+
var BdSubscriptionsClient = class {
|
|
13525
13581
|
constructor(client) {
|
|
13526
13582
|
this.client = client;
|
|
13527
13583
|
}
|
|
@@ -13548,7 +13604,7 @@ var BiabDevSubscriptionsClient = class {
|
|
|
13548
13604
|
});
|
|
13549
13605
|
}
|
|
13550
13606
|
};
|
|
13551
|
-
var
|
|
13607
|
+
var BdCouponsClient = class {
|
|
13552
13608
|
constructor(client) {
|
|
13553
13609
|
this.client = client;
|
|
13554
13610
|
}
|
|
@@ -13584,7 +13640,7 @@ var BiabDevCouponsClient = class {
|
|
|
13584
13640
|
* Requires a SECRET key holding `storefront:write`.
|
|
13585
13641
|
*
|
|
13586
13642
|
* ```ts
|
|
13587
|
-
* const { coupon, stripeSynced } = await
|
|
13643
|
+
* const { coupon, stripeSynced } = await bd.coupons.create({
|
|
13588
13644
|
* code: 'WELCOME10',
|
|
13589
13645
|
* discountType: 'percent',
|
|
13590
13646
|
* value: 10,
|
|
@@ -13621,7 +13677,7 @@ var BiabDevCouponsClient = class {
|
|
|
13621
13677
|
});
|
|
13622
13678
|
}
|
|
13623
13679
|
};
|
|
13624
|
-
var
|
|
13680
|
+
var BdShippingClient = class _BdShippingClient {
|
|
13625
13681
|
constructor(client, visitorToken = null, sessionToken = null) {
|
|
13626
13682
|
this.client = client;
|
|
13627
13683
|
this.visitorToken = visitorToken;
|
|
@@ -13631,15 +13687,15 @@ var BiabDevShippingClient = class _BiabDevShippingClient {
|
|
|
13631
13687
|
visitorToken;
|
|
13632
13688
|
sessionToken;
|
|
13633
13689
|
forVisitor(visitorToken) {
|
|
13634
|
-
return new
|
|
13690
|
+
return new _BdShippingClient(this.client, visitorToken, null);
|
|
13635
13691
|
}
|
|
13636
13692
|
withSession(sessionToken) {
|
|
13637
|
-
return new
|
|
13693
|
+
return new _BdShippingClient(this.client, null, sessionToken);
|
|
13638
13694
|
}
|
|
13639
13695
|
headers() {
|
|
13640
13696
|
const out = {};
|
|
13641
|
-
if (this.visitorToken) out["X-
|
|
13642
|
-
if (this.sessionToken) out["X-
|
|
13697
|
+
if (this.visitorToken) out["X-BD-Cart-Visitor"] = this.visitorToken;
|
|
13698
|
+
if (this.sessionToken) out["X-BD-Session-Token"] = this.sessionToken;
|
|
13643
13699
|
return out;
|
|
13644
13700
|
}
|
|
13645
13701
|
/**
|
|
@@ -13690,7 +13746,7 @@ var BiabDevShippingClient = class _BiabDevShippingClient {
|
|
|
13690
13746
|
});
|
|
13691
13747
|
}
|
|
13692
13748
|
};
|
|
13693
|
-
var
|
|
13749
|
+
var BdNotificationsClient = class _BdNotificationsClient {
|
|
13694
13750
|
constructor(client, sessionToken = null) {
|
|
13695
13751
|
this.client = client;
|
|
13696
13752
|
this.sessionToken = sessionToken;
|
|
@@ -13698,10 +13754,10 @@ var BiabDevNotificationsClient = class _BiabDevNotificationsClient {
|
|
|
13698
13754
|
client;
|
|
13699
13755
|
sessionToken;
|
|
13700
13756
|
withSession(sessionToken) {
|
|
13701
|
-
return new
|
|
13757
|
+
return new _BdNotificationsClient(this.client, sessionToken);
|
|
13702
13758
|
}
|
|
13703
13759
|
headers() {
|
|
13704
|
-
return this.sessionToken ? { "X-
|
|
13760
|
+
return this.sessionToken ? { "X-BD-Session-Token": this.sessionToken } : {};
|
|
13705
13761
|
}
|
|
13706
13762
|
async getPreferences() {
|
|
13707
13763
|
return this.client.request({
|
|
@@ -13754,7 +13810,7 @@ var BiabDevNotificationsClient = class _BiabDevNotificationsClient {
|
|
|
13754
13810
|
});
|
|
13755
13811
|
}
|
|
13756
13812
|
};
|
|
13757
|
-
var
|
|
13813
|
+
var BdBlogClient = class _BdBlogClient {
|
|
13758
13814
|
constructor(client, sessionToken = null) {
|
|
13759
13815
|
this.client = client;
|
|
13760
13816
|
this.sessionToken = sessionToken;
|
|
@@ -13773,10 +13829,10 @@ var BiabDevBlogClient = class _BiabDevBlogClient {
|
|
|
13773
13829
|
* ```
|
|
13774
13830
|
*/
|
|
13775
13831
|
withSession(sessionToken) {
|
|
13776
|
-
return new
|
|
13832
|
+
return new _BdBlogClient(this.client, sessionToken);
|
|
13777
13833
|
}
|
|
13778
13834
|
headers() {
|
|
13779
|
-
return this.sessionToken ? { "X-
|
|
13835
|
+
return this.sessionToken ? { "X-BD-Session-Token": this.sessionToken } : {};
|
|
13780
13836
|
}
|
|
13781
13837
|
/**
|
|
13782
13838
|
* Legacy embed-session mint (kept for backwards compat with
|
|
@@ -13886,7 +13942,7 @@ var BiabDevBlogClient = class _BiabDevBlogClient {
|
|
|
13886
13942
|
});
|
|
13887
13943
|
}
|
|
13888
13944
|
};
|
|
13889
|
-
var
|
|
13945
|
+
var BdReviewsClient = class {
|
|
13890
13946
|
constructor(client) {
|
|
13891
13947
|
this.client = client;
|
|
13892
13948
|
}
|
|
@@ -13909,7 +13965,7 @@ var BiabDevReviewsClient = class {
|
|
|
13909
13965
|
});
|
|
13910
13966
|
}
|
|
13911
13967
|
};
|
|
13912
|
-
var
|
|
13968
|
+
var BdHiringClient = class {
|
|
13913
13969
|
constructor(client) {
|
|
13914
13970
|
this.client = client;
|
|
13915
13971
|
}
|
|
@@ -13957,7 +14013,7 @@ var BiabDevHiringClient = class {
|
|
|
13957
14013
|
});
|
|
13958
14014
|
}
|
|
13959
14015
|
};
|
|
13960
|
-
var
|
|
14016
|
+
var BdLegalClient = class {
|
|
13961
14017
|
constructor(client) {
|
|
13962
14018
|
this.client = client;
|
|
13963
14019
|
}
|
|
@@ -13999,7 +14055,7 @@ var consentStateSchema = external_exports.object({
|
|
|
13999
14055
|
mustAsk: external_exports.boolean(),
|
|
14000
14056
|
reason: external_exports.string()
|
|
14001
14057
|
});
|
|
14002
|
-
var
|
|
14058
|
+
var BdConsentClient = class {
|
|
14003
14059
|
constructor(client) {
|
|
14004
14060
|
this.client = client;
|
|
14005
14061
|
}
|
|
@@ -14009,7 +14065,7 @@ var BiabDevConsentClient = class {
|
|
|
14009
14065
|
return this.client.request({
|
|
14010
14066
|
path: "consent",
|
|
14011
14067
|
responseSchema: consentStateSchema,
|
|
14012
|
-
...visitorKey ? { headers: { "x-
|
|
14068
|
+
...visitorKey ? { headers: { "x-bd-visitor": visitorKey } } : {}
|
|
14013
14069
|
});
|
|
14014
14070
|
}
|
|
14015
14071
|
/**
|
|
@@ -14027,12 +14083,12 @@ var BiabDevConsentClient = class {
|
|
|
14027
14083
|
noticeVersion: input.noticeVersion,
|
|
14028
14084
|
source: input.source ?? "banner"
|
|
14029
14085
|
},
|
|
14030
|
-
headers: { "x-
|
|
14086
|
+
headers: { "x-bd-visitor": input.visitorKey },
|
|
14031
14087
|
responseSchema: external_exports.object({ ok: external_exports.boolean() })
|
|
14032
14088
|
});
|
|
14033
14089
|
}
|
|
14034
14090
|
};
|
|
14035
|
-
var
|
|
14091
|
+
var BdChatbotClient = class {
|
|
14036
14092
|
constructor(client) {
|
|
14037
14093
|
this.client = client;
|
|
14038
14094
|
}
|
|
@@ -14272,7 +14328,7 @@ function decodeBase64ToBytes(base64) {
|
|
|
14272
14328
|
}
|
|
14273
14329
|
return bytes;
|
|
14274
14330
|
}
|
|
14275
|
-
var
|
|
14331
|
+
var BdCustomerPortalClient = class _BdCustomerPortalClient {
|
|
14276
14332
|
constructor(client, organizationId, sessionToken = null) {
|
|
14277
14333
|
this.client = client;
|
|
14278
14334
|
this.organizationId = organizationId;
|
|
@@ -14296,7 +14352,7 @@ var BiabDevCustomerPortalClient = class _BiabDevCustomerPortalClient {
|
|
|
14296
14352
|
* ```
|
|
14297
14353
|
*/
|
|
14298
14354
|
withSession(sessionToken) {
|
|
14299
|
-
return new
|
|
14355
|
+
return new _BdCustomerPortalClient(
|
|
14300
14356
|
this.client,
|
|
14301
14357
|
this.organizationId,
|
|
14302
14358
|
sessionToken
|
|
@@ -14305,10 +14361,10 @@ var BiabDevCustomerPortalClient = class _BiabDevCustomerPortalClient {
|
|
|
14305
14361
|
headers() {
|
|
14306
14362
|
const out = {};
|
|
14307
14363
|
if (this.organizationId) {
|
|
14308
|
-
out["X-
|
|
14364
|
+
out["X-BD-Customer-Portal-Org"] = this.organizationId;
|
|
14309
14365
|
}
|
|
14310
14366
|
if (this.sessionToken) {
|
|
14311
|
-
out["X-
|
|
14367
|
+
out["X-BD-Session-Token"] = this.sessionToken;
|
|
14312
14368
|
}
|
|
14313
14369
|
return out;
|
|
14314
14370
|
}
|
|
@@ -14437,6 +14493,29 @@ var BiabDevCustomerPortalClient = class _BiabDevCustomerPortalClient {
|
|
|
14437
14493
|
headers: this.headers()
|
|
14438
14494
|
});
|
|
14439
14495
|
}
|
|
14496
|
+
/**
|
|
14497
|
+
* Designed proposals the customer has been sent.
|
|
14498
|
+
*
|
|
14499
|
+
* Separate from `listQuotes` because a proposal is the document built
|
|
14500
|
+
* around a quote, not the quote: `kind` decides whether a consumer offers
|
|
14501
|
+
* a download or frames a page, and a UI that guessed would get one of the
|
|
14502
|
+
* two wrong every time.
|
|
14503
|
+
*/
|
|
14504
|
+
async listProposals() {
|
|
14505
|
+
return this.client.request({
|
|
14506
|
+
path: "customer-portal/proposals",
|
|
14507
|
+
responseSchema: customerProposalListResponseSchema,
|
|
14508
|
+
headers: this.headers()
|
|
14509
|
+
});
|
|
14510
|
+
}
|
|
14511
|
+
/** One proposal the customer owns. */
|
|
14512
|
+
async getProposal(proposalId) {
|
|
14513
|
+
return this.client.request({
|
|
14514
|
+
path: `customer-portal/proposals/${encodeURIComponent(proposalId)}`,
|
|
14515
|
+
responseSchema: customerProposalSchema,
|
|
14516
|
+
headers: this.headers()
|
|
14517
|
+
});
|
|
14518
|
+
}
|
|
14440
14519
|
/** Read a single quote the signed-in customer owns. */
|
|
14441
14520
|
async getQuote(quoteId) {
|
|
14442
14521
|
return this.client.request({
|
|
@@ -14544,7 +14623,7 @@ var BiabDevCustomerPortalClient = class _BiabDevCustomerPortalClient {
|
|
|
14544
14623
|
/**
|
|
14545
14624
|
* Begin signing a contract the customer owns. Returns a ready, absolute
|
|
14546
14625
|
* signing URL on the org's branded hostname — redirect the customer there
|
|
14547
|
-
* to
|
|
14626
|
+
* to BD's hosted e-sign page, which captures the signature and generates
|
|
14548
14627
|
* the executed PDF. No signature payload is collected client-side, so the
|
|
14549
14628
|
* legal record stays consistent across consumers.
|
|
14550
14629
|
*
|
|
@@ -15056,7 +15135,7 @@ var BiabDevCustomerPortalClient = class _BiabDevCustomerPortalClient {
|
|
|
15056
15135
|
/**
|
|
15057
15136
|
* List the digital downloads the customer is entitled to for a paid order
|
|
15058
15137
|
* (P10d). Each item is a ready-to-use URL — a short-lived presigned link for
|
|
15059
|
-
*
|
|
15138
|
+
* BD-hosted files (`expiresInSeconds` set) or the org's external link.
|
|
15060
15139
|
* Returns an empty list until the order's payment settles.
|
|
15061
15140
|
*
|
|
15062
15141
|
* @example
|
|
@@ -15201,10 +15280,10 @@ var BiabDevCustomerPortalClient = class _BiabDevCustomerPortalClient {
|
|
|
15201
15280
|
});
|
|
15202
15281
|
}
|
|
15203
15282
|
};
|
|
15204
|
-
function
|
|
15205
|
-
return new
|
|
15283
|
+
function createBdApiClient(options) {
|
|
15284
|
+
return new BdApiClient(options);
|
|
15206
15285
|
}
|
|
15207
|
-
var
|
|
15286
|
+
var BdAuthClient = class {
|
|
15208
15287
|
constructor(client) {
|
|
15209
15288
|
this.client = client;
|
|
15210
15289
|
}
|
|
@@ -15254,7 +15333,7 @@ var BiabDevAuthClient = class {
|
|
|
15254
15333
|
return this.client.request({
|
|
15255
15334
|
method: "GET",
|
|
15256
15335
|
path: "auth/me",
|
|
15257
|
-
headers: { "x-
|
|
15336
|
+
headers: { "x-bd-session": input.sessionToken },
|
|
15258
15337
|
responseSchema: tenantAuthMeResponseSchema
|
|
15259
15338
|
});
|
|
15260
15339
|
}
|
|
@@ -15286,7 +15365,7 @@ var BiabDevAuthClient = class {
|
|
|
15286
15365
|
});
|
|
15287
15366
|
}
|
|
15288
15367
|
};
|
|
15289
|
-
var
|
|
15368
|
+
var BdCustomerInvitesClient = class {
|
|
15290
15369
|
constructor(client) {
|
|
15291
15370
|
this.client = client;
|
|
15292
15371
|
}
|
|
@@ -15320,7 +15399,7 @@ var BiabDevCustomerInvitesClient = class {
|
|
|
15320
15399
|
});
|
|
15321
15400
|
}
|
|
15322
15401
|
};
|
|
15323
|
-
var
|
|
15402
|
+
var BdSchedulingClient = class {
|
|
15324
15403
|
constructor(client, siteId) {
|
|
15325
15404
|
this.client = client;
|
|
15326
15405
|
this.siteId = siteId;
|
|
@@ -15472,8 +15551,8 @@ var BiabDevSchedulingClient = class {
|
|
|
15472
15551
|
};
|
|
15473
15552
|
|
|
15474
15553
|
// src/auth-handler.ts
|
|
15475
|
-
var DEFAULT_AUTH_COOKIE_NAME = "
|
|
15476
|
-
var DEFAULT_AUTH_BASE_PATH = "/api/
|
|
15554
|
+
var DEFAULT_AUTH_COOKIE_NAME = "bd_session";
|
|
15555
|
+
var DEFAULT_AUTH_BASE_PATH = "/api/bd-auth";
|
|
15477
15556
|
function buildSetCookie(name, value, opts) {
|
|
15478
15557
|
const parts = [`${name}=${value}`, "Path=/", "HttpOnly", "SameSite=Lax"];
|
|
15479
15558
|
parts.push("Secure");
|
|
@@ -15513,7 +15592,7 @@ function decodeReturnTo(state) {
|
|
|
15513
15592
|
}
|
|
15514
15593
|
function authStartFailureResponse(error) {
|
|
15515
15594
|
let detail = "";
|
|
15516
|
-
if (error instanceof
|
|
15595
|
+
if (error instanceof BdApiError) {
|
|
15517
15596
|
const fromBody = error.body && typeof error.body === "object" && "message" in error.body && typeof error.body.message === "string" ? error.body.message : error.message;
|
|
15518
15597
|
detail = fromBody ? `${fromBody}
|
|
15519
15598
|
|
|
@@ -15521,8 +15600,8 @@ function authStartFailureResponse(error) {
|
|
|
15521
15600
|
const needsTenantAuthHint = error.status === 403 && (typeof fromBody === "string" ? /tenant_auth|missing_scope/i.test(fromBody) : false);
|
|
15522
15601
|
if (needsTenantAuthHint) {
|
|
15523
15602
|
detail += "Signing in requires API scope tenant_auth:public (it is on by default in Site Builder \u2192 Developer).\n";
|
|
15524
|
-
detail += "If scope is included but this still fails, deploy the latest
|
|
15525
|
-
detail += "Platform operators issuing keys separately: include tenant_auth under Scopes. Re-issue the key, set
|
|
15603
|
+
detail += "If scope is included but this still fails, deploy the latest BD app (pinned-site keys were broken on tenant auth routes) or use an org-wide key (no \u201CPin to current site\u201D).\n";
|
|
15604
|
+
detail += "Platform operators issuing keys separately: include tenant_auth under Scopes. Re-issue the key, set BD_API_KEY, redeploy.";
|
|
15526
15605
|
}
|
|
15527
15606
|
const status = error.status >= 400 && error.status <= 599 ? error.status : 502;
|
|
15528
15607
|
return new Response(`${detail || "Tenant auth request failed."}`.trim(), {
|
|
@@ -15553,7 +15632,7 @@ function createAuthHandler(options) {
|
|
|
15553
15632
|
return void 0;
|
|
15554
15633
|
}
|
|
15555
15634
|
})();
|
|
15556
|
-
const client = new
|
|
15635
|
+
const client = new BdApiClient({
|
|
15557
15636
|
baseUrl: options.baseUrl,
|
|
15558
15637
|
apiKey: options.apiKey,
|
|
15559
15638
|
...options.fetch ? { fetch: options.fetch } : {},
|
|
@@ -15667,7 +15746,7 @@ function createAuthHandler(options) {
|
|
|
15667
15746
|
}
|
|
15668
15747
|
async function getTenantSession(input) {
|
|
15669
15748
|
if (!input.cookieValue) return null;
|
|
15670
|
-
const client = new
|
|
15749
|
+
const client = new BdApiClient({
|
|
15671
15750
|
baseUrl: input.baseUrl,
|
|
15672
15751
|
apiKey: input.apiKey,
|
|
15673
15752
|
...input.fetch ? { fetch: input.fetch } : {},
|
|
@@ -16071,7 +16150,7 @@ function collection(tableName, options) {
|
|
|
16071
16150
|
labelPlural,
|
|
16072
16151
|
labelIdentifierFieldName
|
|
16073
16152
|
} = parseTableName(tableName);
|
|
16074
|
-
const universalIdentifier = options.universalIdentifier ?? generateUniversalIdentifier(`
|
|
16153
|
+
const universalIdentifier = options.universalIdentifier ?? generateUniversalIdentifier(`bd:collection:${nameSingular}`);
|
|
16075
16154
|
const fieldEntries = Object.entries(options.fields);
|
|
16076
16155
|
const relations = [];
|
|
16077
16156
|
let fieldIndex = 0;
|
|
@@ -16085,7 +16164,7 @@ function collection(tableName, options) {
|
|
|
16085
16164
|
fields2.push({
|
|
16086
16165
|
...fieldDef,
|
|
16087
16166
|
universalIdentifier: generateUniversalIdentifier(
|
|
16088
|
-
`
|
|
16167
|
+
`bd:collection:${nameSingular}:field:${fieldName}`
|
|
16089
16168
|
),
|
|
16090
16169
|
name: fieldName,
|
|
16091
16170
|
label: toLabel(fieldName),
|
|
@@ -16361,6 +16440,7 @@ var FIELD_FORM_ELEMENT_MAP = {
|
|
|
16361
16440
|
RICH_TEXT: ["rich_text_input"],
|
|
16362
16441
|
RAW_JSON: [
|
|
16363
16442
|
"address_group",
|
|
16443
|
+
"name_group",
|
|
16364
16444
|
"measurement",
|
|
16365
16445
|
"availability",
|
|
16366
16446
|
"date_range",
|
|
@@ -16604,7 +16684,7 @@ function createSchema(input, options = {}) {
|
|
|
16604
16684
|
if (hasId) continue;
|
|
16605
16685
|
const idStrategy = col.idType ?? globalIdType;
|
|
16606
16686
|
const idUid = generateUniversalIdentifier(
|
|
16607
|
-
`
|
|
16687
|
+
`bd:collection:${object.nameSingular}:field:id`
|
|
16608
16688
|
);
|
|
16609
16689
|
col.fields.unshift({
|
|
16610
16690
|
universalIdentifier: idUid,
|
|
@@ -16671,18 +16751,18 @@ function createSchema(input, options = {}) {
|
|
|
16671
16751
|
const sourceFkName = selfRelation ? `source${capitalizedSource}Id` : `${object.nameSingular}Id`;
|
|
16672
16752
|
const targetFkName = selfRelation ? `target${capitalizedSource}Id` : `${targetObj.nameSingular}Id`;
|
|
16673
16753
|
const junctionUid = generateUniversalIdentifier(
|
|
16674
|
-
`
|
|
16754
|
+
`bd:collection:${joinSingular}`
|
|
16675
16755
|
);
|
|
16676
16756
|
const sourceUid = generateUniversalIdentifier(
|
|
16677
|
-
`
|
|
16757
|
+
`bd:collection:${joinSingular}:field:${sourceFkName}`
|
|
16678
16758
|
);
|
|
16679
16759
|
const targetUid = generateUniversalIdentifier(
|
|
16680
|
-
`
|
|
16760
|
+
`bd:collection:${joinSingular}:field:${targetFkName}`
|
|
16681
16761
|
);
|
|
16682
16762
|
const junctionOnDelete = rel.meta.onDeleteAction !== void 0 ? DELETE_ACTION_TO_ON_DELETE[rel.meta.onDeleteAction] ?? "cascade" : "cascade";
|
|
16683
16763
|
const junctionIdType = object.idType ?? globalIdType;
|
|
16684
16764
|
const junctionIdUid = generateUniversalIdentifier(
|
|
16685
|
-
`
|
|
16765
|
+
`bd:collection:${joinSingular}:field:id`
|
|
16686
16766
|
);
|
|
16687
16767
|
const junctionFields = [
|
|
16688
16768
|
{
|
|
@@ -16726,7 +16806,7 @@ function createSchema(input, options = {}) {
|
|
|
16726
16806
|
junctionFields.push({
|
|
16727
16807
|
...addDef,
|
|
16728
16808
|
universalIdentifier: generateUniversalIdentifier(
|
|
16729
|
-
`
|
|
16809
|
+
`bd:collection:${joinSingular}:field:${addName}`
|
|
16730
16810
|
),
|
|
16731
16811
|
name: addName,
|
|
16732
16812
|
label: toLabel(addName),
|
|
@@ -17040,6 +17120,7 @@ function toPersistedFormElement(element) {
|
|
|
17040
17120
|
time_picker_timeslot: "time_picker",
|
|
17041
17121
|
time_picker_datetime: "time_picker",
|
|
17042
17122
|
address_group: "address",
|
|
17123
|
+
name_group: "name",
|
|
17043
17124
|
range: "slider",
|
|
17044
17125
|
formFileValue: "file_upload"
|
|
17045
17126
|
};
|
|
@@ -17061,7 +17142,7 @@ function generateCollectionFormCandidates(objects, options) {
|
|
|
17061
17142
|
if (!declaredElement) continue;
|
|
17062
17143
|
const type = toPersistedFormElement(declaredElement);
|
|
17063
17144
|
const id = generateUniversalIdentifier(
|
|
17064
|
-
`
|
|
17145
|
+
`bd:generated-form:${object.universalIdentifier}:field:${field.universalIdentifier}`
|
|
17065
17146
|
);
|
|
17066
17147
|
fieldMap[field.name] = id;
|
|
17067
17148
|
const relationTarget = field.relationTarget ? objectByIdentifier.get(field.relationTarget) : void 0;
|
|
@@ -17124,7 +17205,7 @@ function generateCollectionFormCandidates(objects, options) {
|
|
|
17124
17205
|
actions: [
|
|
17125
17206
|
{
|
|
17126
17207
|
id: generateUniversalIdentifier(
|
|
17127
|
-
`
|
|
17208
|
+
`bd:generated-form:${object.universalIdentifier}:action:create-record`
|
|
17128
17209
|
),
|
|
17129
17210
|
type: "create_records",
|
|
17130
17211
|
enabled: true,
|
|
@@ -17150,7 +17231,7 @@ function generateCollectionFormCandidates(objects, options) {
|
|
|
17150
17231
|
function recordIdentityField(object, purpose) {
|
|
17151
17232
|
return {
|
|
17152
17233
|
id: generateUniversalIdentifier(
|
|
17153
|
-
`
|
|
17234
|
+
`bd:generated-form:${object.universalIdentifier}:${purpose}:record`
|
|
17154
17235
|
),
|
|
17155
17236
|
label: object.labelSingular,
|
|
17156
17237
|
type: "collection_select",
|
|
@@ -17470,7 +17551,7 @@ function createFormSchemaOrchestrator(boundaries, options = {}) {
|
|
|
17470
17551
|
actions: [
|
|
17471
17552
|
{
|
|
17472
17553
|
id: generateUniversalIdentifier(
|
|
17473
|
-
`
|
|
17554
|
+
`bd:generated-form:${sourceKey}:action:create-records`
|
|
17474
17555
|
),
|
|
17475
17556
|
type: "create_records",
|
|
17476
17557
|
enabled: true,
|
|
@@ -19227,7 +19308,7 @@ function defineParallelPage(input) {
|
|
|
19227
19308
|
);
|
|
19228
19309
|
}
|
|
19229
19310
|
return Object.freeze({
|
|
19230
|
-
$kind: "
|
|
19311
|
+
$kind: "bd.parallelPage",
|
|
19231
19312
|
key: input.key,
|
|
19232
19313
|
routePattern: input.routePattern,
|
|
19233
19314
|
variables: Object.freeze(variables),
|
|
@@ -19237,7 +19318,7 @@ function defineParallelPage(input) {
|
|
|
19237
19318
|
});
|
|
19238
19319
|
}
|
|
19239
19320
|
function isParallelPageDefinition(value) {
|
|
19240
|
-
return !!value && typeof value === "object" && value.$kind === "
|
|
19321
|
+
return !!value && typeof value === "object" && value.$kind === "bd.parallelPage";
|
|
19241
19322
|
}
|
|
19242
19323
|
|
|
19243
19324
|
// src/payment-icons.ts
|
|
@@ -19351,7 +19432,7 @@ function paymentIconSvg(method, options = {}) {
|
|
|
19351
19432
|
}
|
|
19352
19433
|
|
|
19353
19434
|
// src/proxy.ts
|
|
19354
|
-
var
|
|
19435
|
+
var BrowserBdApiClient = class extends BdApiClient {
|
|
19355
19436
|
constructor(options) {
|
|
19356
19437
|
const init = {
|
|
19357
19438
|
baseUrl: options.proxyBaseUrl,
|
|
@@ -19364,8 +19445,8 @@ var BrowserBiabDevClient = class extends BiabDevClient {
|
|
|
19364
19445
|
}
|
|
19365
19446
|
};
|
|
19366
19447
|
function createBrowserCustomerPortalClient(options) {
|
|
19367
|
-
const inner = new
|
|
19368
|
-
return new
|
|
19448
|
+
const inner = new BrowserBdApiClient(options);
|
|
19449
|
+
return new BdCustomerPortalClient(inner, null);
|
|
19369
19450
|
}
|
|
19370
19451
|
function normalizeSiteOriginForProxy(raw) {
|
|
19371
19452
|
if (!raw) return void 0;
|
|
@@ -19381,7 +19462,7 @@ function normalizeSiteOriginForProxy(raw) {
|
|
|
19381
19462
|
}
|
|
19382
19463
|
function createCustomerPortalProxyHandler(options) {
|
|
19383
19464
|
const fetchImpl = options.fetch ?? fetch;
|
|
19384
|
-
const base = options.
|
|
19465
|
+
const base = options.bdBaseUrl.endsWith("/") ? options.bdBaseUrl : `${options.bdBaseUrl}/`;
|
|
19385
19466
|
const siteOrigin = normalizeSiteOriginForProxy(options.siteOrigin);
|
|
19386
19467
|
const orgPin = options.organizationId ?? options.workosOrganizationId;
|
|
19387
19468
|
if (!orgPin) {
|
|
@@ -19396,7 +19477,7 @@ function createCustomerPortalProxyHandler(options) {
|
|
|
19396
19477
|
const upstream = new URL(upstreamPath, base);
|
|
19397
19478
|
const upstreamHeaders = new Headers();
|
|
19398
19479
|
upstreamHeaders.set("Authorization", `Bearer ${options.apiKey}`);
|
|
19399
|
-
upstreamHeaders.set("X-
|
|
19480
|
+
upstreamHeaders.set("X-BD-Customer-Portal-Org", orgPin);
|
|
19400
19481
|
upstreamHeaders.set("Accept", "application/json");
|
|
19401
19482
|
if (siteOrigin) {
|
|
19402
19483
|
upstreamHeaders.set("Origin", siteOrigin);
|
|
@@ -19454,7 +19535,7 @@ function isReservedPagePath(input) {
|
|
|
19454
19535
|
}
|
|
19455
19536
|
function reservedPagePathErrorMessage(input) {
|
|
19456
19537
|
return [
|
|
19457
|
-
`"${input}" is reserved by the
|
|
19538
|
+
`"${input}" is reserved by the BD platform.`,
|
|
19458
19539
|
`Reserved paths: ${RESERVED_PAGE_PATHS.join(", ")}.`,
|
|
19459
19540
|
`These routes are served on every verified org hostname for quote / contract / invoice flows;`,
|
|
19460
19541
|
`shipping a marketing page at the same path would break customer-facing accept / sign / pay links.`,
|
|
@@ -19544,7 +19625,7 @@ async function jsonGet(state, pathWithQuery, tags) {
|
|
|
19544
19625
|
if (!res.ok) {
|
|
19545
19626
|
const text = await res.text().catch(() => "");
|
|
19546
19627
|
throw new Error(
|
|
19547
|
-
`
|
|
19628
|
+
`BD SDK ${res.status} ${res.statusText} on ${pathWithQuery}: ${text.slice(0, 200)}`
|
|
19548
19629
|
);
|
|
19549
19630
|
}
|
|
19550
19631
|
return await res.json();
|
|
@@ -19559,7 +19640,7 @@ function createGalleryResource(state) {
|
|
|
19559
19640
|
}
|
|
19560
19641
|
const qs = query.toString();
|
|
19561
19642
|
const path = `sites/${encodeURIComponent(state.siteId)}/gallery${qs ? `?${qs}` : ""}`;
|
|
19562
|
-
const tags = ["
|
|
19643
|
+
const tags = ["bd:gallery", `bd:site:${state.siteId}`];
|
|
19563
19644
|
const result = await jsonGet(
|
|
19564
19645
|
state,
|
|
19565
19646
|
path,
|
|
@@ -19583,14 +19664,14 @@ function createSchedulingResource(state) {
|
|
|
19583
19664
|
if (!res.ok) {
|
|
19584
19665
|
const text = await res.text().catch(() => "");
|
|
19585
19666
|
throw new Error(
|
|
19586
|
-
`
|
|
19667
|
+
`BD SDK ${res.status} ${res.statusText} on ${path}: ${text.slice(0, 200)}`
|
|
19587
19668
|
);
|
|
19588
19669
|
}
|
|
19589
19670
|
return await res.json();
|
|
19590
19671
|
}
|
|
19591
19672
|
return {
|
|
19592
19673
|
async listEventTypes() {
|
|
19593
|
-
const tags = ["
|
|
19674
|
+
const tags = ["bd:scheduling", `bd:site:${state.siteId}`];
|
|
19594
19675
|
const result = await jsonGet(
|
|
19595
19676
|
state,
|
|
19596
19677
|
`${sitePath}/event-types`,
|
|
@@ -19600,9 +19681,9 @@ function createSchedulingResource(state) {
|
|
|
19600
19681
|
},
|
|
19601
19682
|
async getEventType(slug) {
|
|
19602
19683
|
const tags = [
|
|
19603
|
-
"
|
|
19604
|
-
`
|
|
19605
|
-
`
|
|
19684
|
+
"bd:scheduling",
|
|
19685
|
+
`bd:scheduling:event:${slug}`,
|
|
19686
|
+
`bd:site:${state.siteId}`
|
|
19606
19687
|
];
|
|
19607
19688
|
return await jsonGet(
|
|
19608
19689
|
state,
|
|
@@ -19627,7 +19708,7 @@ function createSchedulingResource(state) {
|
|
|
19627
19708
|
if (!res.ok) {
|
|
19628
19709
|
const text = await res.text().catch(() => "");
|
|
19629
19710
|
throw new Error(
|
|
19630
|
-
`
|
|
19711
|
+
`BD SDK ${res.status} ${res.statusText} on ${path}: ${text.slice(0, 200)}`
|
|
19631
19712
|
);
|
|
19632
19713
|
}
|
|
19633
19714
|
const data = await res.json();
|
|
@@ -19659,7 +19740,7 @@ function createSchedulingResource(state) {
|
|
|
19659
19740
|
if (!res.ok) {
|
|
19660
19741
|
const text = await res.text().catch(() => "");
|
|
19661
19742
|
throw new Error(
|
|
19662
|
-
`
|
|
19743
|
+
`BD SDK ${res.status} ${res.statusText}: ${text.slice(0, 200)}`
|
|
19663
19744
|
);
|
|
19664
19745
|
}
|
|
19665
19746
|
return await res.json();
|
|
@@ -19881,7 +19962,7 @@ function validateFormSubmission(schema, data) {
|
|
|
19881
19962
|
fieldId: field.id,
|
|
19882
19963
|
label: field.label,
|
|
19883
19964
|
reason: "type",
|
|
19884
|
-
message: `${field.label} must be uploaded via
|
|
19965
|
+
message: `${field.label} must be uploaded via bd.forms.uploadFile().`
|
|
19885
19966
|
});
|
|
19886
19967
|
}
|
|
19887
19968
|
if (field.fileConfig?.maxFiles != null && Array.isArray(value) && value.length > field.fileConfig.maxFiles) {
|
|
@@ -19982,7 +20063,7 @@ function mapSubmitResponse(status, body) {
|
|
|
19982
20063
|
}
|
|
19983
20064
|
function mapSubmitThrow(err) {
|
|
19984
20065
|
if (err instanceof Error) {
|
|
19985
|
-
const m2 = err.message.match(/
|
|
20066
|
+
const m2 = err.message.match(/BD SDK (\d{3})/);
|
|
19986
20067
|
if (m2) return mapSubmitResponse(Number(m2[1]), null);
|
|
19987
20068
|
return {
|
|
19988
20069
|
ok: false,
|
|
@@ -20001,11 +20082,7 @@ function mapSubmitThrow(err) {
|
|
|
20001
20082
|
function createFormsResource(state) {
|
|
20002
20083
|
return {
|
|
20003
20084
|
async schema(slug) {
|
|
20004
|
-
const tags = [
|
|
20005
|
-
"biab:forms",
|
|
20006
|
-
`biab:forms:${slug}`,
|
|
20007
|
-
`biab:site:${state.siteId}`
|
|
20008
|
-
];
|
|
20085
|
+
const tags = ["bd:forms", `bd:forms:${slug}`, `bd:site:${state.siteId}`];
|
|
20009
20086
|
const path = `forms/${encodeURIComponent(slug)}`;
|
|
20010
20087
|
const result = await jsonGet(state, path, tags);
|
|
20011
20088
|
return result;
|
|
@@ -20055,7 +20132,7 @@ function createFormsResource(state) {
|
|
|
20055
20132
|
ok: false,
|
|
20056
20133
|
status: 0,
|
|
20057
20134
|
reason: "network_error",
|
|
20058
|
-
message: err instanceof Error ? `Could not reach
|
|
20135
|
+
message: err instanceof Error ? `Could not reach BD: ${err.message}` : "Could not reach BD."
|
|
20059
20136
|
};
|
|
20060
20137
|
}
|
|
20061
20138
|
const body = await res.json().catch(() => null);
|
|
@@ -20090,11 +20167,11 @@ function createFormsResource(state) {
|
|
|
20090
20167
|
const text = await presignRes.text().catch(() => "");
|
|
20091
20168
|
if (presignRes.status === 403 || presignRes.status === 402) {
|
|
20092
20169
|
throw new Error(
|
|
20093
|
-
`
|
|
20170
|
+
`BD SDK: file upload requires the "forms.file_uploads" entitlement on this org. ${text.slice(0, 200)}`
|
|
20094
20171
|
);
|
|
20095
20172
|
}
|
|
20096
20173
|
throw new Error(
|
|
20097
|
-
`
|
|
20174
|
+
`BD SDK ${presignRes.status} ${presignRes.statusText} on upload-url: ${text.slice(0, 200)}`
|
|
20098
20175
|
);
|
|
20099
20176
|
}
|
|
20100
20177
|
const presign = await presignRes.json();
|
|
@@ -20106,7 +20183,7 @@ function createFormsResource(state) {
|
|
|
20106
20183
|
if (!putRes.ok) {
|
|
20107
20184
|
const text = await putRes.text().catch(() => "");
|
|
20108
20185
|
throw new Error(
|
|
20109
|
-
`
|
|
20186
|
+
`BD SDK upload to R2 failed: ${putRes.status} ${putRes.statusText}: ${text.slice(0, 200)}`
|
|
20110
20187
|
);
|
|
20111
20188
|
}
|
|
20112
20189
|
return {
|
|
@@ -20130,7 +20207,7 @@ function createFormsResource(state) {
|
|
|
20130
20207
|
if (!res.ok) {
|
|
20131
20208
|
const text = await res.text().catch(() => "");
|
|
20132
20209
|
throw new Error(
|
|
20133
|
-
`
|
|
20210
|
+
`BD SDK ${res.status} ${res.statusText} on payment-intent: ${text.slice(0, 200)}`
|
|
20134
20211
|
);
|
|
20135
20212
|
}
|
|
20136
20213
|
return await res.json();
|
|
@@ -20150,19 +20227,19 @@ function createFormsResource(state) {
|
|
|
20150
20227
|
if (!res.ok) {
|
|
20151
20228
|
const text = await res.text().catch(() => "");
|
|
20152
20229
|
throw new Error(
|
|
20153
|
-
`
|
|
20230
|
+
`BD SDK ${res.status} ${res.statusText} on schedule-slots: ${text.slice(0, 200)}`
|
|
20154
20231
|
);
|
|
20155
20232
|
}
|
|
20156
20233
|
return await res.json();
|
|
20157
20234
|
}
|
|
20158
20235
|
};
|
|
20159
20236
|
}
|
|
20160
|
-
function
|
|
20237
|
+
function createBdClient(opts) {
|
|
20161
20238
|
if (!opts.apiKey) {
|
|
20162
|
-
throw new Error("
|
|
20239
|
+
throw new Error("createBdClient: apiKey is required.");
|
|
20163
20240
|
}
|
|
20164
20241
|
if (!opts.siteId) {
|
|
20165
|
-
throw new Error("
|
|
20242
|
+
throw new Error("createBdClient: siteId is required.");
|
|
20166
20243
|
}
|
|
20167
20244
|
const state = {
|
|
20168
20245
|
apiKey: opts.apiKey,
|
|
@@ -20172,7 +20249,7 @@ function createBiabClient(opts) {
|
|
|
20172
20249
|
fetch: opts.fetch ?? globalThis.fetch.bind(globalThis),
|
|
20173
20250
|
siteOrigin: opts.siteOrigin
|
|
20174
20251
|
};
|
|
20175
|
-
const transport = new
|
|
20252
|
+
const transport = new BdApiClient({
|
|
20176
20253
|
baseUrl: state.baseUrl,
|
|
20177
20254
|
apiKey: state.apiKey,
|
|
20178
20255
|
...opts.fetch ? { fetch: opts.fetch } : {},
|
|
@@ -20182,26 +20259,26 @@ function createBiabClient(opts) {
|
|
|
20182
20259
|
gallery: createGalleryResource(state),
|
|
20183
20260
|
scheduling: createSchedulingResource(state),
|
|
20184
20261
|
forms: createFormsResource(state),
|
|
20185
|
-
blog: new
|
|
20186
|
-
reviews: new
|
|
20187
|
-
storefront: new
|
|
20188
|
-
cart: new
|
|
20189
|
-
checkout: new
|
|
20190
|
-
coupons: new
|
|
20191
|
-
subscriptions: new
|
|
20192
|
-
shipping: new
|
|
20193
|
-
address: new
|
|
20262
|
+
blog: new BdBlogClient(transport),
|
|
20263
|
+
reviews: new BdReviewsClient(transport),
|
|
20264
|
+
storefront: new BdStorefrontClient(transport),
|
|
20265
|
+
cart: new BdCartClient(transport, state.siteId),
|
|
20266
|
+
checkout: new BdCheckoutClient(transport, state.siteId),
|
|
20267
|
+
coupons: new BdCouponsClient(transport),
|
|
20268
|
+
subscriptions: new BdSubscriptionsClient(transport),
|
|
20269
|
+
shipping: new BdShippingClient(transport, state.siteId),
|
|
20270
|
+
address: new BdAddressClient(transport),
|
|
20194
20271
|
// CustomerPortal needs an org id binding; when the consumer's API
|
|
20195
20272
|
// key already binds an org, pass `null` here (server resolves via
|
|
20196
20273
|
// the key). For multi-tenant proxies, override after construction.
|
|
20197
|
-
customerPortal: new
|
|
20198
|
-
notifications: new
|
|
20199
|
-
followers: new
|
|
20200
|
-
legal: new
|
|
20274
|
+
customerPortal: new BdCustomerPortalClient(transport, null),
|
|
20275
|
+
notifications: new BdNotificationsClient(transport, state.siteId),
|
|
20276
|
+
followers: new BdFollowersClient(transport, state.siteId),
|
|
20277
|
+
legal: new BdLegalClient(transport),
|
|
20201
20278
|
site: (siteId) => transport.site(siteId),
|
|
20202
|
-
marketing: new
|
|
20203
|
-
marketingPages: new
|
|
20204
|
-
parallelPages: new
|
|
20279
|
+
marketing: new BdMarketingClient(transport, state.siteId),
|
|
20280
|
+
marketingPages: new BdMarketingPagesClient(transport, state.siteId),
|
|
20281
|
+
parallelPages: new BdParallelPagesClient(transport, state.siteId)
|
|
20205
20282
|
};
|
|
20206
20283
|
}
|
|
20207
20284
|
|
|
@@ -20406,7 +20483,7 @@ function renderJsonLdNodes(nodes) {
|
|
|
20406
20483
|
function renderJsonLdToHtml(nodes) {
|
|
20407
20484
|
return renderJsonLdNodes(nodes).map(({ type, html }) => `<script type="${type}">${html}</script>`).join("\n");
|
|
20408
20485
|
}
|
|
20409
|
-
var
|
|
20486
|
+
var bdSchemas = {
|
|
20410
20487
|
localBusiness,
|
|
20411
20488
|
localBusinessLocations,
|
|
20412
20489
|
organization,
|
|
@@ -20562,35 +20639,35 @@ function resolveSocialProfiles(socials) {
|
|
|
20562
20639
|
}
|
|
20563
20640
|
// Annotate the CommonJS export names for ESM import in node:
|
|
20564
20641
|
0 && (module.exports = {
|
|
20565
|
-
|
|
20566
|
-
|
|
20567
|
-
|
|
20568
|
-
|
|
20569
|
-
|
|
20570
|
-
|
|
20571
|
-
|
|
20572
|
-
|
|
20573
|
-
|
|
20574
|
-
|
|
20575
|
-
|
|
20576
|
-
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
|
|
20580
|
-
|
|
20581
|
-
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20586
|
-
|
|
20587
|
-
|
|
20588
|
-
|
|
20589
|
-
|
|
20590
|
-
|
|
20591
|
-
|
|
20592
|
-
|
|
20593
|
-
|
|
20642
|
+
BdAccessRejectedError,
|
|
20643
|
+
BdActionsClient,
|
|
20644
|
+
BdAnalyticsClient,
|
|
20645
|
+
BdApiClient,
|
|
20646
|
+
BdApiError,
|
|
20647
|
+
BdAssetsClient,
|
|
20648
|
+
BdAttributionClient,
|
|
20649
|
+
BdAuthClient,
|
|
20650
|
+
BdBlogClient,
|
|
20651
|
+
BdCartClient,
|
|
20652
|
+
BdChatbotClient,
|
|
20653
|
+
BdCheckoutClient,
|
|
20654
|
+
BdCollectionsClient,
|
|
20655
|
+
BdCustomerPortalClient,
|
|
20656
|
+
BdDashboardClient,
|
|
20657
|
+
BdDataModelClient,
|
|
20658
|
+
BdEmailTemplatesClient,
|
|
20659
|
+
BdFeatureNotEntitledError,
|
|
20660
|
+
BdFollowersClient,
|
|
20661
|
+
BdHiringClient,
|
|
20662
|
+
BdMarketingClient,
|
|
20663
|
+
BdMarketingPagesClient,
|
|
20664
|
+
BdParallelPagesClient,
|
|
20665
|
+
BdPaymentLapsedError,
|
|
20666
|
+
BdReviewsClient,
|
|
20667
|
+
BdRowsClient,
|
|
20668
|
+
BdServiceSuspendedError,
|
|
20669
|
+
BdSiteClient,
|
|
20670
|
+
BdStorefrontClient,
|
|
20594
20671
|
DEFAULT_AUTH_BASE_PATH,
|
|
20595
20672
|
DEFAULT_AUTH_COOKIE_NAME,
|
|
20596
20673
|
Enums,
|
|
@@ -20608,7 +20685,7 @@ function resolveSocialProfiles(socials) {
|
|
|
20608
20685
|
article,
|
|
20609
20686
|
authIntrospectResponseSchema,
|
|
20610
20687
|
bd,
|
|
20611
|
-
|
|
20688
|
+
bdSchemas,
|
|
20612
20689
|
blogSessionInputSchema,
|
|
20613
20690
|
blogSessionResponseSchema,
|
|
20614
20691
|
breadcrumb,
|
|
@@ -20643,8 +20720,8 @@ function resolveSocialProfiles(socials) {
|
|
|
20643
20720
|
computeDataModelChecksum,
|
|
20644
20721
|
computeSiteMarketingSchemaChecksum,
|
|
20645
20722
|
createAuthHandler,
|
|
20646
|
-
|
|
20647
|
-
|
|
20723
|
+
createBdApiClient,
|
|
20724
|
+
createBdClient,
|
|
20648
20725
|
createBrowserCustomerPortalClient,
|
|
20649
20726
|
createCollectionInputSchema,
|
|
20650
20727
|
createCollectionResponseSchema,
|
|
@@ -20701,7 +20778,7 @@ function resolveSocialProfiles(socials) {
|
|
|
20701
20778
|
getPublishedMarketingSchemaResponseSchema,
|
|
20702
20779
|
getSiteMarketingPageResponseSchema,
|
|
20703
20780
|
getTenantSession,
|
|
20704
|
-
|
|
20781
|
+
isBdPlanGateBody,
|
|
20705
20782
|
isFieldType,
|
|
20706
20783
|
isFormFileValue,
|
|
20707
20784
|
isParallelPageDefinition,
|