@businessdash/sdk 0.9.60 → 0.9.70
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 +1012 -186
- package/assets/biab-sw.js +92 -0
- package/dist/account-core/index.d.ts +126 -0
- package/dist/account-core/index.d.ts.map +1 -0
- package/dist/account-core/index.js +191 -0
- package/dist/account-core/index.js.map +1 -0
- package/dist/account.d.ts +11 -0
- package/dist/account.d.ts.map +1 -0
- package/dist/account.js +11 -0
- package/dist/account.js.map +1 -0
- package/dist/auth-handler.d.ts +1 -1
- package/dist/auth-links.d.ts +33 -0
- package/dist/auth-links.d.ts.map +1 -0
- package/dist/auth-links.js +64 -0
- package/dist/auth-links.js.map +1 -0
- package/dist/blog-core/index.d.ts +112 -0
- package/dist/blog-core/index.d.ts.map +1 -0
- package/dist/blog-core/index.js +330 -0
- package/dist/blog-core/index.js.map +1 -0
- package/dist/blog.d.ts +11 -0
- package/dist/blog.d.ts.map +1 -0
- package/dist/blog.js +11 -0
- package/dist/blog.js.map +1 -0
- package/dist/chat-core/index.d.ts +97 -0
- package/dist/chat-core/index.d.ts.map +1 -0
- package/dist/chat-core/index.js +237 -0
- package/dist/chat-core/index.js.map +1 -0
- package/dist/chat.d.ts +11 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +11 -0
- package/dist/chat.js.map +1 -0
- package/dist/checkout-core/index.d.ts +65 -0
- package/dist/checkout-core/index.d.ts.map +1 -0
- package/dist/checkout-core/index.js +159 -0
- package/dist/checkout-core/index.js.map +1 -0
- package/dist/checkout.d.ts +10 -0
- package/dist/checkout.d.ts.map +1 -0
- package/dist/checkout.js +10 -0
- package/dist/checkout.js.map +1 -0
- package/dist/cli.js +133 -25
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +567 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +807 -1
- package/dist/client.js.map +1 -1
- package/dist/contracts.d.ts +3309 -761
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +541 -4
- package/dist/contracts.js.map +1 -1
- package/dist/data-model-schema.d.ts +1 -1
- package/dist/data-model-schema.d.ts.map +1 -1
- package/dist/element.d.ts +30 -0
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +56 -0
- package/dist/element.js.map +1 -1
- package/dist/embed-protocol.d.ts +86 -0
- package/dist/embed-protocol.d.ts.map +1 -0
- package/dist/embed-protocol.js +60 -0
- package/dist/embed-protocol.js.map +1 -0
- package/dist/framework-support.d.ts +122 -0
- package/dist/framework-support.d.ts.map +1 -0
- package/dist/framework-support.js +323 -0
- package/dist/framework-support.js.map +1 -0
- package/dist/index.cjs +1244 -5
- package/dist/legal-core/index.cjs +115 -0
- package/dist/legal-core/index.d.ts +160 -0
- package/dist/legal-core/index.d.ts.map +1 -0
- package/dist/legal-core/index.js +220 -0
- package/dist/legal-core/index.js.map +1 -0
- package/dist/marketing-core/index.d.ts +66 -0
- package/dist/marketing-core/index.d.ts.map +1 -0
- package/dist/marketing-core/index.js +154 -0
- package/dist/marketing-core/index.js.map +1 -0
- package/dist/marketing.d.ts +7 -0
- package/dist/marketing.d.ts.map +1 -0
- package/dist/marketing.js +7 -0
- package/dist/marketing.js.map +1 -0
- package/dist/mcp-adapters/index.d.ts +135 -0
- package/dist/mcp-adapters/index.d.ts.map +1 -0
- package/dist/mcp-adapters/index.js +187 -0
- package/dist/mcp-adapters/index.js.map +1 -0
- package/dist/mcp-adapters.d.ts +7 -0
- package/dist/mcp-adapters.d.ts.map +1 -0
- package/dist/mcp-adapters.js +7 -0
- package/dist/mcp-adapters.js.map +1 -0
- package/dist/model3d-core/index.cjs +95 -0
- package/dist/model3d-core/index.d.ts +167 -0
- package/dist/model3d-core/index.d.ts.map +1 -0
- package/dist/model3d-core/index.js +158 -0
- package/dist/model3d-core/index.js.map +1 -0
- package/dist/notifications-core/index.cjs +315 -0
- package/dist/notifications-core/index.d.ts +229 -0
- package/dist/notifications-core/index.d.ts.map +1 -0
- package/dist/notifications-core/index.js +445 -0
- package/dist/notifications-core/index.js.map +1 -0
- package/dist/portal-core/index.d.ts +451 -0
- package/dist/portal-core/index.d.ts.map +1 -0
- package/dist/portal-core/index.js +819 -0
- package/dist/portal-core/index.js.map +1 -0
- package/dist/portal.d.ts +7 -0
- package/dist/portal.d.ts.map +1 -0
- package/dist/portal.js +7 -0
- package/dist/portal.js.map +1 -0
- package/dist/push-core/index.cjs +171 -0
- package/dist/push-core/index.d.ts +149 -0
- package/dist/push-core/index.d.ts.map +1 -0
- package/dist/push-core/index.js +231 -0
- package/dist/push-core/index.js.map +1 -0
- package/dist/react-marketing.d.ts +1 -17
- package/dist/react-marketing.d.ts.map +1 -1
- package/dist/react-marketing.js +4 -0
- package/dist/react-marketing.js.map +1 -1
- package/dist/react.d.ts +294 -101
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +302 -246
- package/dist/react.js.map +1 -1
- package/dist/seed-core/index.d.ts +354 -0
- package/dist/seed-core/index.d.ts.map +1 -0
- package/dist/seed-core/index.js +420 -0
- package/dist/seed-core/index.js.map +1 -0
- package/dist/seed.d.ts +7 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +7 -0
- package/dist/seed.js.map +1 -0
- package/dist/seo-core/blog.d.ts +94 -0
- package/dist/seo-core/blog.d.ts.map +1 -0
- package/dist/seo-core/blog.js +149 -0
- package/dist/seo-core/blog.js.map +1 -0
- package/dist/seo-core/commerce.d.ts +64 -0
- package/dist/seo-core/commerce.d.ts.map +1 -0
- package/dist/seo-core/commerce.js +87 -0
- package/dist/seo-core/commerce.js.map +1 -0
- package/dist/seo-core/index.cjs +751 -0
- package/dist/seo-core/index.d.ts +226 -0
- package/dist/seo-core/index.d.ts.map +1 -0
- package/dist/seo-core/index.js +455 -0
- package/dist/seo-core/index.js.map +1 -0
- package/dist/seo-core/local.d.ts +181 -0
- package/dist/seo-core/local.d.ts.map +1 -0
- package/dist/seo-core/local.js +193 -0
- package/dist/seo-core/local.js.map +1 -0
- package/dist/sitemap-core/index.cjs +167 -0
- package/dist/sitemap-core/index.d.ts +155 -0
- package/dist/sitemap-core/index.d.ts.map +1 -0
- package/dist/sitemap-core/index.js +195 -0
- package/dist/sitemap-core/index.js.map +1 -0
- package/dist/social-core/index.d.ts +74 -0
- package/dist/social-core/index.d.ts.map +1 -0
- package/dist/social-core/index.js +72 -0
- package/dist/social-core/index.js.map +1 -0
- package/dist/social.d.ts +7 -0
- package/dist/social.d.ts.map +1 -0
- package/dist/social.js +7 -0
- package/dist/social.js.map +1 -0
- package/dist/solid-compat.d.ts +204 -0
- package/dist/solid-compat.d.ts.map +1 -0
- package/dist/solid-compat.js +221 -0
- package/dist/solid-compat.js.map +1 -0
- package/dist/store-core/index.d.ts +141 -0
- package/dist/store-core/index.d.ts.map +1 -0
- package/dist/store-core/index.js +277 -0
- package/dist/store-core/index.js.map +1 -0
- package/dist/store.d.ts +12 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +12 -0
- package/dist/store.js.map +1 -0
- package/dist/vanilla.d.ts +111 -0
- package/dist/vanilla.d.ts.map +1 -1
- package/dist/vanilla.js +206 -0
- package/dist/vanilla.js.map +1 -1
- package/dist/verify-core/index.d.ts +98 -0
- package/dist/verify-core/index.d.ts.map +1 -0
- package/dist/verify-core/index.js +186 -0
- package/dist/verify-core/index.js.map +1 -0
- package/dist/verify.d.ts +8 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +8 -0
- package/dist/verify.js.map +1 -0
- package/openapi.json +4316 -1313
- package/package.json +121 -9
- package/src/account-core/index.ts +309 -0
- package/src/account.ts +11 -0
- package/src/angular/headless.ts +519 -0
- package/src/angular/index.ts +3 -0
- package/src/auth-links.ts +76 -0
- package/src/blog-core/index.ts +423 -0
- package/src/blog.ts +11 -0
- package/src/chat-core/index.ts +335 -0
- package/src/chat.ts +11 -0
- package/src/checkout-core/index.ts +225 -0
- package/src/checkout.ts +10 -0
- package/src/cli.ts +184 -28
- package/src/client.ts +998 -0
- package/src/contracts.ts +730 -11
- package/src/data-model-schema.ts +1 -1
- package/src/element.ts +102 -0
- package/src/embed-protocol.ts +100 -0
- package/src/framework-support.ts +440 -0
- package/src/legal-core/index.ts +276 -0
- package/src/marketing-core/index.ts +209 -0
- package/src/marketing.ts +7 -0
- package/src/mcp-adapters/index.ts +264 -0
- package/src/mcp-adapters.ts +7 -0
- package/src/model3d-core/index.ts +248 -0
- package/src/notifications-core/index.ts +650 -0
- package/src/portal-core/index.ts +1564 -0
- package/src/portal.ts +7 -0
- package/src/push-core/index.ts +335 -0
- package/src/qwik.tsx +602 -2
- package/src/react-marketing.tsx +5 -0
- package/src/react.tsx +434 -319
- package/src/seed-core/index.ts +735 -0
- package/src/seed.ts +7 -0
- package/src/seo-core/blog.ts +216 -0
- package/src/seo-core/commerce.ts +138 -0
- package/src/seo-core/index.ts +605 -0
- package/src/seo-core/local.ts +333 -0
- package/src/sitemap-core/index.ts +296 -0
- package/src/social-core/index.ts +103 -0
- package/src/social.ts +7 -0
- package/src/solid-compat.tsx +347 -0
- package/src/solid-surfaces.tsx +1311 -0
- package/src/solid.tsx +82 -60
- package/src/store-core/index.ts +426 -0
- package/src/store.ts +12 -0
- package/src/svelte/SocialLinks.svelte +84 -0
- package/src/svelte/headless.ts +435 -0
- package/src/svelte/index.ts +9 -0
- package/src/vanilla.ts +367 -0
- package/src/verify-core/index.ts +288 -0
- package/src/verify.ts +8 -0
- package/src/vue/headless.ts +527 -0
- package/src/vue/index.ts +3 -0
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, couponValidateInputSchema, couponValidateResponseSchema, createCollectionInputSchema, createCollectionResponseSchema, createEmailTemplateInputSchema, createEmailTemplateResponseSchema, createEmailTemplateVersionInputSchema, createEmailTemplateVersionResponseSchema, customerContactCompanyInputSchema, customerContactCompanyResponseSchema, customerContractDetailSchema, customerContractSignResponseSchema, customerDownloadsResponseSchema, customerInvoiceDetailSchema, customerInvoicePayInputSchema, customerInvoicePayResponseSchema, customerInvoicePdfSchema, customerJobActivityResponseSchema, customerJobCommentPostInputSchema, customerJobCommentSchema, customerJobCommentsListResponseSchema, customerJobDetailSchema, customerJobEtaResponseSchema, customerNotificationPreferencesResponseSchema, customerNotificationPreferencesUpdateInputSchema, customerNotificationPreferencesUpdateResponseSchema, customerOrderDetailSchema, customerOrderListResponseSchema, customerPaymentHistoryResponseSchema, customerPortalContextResponseSchema, customerPortalOtherOrgsResponseSchema, customerPortalProfileSchema, customerPortalUpdateProfileInputSchema, customerPortalUpdateProfileResponseSchema, customerQuoteActionResponseSchema, customerQuoteDetailSchema, customerReferralHistoryResponseSchema, customerReferralPayoutsResponseSchema, customerReferralStatsSchema, customerReturnRequestCreatedSchema, customerReturnRequestInputSchema, customerReviewListResponseSchema, customerReviewSubmitInputSchema, customerReviewSubmitResponseSchema, customerShipmentTrackingSchema, customerWorkBundleSchema, dashboardSessionResponseSchema, executeActionInputSchema, executeActionResponseSchema, followerEditInputSchema, followerEditResponseSchema, followerJoinInputSchema, followerJoinResponseSchema, followerLeaveInputSchema, followerLeaveResponseSchema, followerMeInputSchema, followerMeResponseSchema, getCollectionResponseSchema, getEmailTemplateResponseSchema, getMarketingLocalesResponseSchema, getMarketingPageBundleResponseSchema, getPublishedMarketingSchemaResponseSchema, getSiteMarketingPageResponseSchema, jobCategoryListResponseSchema, jobPostingListResponseSchema, jobPostingSchema, listCollectionsResponseSchema, listDataModelRecordsInputSchema, listDataModelRecordsResponseSchema, listEmailTemplatesInputSchema, listEmailTemplatesResponseSchema, listRowsInputSchema, listRowsResponseSchema, listSiteMarketingPagesResponseSchema, notificationPreferencesResponseSchema, notificationPreferencesUpdateInputSchema, pageViewsInputSchema, pageViewsResponseSchema, publishMarketingSectionsInputSchema, publishMarketingSectionsResponseSchema, queryRowsInputSchema, queryRowsResponseSchema, reviewWallListResponseSchema, shippingRatesInputSchema, shippingRatesResponseSchema, shippingSettingsResponseSchema, shippingTrackResponseSchema, siteAssetInputSchema, siteBrandingSchema, startVerificationInputSchema, startVerificationResponseSchema, storefrontAddonsResponseSchema, storefrontCategoriesResponseSchema, storefrontListProductsResponseSchema, storefrontProductDetailSchema, storefrontProductReviewsResponseSchema, storefrontProductsWithMetaResponseSchema, storefrontRelatedProductsResponseSchema, storefrontSessionInputSchema, storefrontSessionResponseSchema, subscriptionCheckoutInputSchema, subscriptionCheckoutResponseSchema, subscriptionOfferingSchema, subscriptionOfferingsListResponseSchema, tenantAuthExchangeInputSchema, tenantAuthExchangeResponseSchema, tenantAuthMeResponseSchema, tenantAuthPasswordResetInputSchema, tenantAuthPasswordResetResponseSchema, tenantAuthSignOutResponseSchema, tenantAuthStartInputSchema, tenantAuthStartResponseSchema, uploadSiteAssetResponseSchema, upsertDraftMarketingSchemaInputSchema, upsertDraftMarketingSchemaResponseSchema, upsertRowInputSchema, upsertRowResponseSchema, } from "./contracts.js";
|
|
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, 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
3
|
import { accessRejectionFromBody, BiabApiError, isBiabPlanGateBody, } from "./errors.js";
|
|
4
4
|
function buildUrl(baseUrl, path, query) {
|
|
5
5
|
/**
|
|
@@ -122,6 +122,10 @@ export class BiabDevClient {
|
|
|
122
122
|
get shipping() {
|
|
123
123
|
return new BiabDevShippingClient(this);
|
|
124
124
|
}
|
|
125
|
+
/** Customer-portal invitations — currently resend. */
|
|
126
|
+
get customerInvites() {
|
|
127
|
+
return new BiabDevCustomerInvitesClient(this);
|
|
128
|
+
}
|
|
125
129
|
get notifications() {
|
|
126
130
|
return new BiabDevNotificationsClient(this);
|
|
127
131
|
}
|
|
@@ -138,6 +142,16 @@ export class BiabDevClient {
|
|
|
138
142
|
get hiring() {
|
|
139
143
|
return new BiabDevHiringClient(this);
|
|
140
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* The org's published legal pages — privacy, terms, refund policy, whatever
|
|
147
|
+
* they authored in the dashboard.
|
|
148
|
+
*
|
|
149
|
+
* Pair with `@businessdash/sdk/legal` to render them without writing a page
|
|
150
|
+
* per document.
|
|
151
|
+
*/
|
|
152
|
+
get legal() {
|
|
153
|
+
return new BiabDevLegalClient(this);
|
|
154
|
+
}
|
|
141
155
|
get chatbot() {
|
|
142
156
|
return new BiabDevChatbotClient(this);
|
|
143
157
|
}
|
|
@@ -240,10 +254,19 @@ export class BiabDevSiteClient {
|
|
|
240
254
|
*/
|
|
241
255
|
marketing;
|
|
242
256
|
parallelPages;
|
|
257
|
+
/**
|
|
258
|
+
* Booking and conference calls.
|
|
259
|
+
*
|
|
260
|
+
* Previously reachable only through `sdk.ts`'s separate scheduling
|
|
261
|
+
* resource, which is why the OpenAPI generator — which reads this file —
|
|
262
|
+
* never saw it, and why no non-JS starter had scheduling at all.
|
|
263
|
+
*/
|
|
264
|
+
scheduling;
|
|
243
265
|
constructor(client, siteId) {
|
|
244
266
|
this.client = client;
|
|
245
267
|
this.siteId = siteId;
|
|
246
268
|
this.collections = new BiabDevCollectionsClient(client, siteId);
|
|
269
|
+
this.scheduling = new BiabDevSchedulingClient(client, siteId);
|
|
247
270
|
this.rows = new BiabDevRowsClient(client, siteId);
|
|
248
271
|
this.dataModel = new BiabDevDataModelClient(client, siteId);
|
|
249
272
|
this.analytics = new BiabDevAnalyticsClient(client, siteId);
|
|
@@ -266,6 +289,25 @@ export class BiabDevSiteClient {
|
|
|
266
289
|
* <img src={b.logoUrl ?? b.orgIcon ?? ""} alt={b.orgName ?? ""} />
|
|
267
290
|
* ```
|
|
268
291
|
*/
|
|
292
|
+
/**
|
|
293
|
+
* Every URL the PLATFORM owns the shape of, as JSON.
|
|
294
|
+
*
|
|
295
|
+
* Published site-builder pages, published legal documents, and every
|
|
296
|
+
* materialised programmatic-page URL. Blog posts and products are not here
|
|
297
|
+
* — the platform does not know where your site renders them. Merge those in
|
|
298
|
+
* with `@businessdash/sdk/sitemap`, which handles the whole job.
|
|
299
|
+
*
|
|
300
|
+
* Paths are relative, so you join them against your own origin rather than
|
|
301
|
+
* the org's primary verified domain.
|
|
302
|
+
*/
|
|
303
|
+
async sitemapEntries() {
|
|
304
|
+
return this.client.request({
|
|
305
|
+
path: `sites/${encodeURIComponent(this.siteId)}/sitemap-entries`,
|
|
306
|
+
responseSchema: z.object({
|
|
307
|
+
entries: z.array(z.object({ loc: z.string(), lastmod: z.string().optional() })),
|
|
308
|
+
}),
|
|
309
|
+
});
|
|
310
|
+
}
|
|
269
311
|
async branding() {
|
|
270
312
|
return this.client.request({
|
|
271
313
|
path: `sites/${encodeURIComponent(this.siteId)}/branding`,
|
|
@@ -1054,6 +1096,42 @@ export class BiabDevStorefrontClient {
|
|
|
1054
1096
|
responseSchema: storefrontSessionResponseSchema,
|
|
1055
1097
|
});
|
|
1056
1098
|
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Push your catalog into YOUR OWN Stripe account.
|
|
1101
|
+
*
|
|
1102
|
+
* Products and their variant combinations become Stripe Products and
|
|
1103
|
+
* Prices on the Stripe account connected to your workspace, so you can
|
|
1104
|
+
* manage the catalog here and let Stripe be the system of record for
|
|
1105
|
+
* money. Safe to re-run: an unchanged product is left alone, and a new
|
|
1106
|
+
* Price is minted only when the amount actually changed (Stripe Prices
|
|
1107
|
+
* are immutable on amount).
|
|
1108
|
+
*
|
|
1109
|
+
* Requires a SECRET key holding `storefront:write` — never a publishable
|
|
1110
|
+
* token, because this spends against Stripe on your behalf.
|
|
1111
|
+
*
|
|
1112
|
+
* Pass `productId` to sync one product. Omit it to sync everything not yet
|
|
1113
|
+
* pushed, in bounded batches: check `remaining` and call again until it
|
|
1114
|
+
* reaches 0.
|
|
1115
|
+
*
|
|
1116
|
+
* ```ts
|
|
1117
|
+
* let remaining = 1;
|
|
1118
|
+
* while (remaining > 0) {
|
|
1119
|
+
* const res = await biab.storefront.syncToStripe();
|
|
1120
|
+
* remaining = res.remaining;
|
|
1121
|
+
* }
|
|
1122
|
+
* ```
|
|
1123
|
+
*
|
|
1124
|
+
* Per-product failures are returned in `failed` rather than throwing, so
|
|
1125
|
+
* one bad product doesn't abandon the batch.
|
|
1126
|
+
*/
|
|
1127
|
+
async syncToStripe(input) {
|
|
1128
|
+
return this.client.request({
|
|
1129
|
+
method: "POST",
|
|
1130
|
+
path: "storefront/products/sync-to-stripe",
|
|
1131
|
+
body: input?.productId ? { productId: input.productId } : {},
|
|
1132
|
+
responseSchema: storefrontSyncToStripeResponseSchema,
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1057
1135
|
/**
|
|
1058
1136
|
* Paginated list of live products for the calling org's storefront.
|
|
1059
1137
|
* Cursor is an opaque integer offset — pass back the response's
|
|
@@ -1117,6 +1195,38 @@ export class BiabDevStorefrontClient {
|
|
|
1117
1195
|
* via `BiabApiError` if the product isn't live or doesn't belong
|
|
1118
1196
|
* to the org bound to the API key.
|
|
1119
1197
|
*/
|
|
1198
|
+
/**
|
|
1199
|
+
* The CAD file for a product — STEP, IGES, or a native part file.
|
|
1200
|
+
*
|
|
1201
|
+
* ## Call this from YOUR server, then proxy it
|
|
1202
|
+
*
|
|
1203
|
+
* The API key is a server secret, so a browser cannot reach this directly.
|
|
1204
|
+
* Expose your own route (`/api/products/:id/cad`), call this behind it, and
|
|
1205
|
+
* redirect the visitor to the URL it returns.
|
|
1206
|
+
*
|
|
1207
|
+
* The platform withholds the raw URL from every product payload on purpose:
|
|
1208
|
+
* CAD files are the largest thing it serves and are the org's intellectual
|
|
1209
|
+
* property, so a catalog of naked URLs is a design library published to
|
|
1210
|
+
* anyone willing to write a loop. This endpoint requires a `biab_cad` cookie
|
|
1211
|
+
* on the incoming request, rate-limits per IP, and re-checks the
|
|
1212
|
+
* `ecommerce.product_3d` entitlement before answering.
|
|
1213
|
+
*
|
|
1214
|
+
* `cacheSeconds` is what to put on your own response — CAD at a content URL
|
|
1215
|
+
* does not change, so caching hard is where the bandwidth saving comes from.
|
|
1216
|
+
*
|
|
1217
|
+
* Rejects 404 when the product is a draft, has no CAD file, or the org lacks
|
|
1218
|
+
* the add-on. Those are deliberately one answer.
|
|
1219
|
+
*/
|
|
1220
|
+
async getCadDownload(productId) {
|
|
1221
|
+
return this.client.request({
|
|
1222
|
+
path: `storefront/products/${encodeURIComponent(productId)}/cad`,
|
|
1223
|
+
responseSchema: z.object({
|
|
1224
|
+
url: z.string(),
|
|
1225
|
+
fileName: z.string().nullable(),
|
|
1226
|
+
cacheSeconds: z.number(),
|
|
1227
|
+
}),
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1120
1230
|
async getProduct(productId) {
|
|
1121
1231
|
return this.client.request({
|
|
1122
1232
|
path: `storefront/products/${encodeURIComponent(productId)}`,
|
|
@@ -1509,6 +1619,47 @@ export class BiabDevCouponsClient {
|
|
|
1509
1619
|
* else toast.error(result.message);
|
|
1510
1620
|
* ```
|
|
1511
1621
|
*/
|
|
1622
|
+
/**
|
|
1623
|
+
* Create a coupon and make it live in YOUR OWN Stripe account in one call —
|
|
1624
|
+
* a Stripe Coupon plus a Promotion Code, so the same string works on your
|
|
1625
|
+
* storefront and on Stripe-hosted Checkout.
|
|
1626
|
+
*
|
|
1627
|
+
* Creation and the Stripe sync are one operation deliberately: a coupon
|
|
1628
|
+
* that exists locally but not in Stripe is the failure worth designing out,
|
|
1629
|
+
* where a customer types a code your storefront accepts and Stripe rejects.
|
|
1630
|
+
* If the sync fails the coupon is still created and `stripeSynced` comes
|
|
1631
|
+
* back `false` with the reason, rather than pretending it is live.
|
|
1632
|
+
*
|
|
1633
|
+
* Requires a SECRET key holding `storefront:write`.
|
|
1634
|
+
*
|
|
1635
|
+
* ```ts
|
|
1636
|
+
* const { coupon, stripeSynced } = await biab.coupons.create({
|
|
1637
|
+
* code: 'WELCOME10',
|
|
1638
|
+
* discountType: 'percent',
|
|
1639
|
+
* value: 10,
|
|
1640
|
+
* })
|
|
1641
|
+
* ```
|
|
1642
|
+
*
|
|
1643
|
+
* Buy-X-get-Y and bundle-gift coupons aren't available here — Stripe has no
|
|
1644
|
+
* native BXGY, so those run through our own cart math and need the offer
|
|
1645
|
+
* rows the dashboard collects.
|
|
1646
|
+
*/
|
|
1647
|
+
async create(input) {
|
|
1648
|
+
const body = couponCreateInputSchema.parse(input);
|
|
1649
|
+
return this.client.request({
|
|
1650
|
+
method: "POST",
|
|
1651
|
+
path: "coupons",
|
|
1652
|
+
body,
|
|
1653
|
+
responseSchema: couponCreateResponseSchema,
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
/** Every coupon on the workspace, newest first. Requires `storefront:write`. */
|
|
1657
|
+
async list() {
|
|
1658
|
+
return this.client.request({
|
|
1659
|
+
path: "coupons",
|
|
1660
|
+
responseSchema: couponListResponseSchema,
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1512
1663
|
async validate(code) {
|
|
1513
1664
|
const body = couponValidateInputSchema.parse({ code });
|
|
1514
1665
|
return this.client.request({
|
|
@@ -1944,6 +2095,51 @@ export class BiabDevHiringClient {
|
|
|
1944
2095
|
});
|
|
1945
2096
|
}
|
|
1946
2097
|
}
|
|
2098
|
+
/**
|
|
2099
|
+
* The org's published legal pages.
|
|
2100
|
+
*
|
|
2101
|
+
* Everything here is content the org deliberately put on the public internet;
|
|
2102
|
+
* drafts are filtered server-side and unreachable. Requires `legal:read`, which
|
|
2103
|
+
* is publishable — a browser token is the expected caller.
|
|
2104
|
+
*
|
|
2105
|
+
* @example
|
|
2106
|
+
* ```ts
|
|
2107
|
+
* const { items, presentation } = await client.legal.list();
|
|
2108
|
+
* const privacy = await client.legal.get("privacy");
|
|
2109
|
+
* ```
|
|
2110
|
+
*/
|
|
2111
|
+
export class BiabDevLegalClient {
|
|
2112
|
+
client;
|
|
2113
|
+
constructor(client) {
|
|
2114
|
+
this.client = client;
|
|
2115
|
+
}
|
|
2116
|
+
/**
|
|
2117
|
+
* Every published document, plus the header/footer presentation.
|
|
2118
|
+
*
|
|
2119
|
+
* Both in one response because the common use — a footer link list — needs
|
|
2120
|
+
* the titles and the presentation together, and a second round trip for the
|
|
2121
|
+
* latter is one a site either makes on every page or skips entirely.
|
|
2122
|
+
*/
|
|
2123
|
+
async list() {
|
|
2124
|
+
return this.client.request({
|
|
2125
|
+
path: "legal",
|
|
2126
|
+
responseSchema: legalListResponseSchema,
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
2130
|
+
* One document by slug, body included.
|
|
2131
|
+
*
|
|
2132
|
+
* Rejects with a 404 when the slug is unpublished or absent — the two are
|
|
2133
|
+
* deliberately indistinguishable, since "exists but hidden" would leak that
|
|
2134
|
+
* an org is drafting a policy and is not something a caller can act on.
|
|
2135
|
+
*/
|
|
2136
|
+
async get(slug) {
|
|
2137
|
+
return this.client.request({
|
|
2138
|
+
path: `legal/${encodeURIComponent(slug)}`,
|
|
2139
|
+
responseSchema: legalDocumentSchema,
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
1947
2143
|
export class BiabDevChatbotClient {
|
|
1948
2144
|
client;
|
|
1949
2145
|
constructor(client) {
|
|
@@ -2541,6 +2737,135 @@ export class BiabDevCustomerPortalClient {
|
|
|
2541
2737
|
headers: this.headers(),
|
|
2542
2738
|
});
|
|
2543
2739
|
}
|
|
2740
|
+
/**
|
|
2741
|
+
* The return requests on one order, newest first.
|
|
2742
|
+
*
|
|
2743
|
+
* `resolutionNote` carries staff's answer — when a return is denied that IS
|
|
2744
|
+
* the answer, and hiding it just moves the question to email.
|
|
2745
|
+
*/
|
|
2746
|
+
async listReturnRequests(orderId) {
|
|
2747
|
+
return this.client.request({
|
|
2748
|
+
path: `customer-portal/orders/${encodeURIComponent(orderId)}/return-request`,
|
|
2749
|
+
responseSchema: customerReturnRequestListResponseSchema,
|
|
2750
|
+
headers: this.headers(),
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
/**
|
|
2754
|
+
* The customer's message thread with the org's staff, newest first.
|
|
2755
|
+
*
|
|
2756
|
+
* Automated rows — the review-ask and similar — are excluded server-side, so
|
|
2757
|
+
* this is only what a person wrote.
|
|
2758
|
+
*/
|
|
2759
|
+
async listMessages(opts) {
|
|
2760
|
+
const params = new URLSearchParams();
|
|
2761
|
+
if (typeof opts?.limit === "number")
|
|
2762
|
+
params.set("limit", String(opts.limit));
|
|
2763
|
+
if (opts?.jobId)
|
|
2764
|
+
params.set("jobId", opts.jobId);
|
|
2765
|
+
const qs = params.toString();
|
|
2766
|
+
return this.client.request({
|
|
2767
|
+
path: `customer-portal/messages${qs ? `?${qs}` : ""}`,
|
|
2768
|
+
responseSchema: customerPortalMessageListResponseSchema,
|
|
2769
|
+
headers: this.headers(),
|
|
2770
|
+
});
|
|
2771
|
+
}
|
|
2772
|
+
/** Send a message to the org's staff. Lands in the CRM timeline. */
|
|
2773
|
+
async postMessage(input) {
|
|
2774
|
+
return this.client.request({
|
|
2775
|
+
path: "customer-portal/messages",
|
|
2776
|
+
method: "POST",
|
|
2777
|
+
body: input,
|
|
2778
|
+
responseSchema: customerPortalMessageSchema,
|
|
2779
|
+
headers: this.headers(),
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
/**
|
|
2783
|
+
* Mark the staff messages read up to now.
|
|
2784
|
+
*
|
|
2785
|
+
* One-way: it never clears a stamp. A portal that could un-read a message
|
|
2786
|
+
* would let a customer hide from staff that they had seen something.
|
|
2787
|
+
*/
|
|
2788
|
+
async markMessagesRead() {
|
|
2789
|
+
return this.client.request({
|
|
2790
|
+
path: "customer-portal/messages",
|
|
2791
|
+
method: "PATCH",
|
|
2792
|
+
responseSchema: customerPortalMessagesMarkReadResponseSchema,
|
|
2793
|
+
headers: this.headers(),
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
/**
|
|
2797
|
+
* The customer's invoices, newest first.
|
|
2798
|
+
*
|
|
2799
|
+
* `unpaid: true` filters on the computed BALANCE rather than on the status
|
|
2800
|
+
* string, because a partially-paid invoice still owes money whatever it is
|
|
2801
|
+
* called. This is the call behind "show me everything I owe" — which had no
|
|
2802
|
+
* endpoint at all before 0.9.61.
|
|
2803
|
+
*/
|
|
2804
|
+
async listInvoices(opts) {
|
|
2805
|
+
const params = new URLSearchParams();
|
|
2806
|
+
if (typeof opts?.limit === "number")
|
|
2807
|
+
params.set("limit", String(opts.limit));
|
|
2808
|
+
if (opts?.status)
|
|
2809
|
+
params.set("status", opts.status);
|
|
2810
|
+
if (opts?.unpaid)
|
|
2811
|
+
params.set("unpaid", "1");
|
|
2812
|
+
const qs = params.toString();
|
|
2813
|
+
return this.client.request({
|
|
2814
|
+
path: `customer-portal/invoices${qs ? `?${qs}` : ""}`,
|
|
2815
|
+
responseSchema: customerInvoiceListResponseSchema,
|
|
2816
|
+
headers: this.headers(),
|
|
2817
|
+
});
|
|
2818
|
+
}
|
|
2819
|
+
/** The customer's quotes. `status: "sent"` is the set still awaiting them. */
|
|
2820
|
+
async listQuotes(opts) {
|
|
2821
|
+
const params = new URLSearchParams();
|
|
2822
|
+
if (typeof opts?.limit === "number")
|
|
2823
|
+
params.set("limit", String(opts.limit));
|
|
2824
|
+
if (opts?.status)
|
|
2825
|
+
params.set("status", opts.status);
|
|
2826
|
+
const qs = params.toString();
|
|
2827
|
+
return this.client.request({
|
|
2828
|
+
path: `customer-portal/quotes${qs ? `?${qs}` : ""}`,
|
|
2829
|
+
responseSchema: customerQuoteListResponseSchema,
|
|
2830
|
+
headers: this.headers(),
|
|
2831
|
+
});
|
|
2832
|
+
}
|
|
2833
|
+
/** The customer's contracts. `status: "sent"` still awaits a signature. */
|
|
2834
|
+
async listContracts(opts) {
|
|
2835
|
+
const params = new URLSearchParams();
|
|
2836
|
+
if (typeof opts?.limit === "number")
|
|
2837
|
+
params.set("limit", String(opts.limit));
|
|
2838
|
+
if (opts?.status)
|
|
2839
|
+
params.set("status", opts.status);
|
|
2840
|
+
const qs = params.toString();
|
|
2841
|
+
return this.client.request({
|
|
2842
|
+
path: `customer-portal/contracts${qs ? `?${qs}` : ""}`,
|
|
2843
|
+
responseSchema: customerContractListResponseSchema,
|
|
2844
|
+
headers: this.headers(),
|
|
2845
|
+
});
|
|
2846
|
+
}
|
|
2847
|
+
/**
|
|
2848
|
+
* Every shipment across the customer's orders. `active: true` narrows to
|
|
2849
|
+
* parcels still moving.
|
|
2850
|
+
*
|
|
2851
|
+
* STORED status only — no live carrier poll. `trackShipment(id)` spends a
|
|
2852
|
+
* Shippo request because it is one parcel the customer opened; doing that
|
|
2853
|
+
* per row here would mean a carrier call for every parcel in their history
|
|
2854
|
+
* on every page load.
|
|
2855
|
+
*/
|
|
2856
|
+
async listShipments(opts) {
|
|
2857
|
+
const params = new URLSearchParams();
|
|
2858
|
+
if (typeof opts?.limit === "number")
|
|
2859
|
+
params.set("limit", String(opts.limit));
|
|
2860
|
+
if (opts?.active)
|
|
2861
|
+
params.set("active", "1");
|
|
2862
|
+
const qs = params.toString();
|
|
2863
|
+
return this.client.request({
|
|
2864
|
+
path: `customer-portal/shipments${qs ? `?${qs}` : ""}`,
|
|
2865
|
+
responseSchema: customerShipmentListResponseSchema,
|
|
2866
|
+
headers: this.headers(),
|
|
2867
|
+
});
|
|
2868
|
+
}
|
|
2544
2869
|
/**
|
|
2545
2870
|
* The signed-in customer's orders (newest first), each with a shipment
|
|
2546
2871
|
* roll-up (`overallStatus`, `anyInTransit`, `latestEstimatedDelivery`) for
|
|
@@ -2623,6 +2948,243 @@ export class BiabDevCustomerPortalClient {
|
|
|
2623
2948
|
headers: this.headers(),
|
|
2624
2949
|
});
|
|
2625
2950
|
}
|
|
2951
|
+
/**
|
|
2952
|
+
* Ask for a replacement instead of a refund.
|
|
2953
|
+
*
|
|
2954
|
+
* Sugar over `submitReturnRequest` with `kind: "exchange"`, because an
|
|
2955
|
+
* exchange reads as its own action to the person writing the UI, and burying
|
|
2956
|
+
* it in an options bag is how it stays undiscovered. `variantId` is the one
|
|
2957
|
+
* they want instead — omit it when that still needs a conversation.
|
|
2958
|
+
*
|
|
2959
|
+
* @example
|
|
2960
|
+
* ```ts
|
|
2961
|
+
* await portal.submitExchangeRequest(orderId, {
|
|
2962
|
+
* exchangeForVariantId: largeVariantId,
|
|
2963
|
+
* reason: "wrong size",
|
|
2964
|
+
* });
|
|
2965
|
+
* ```
|
|
2966
|
+
*/
|
|
2967
|
+
async submitExchangeRequest(orderId, input) {
|
|
2968
|
+
return this.submitReturnRequest(orderId, {
|
|
2969
|
+
...(input ?? {}),
|
|
2970
|
+
kind: "exchange",
|
|
2971
|
+
});
|
|
2972
|
+
}
|
|
2973
|
+
/**
|
|
2974
|
+
* Report that a parcel never arrived.
|
|
2975
|
+
*
|
|
2976
|
+
* This does NOT change the shipment's carrier status, and deliberately so:
|
|
2977
|
+
* when the carrier says delivered and the customer says otherwise, both
|
|
2978
|
+
* facts matter — the carrier's scan is what the org files a claim against.
|
|
2979
|
+
* The result carries `carrierStatus` alongside the report so a UI can show
|
|
2980
|
+
* both: *"Carrier says delivered Aug 14 · You reported not received Aug 16."*
|
|
2981
|
+
*
|
|
2982
|
+
* `contested: true` means exactly that disagreement. Re-reporting an open
|
|
2983
|
+
* claim returns it with `alreadyOpen: true` rather than erroring — a
|
|
2984
|
+
* customer tapping twice is anxious, not hostile.
|
|
2985
|
+
*
|
|
2986
|
+
* @example
|
|
2987
|
+
* ```ts
|
|
2988
|
+
* const r = await portal.reportNotReceived(shipmentId, {
|
|
2989
|
+
* note: "Nothing on the porch, checked with neighbours.",
|
|
2990
|
+
* });
|
|
2991
|
+
* if (r.contested) showCarrierDisputeHelp();
|
|
2992
|
+
* ```
|
|
2993
|
+
*/
|
|
2994
|
+
async reportNotReceived(shipmentId, input) {
|
|
2995
|
+
const body = input?.note ? { note: input.note } : {};
|
|
2996
|
+
return this.client.request({
|
|
2997
|
+
method: "POST",
|
|
2998
|
+
path: `customer-portal/shipments/${encodeURIComponent(shipmentId)}/not-received`,
|
|
2999
|
+
body,
|
|
3000
|
+
responseSchema: customerNotReceivedResultSchema,
|
|
3001
|
+
headers: this.headers(),
|
|
3002
|
+
});
|
|
3003
|
+
}
|
|
3004
|
+
/**
|
|
3005
|
+
* The product reviews this customer has written for this org.
|
|
3006
|
+
*
|
|
3007
|
+
* Distinct from `listReviews()`, which is reviews of the ORG. Both exist
|
|
3008
|
+
* because "are these people good to deal with" and "is this thing any good"
|
|
3009
|
+
* are different questions, stored in different tables, and shown in
|
|
3010
|
+
* different places.
|
|
3011
|
+
*
|
|
3012
|
+
* `isApproved: false` means QUEUED, not rejected — render it as "awaiting
|
|
3013
|
+
* review" or the customer will assume it was lost and write it again.
|
|
3014
|
+
*/
|
|
3015
|
+
/**
|
|
3016
|
+
* The customer's subscription with this org, and what the org offers.
|
|
3017
|
+
*
|
|
3018
|
+
* One subscription per org — `user_subscriptions` is unique on
|
|
3019
|
+
* (user, org) — so there is no id to pass. The org's live offerings come
|
|
3020
|
+
* back alongside, because a portal that reports "not subscribed" and
|
|
3021
|
+
* nothing else is a dead end.
|
|
3022
|
+
*
|
|
3023
|
+
* **Render entitlement from `subscription.hasAccess`, not from `status`.**
|
|
3024
|
+
* A lifetime purchase has no period to expire and a cancelled subscription
|
|
3025
|
+
* keeps access until the period already paid for ends; `hasAccess` is
|
|
3026
|
+
* computed by the same function the content gates use, so the portal and
|
|
3027
|
+
* the gate cannot disagree.
|
|
3028
|
+
*/
|
|
3029
|
+
async getSubscription() {
|
|
3030
|
+
return this.client.request({
|
|
3031
|
+
path: "customer-portal/subscription",
|
|
3032
|
+
responseSchema: customerSubscriptionResponseSchema,
|
|
3033
|
+
headers: this.headers(),
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
/**
|
|
3037
|
+
* Cancel the subscription at the end of the paid period.
|
|
3038
|
+
*
|
|
3039
|
+
* Cancelling ends the RENEWAL, not the access: the customer has paid for
|
|
3040
|
+
* the period they are in and keeps everything until `accessUntil`. Ending
|
|
3041
|
+
* access on the click would take back something they already bought, which
|
|
3042
|
+
* is the most common way a subscription flow feels like a trap.
|
|
3043
|
+
*
|
|
3044
|
+
* Read `accessUntil` back to them — "active until 14 March" is the true
|
|
3045
|
+
* statement, not "cancelled".
|
|
3046
|
+
*/
|
|
3047
|
+
async cancelSubscription() {
|
|
3048
|
+
return this.client.request({
|
|
3049
|
+
method: "POST",
|
|
3050
|
+
path: "customer-portal/subscription/cancel",
|
|
3051
|
+
body: { resume: false },
|
|
3052
|
+
responseSchema: customerSubscriptionCancelResponseSchema,
|
|
3053
|
+
headers: this.headers(),
|
|
3054
|
+
});
|
|
3055
|
+
}
|
|
3056
|
+
/**
|
|
3057
|
+
* Clear a pending cancellation.
|
|
3058
|
+
*
|
|
3059
|
+
* Between cancelling and the period ending nothing has actually been lost,
|
|
3060
|
+
* so changing your mind should cost one call rather than a re-purchase.
|
|
3061
|
+
* After the period ends there is nothing to resume and they subscribe again
|
|
3062
|
+
* like anyone else.
|
|
3063
|
+
*/
|
|
3064
|
+
async resumeSubscription() {
|
|
3065
|
+
return this.client.request({
|
|
3066
|
+
method: "POST",
|
|
3067
|
+
path: "customer-portal/subscription/cancel",
|
|
3068
|
+
body: { resume: true },
|
|
3069
|
+
responseSchema: customerSubscriptionCancelResponseSchema,
|
|
3070
|
+
headers: this.headers(),
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
/**
|
|
3074
|
+
* The content this subscription entitles them to — the answer to "what am
|
|
3075
|
+
* I actually getting for this?", which is the question asked right before
|
|
3076
|
+
* someone cancels.
|
|
3077
|
+
*
|
|
3078
|
+
* When `entitled` is false these are LOCKED previews, not an empty
|
|
3079
|
+
* entitlement: titles, excerpts and images, no bodies. Show them beside the
|
|
3080
|
+
* offer. Rendering an empty list would hide the pitch at exactly the moment
|
|
3081
|
+
* it is most relevant.
|
|
3082
|
+
*/
|
|
3083
|
+
async getSubscriberContent(opts) {
|
|
3084
|
+
const params = new URLSearchParams();
|
|
3085
|
+
if (typeof opts?.limit === "number")
|
|
3086
|
+
params.set("limit", String(opts.limit));
|
|
3087
|
+
const qs = params.toString();
|
|
3088
|
+
return this.client.request({
|
|
3089
|
+
path: `customer-portal/subscription/content${qs ? `?${qs}` : ""}`,
|
|
3090
|
+
responseSchema: customerSubscriberContentResponseSchema,
|
|
3091
|
+
headers: this.headers(),
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
/**
|
|
3095
|
+
* Push config and the browsers this customer has registered.
|
|
3096
|
+
*
|
|
3097
|
+
* Returns `vapidPublicKey` too, because a page cannot subscribe without it.
|
|
3098
|
+
*/
|
|
3099
|
+
async getPushConfig() {
|
|
3100
|
+
return this.client.request({
|
|
3101
|
+
path: "customer-portal/push",
|
|
3102
|
+
responseSchema: customerPushConfigSchema,
|
|
3103
|
+
headers: this.headers(),
|
|
3104
|
+
});
|
|
3105
|
+
}
|
|
3106
|
+
/**
|
|
3107
|
+
* Register this browser.
|
|
3108
|
+
*
|
|
3109
|
+
* Pair with `subscribeToPush()` from `@businessdash/sdk/push-core`, which
|
|
3110
|
+
* handles the service worker, the permission prompt and the key encoding
|
|
3111
|
+
* and hands back exactly this payload.
|
|
3112
|
+
*
|
|
3113
|
+
* Upserted on the endpoint, so re-subscribing from the same browser
|
|
3114
|
+
* refreshes the row rather than creating a second one.
|
|
3115
|
+
*/
|
|
3116
|
+
async subscribePush(input) {
|
|
3117
|
+
return this.client.request({
|
|
3118
|
+
method: "POST",
|
|
3119
|
+
path: "customer-portal/push",
|
|
3120
|
+
body: input,
|
|
3121
|
+
responseSchema: z.object({ id: z.string(), created: z.boolean() }),
|
|
3122
|
+
headers: this.headers(),
|
|
3123
|
+
});
|
|
3124
|
+
}
|
|
3125
|
+
/**
|
|
3126
|
+
* Rename a device, or narrow what it receives.
|
|
3127
|
+
*
|
|
3128
|
+
* `categories: []` means "nothing for now" and keeps the subscription
|
|
3129
|
+
* warm — browsers make re-granting a revoked permission deliberately
|
|
3130
|
+
* awkward, so an "off" that discards the subscription is hard to undo.
|
|
3131
|
+
*/
|
|
3132
|
+
async updatePushDevice(input) {
|
|
3133
|
+
return this.client.request({
|
|
3134
|
+
method: "PATCH",
|
|
3135
|
+
path: "customer-portal/push",
|
|
3136
|
+
body: input,
|
|
3137
|
+
responseSchema: z.object({ ok: z.boolean() }),
|
|
3138
|
+
headers: this.headers(),
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
/**
|
|
3142
|
+
* Forget a device. Takes an id or the endpoint.
|
|
3143
|
+
*
|
|
3144
|
+
* A browser tearing its own subscription down knows its endpoint, not our
|
|
3145
|
+
* row id — so pass what `unsubscribeFromPush()` returns.
|
|
3146
|
+
*/
|
|
3147
|
+
async unsubscribePush(input) {
|
|
3148
|
+
return this.client.request({
|
|
3149
|
+
method: "DELETE",
|
|
3150
|
+
path: "customer-portal/push",
|
|
3151
|
+
body: input,
|
|
3152
|
+
responseSchema: z.object({
|
|
3153
|
+
ok: z.boolean(),
|
|
3154
|
+
deletedId: z.string().nullable(),
|
|
3155
|
+
}),
|
|
3156
|
+
headers: this.headers(),
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
async listProductReviews() {
|
|
3160
|
+
return this.client.request({
|
|
3161
|
+
path: "customer-portal/product-reviews",
|
|
3162
|
+
responseSchema: customerProductReviewListSchema,
|
|
3163
|
+
headers: this.headers(),
|
|
3164
|
+
});
|
|
3165
|
+
}
|
|
3166
|
+
/**
|
|
3167
|
+
* Review a product this customer BOUGHT.
|
|
3168
|
+
*
|
|
3169
|
+
* The portal requires a matching order — it is standing inside the
|
|
3170
|
+
* customer's purchase history, which is the one thing the public storefront
|
|
3171
|
+
* does not know. That makes these verified-buyer reviews, and it stops a
|
|
3172
|
+
* competitor one-starring a catalogue they never bought.
|
|
3173
|
+
*
|
|
3174
|
+
* Rejects with `not_purchased` (403) when no order matches, and
|
|
3175
|
+
* `already_reviewed` (409) on a second review of the same product.
|
|
3176
|
+
* Moderation follows the ORG's policy, so the result may be
|
|
3177
|
+
* `awaitingModeration`.
|
|
3178
|
+
*/
|
|
3179
|
+
async submitProductReview(input) {
|
|
3180
|
+
return this.client.request({
|
|
3181
|
+
method: "POST",
|
|
3182
|
+
path: "customer-portal/product-reviews",
|
|
3183
|
+
body: input,
|
|
3184
|
+
responseSchema: customerProductReviewCreatedSchema,
|
|
3185
|
+
headers: this.headers(),
|
|
3186
|
+
});
|
|
3187
|
+
}
|
|
2626
3188
|
/**
|
|
2627
3189
|
* List the digital downloads the customer is entitled to for a paid order
|
|
2628
3190
|
* (P10d). Each item is a ready-to-use URL — a short-lived presigned link for
|
|
@@ -2718,6 +3280,22 @@ export class BiabDevCustomerPortalClient {
|
|
|
2718
3280
|
* dispatch travel-time recompute layer ships, at which point the
|
|
2719
3281
|
* `eta` field switches sources without breaking this shape.
|
|
2720
3282
|
*/
|
|
3283
|
+
/**
|
|
3284
|
+
* Where the job and its technicians are in the dispatch lifecycle.
|
|
3285
|
+
*
|
|
3286
|
+
* Named for ETA historically; it is the DISPATCH STATUS surface, which is
|
|
3287
|
+
* why `getDispatchStatus` below is the same call under the name people
|
|
3288
|
+
* look for.
|
|
3289
|
+
*
|
|
3290
|
+
* Read `dispatchStatus` (job-level) for "is anyone on the way" and
|
|
3291
|
+
* `assignments[].dispatchStatus` for per-technician detail. They differ on
|
|
3292
|
+
* purpose: the job is `completed` only once the LAST assignee finishes.
|
|
3293
|
+
*
|
|
3294
|
+
* Nothing about the dispatch CASCADE is exposed — who was offered the job,
|
|
3295
|
+
* who declined, how many people were asked before someone accepted. That
|
|
3296
|
+
* is staff-internal, and a customer learning they were the fourth choice
|
|
3297
|
+
* helps nobody.
|
|
3298
|
+
*/
|
|
2721
3299
|
async getJobEta(jobId) {
|
|
2722
3300
|
return this.client.request({
|
|
2723
3301
|
path: `customer-portal/jobs/${encodeURIComponent(jobId)}/eta`,
|
|
@@ -2725,6 +3303,16 @@ export class BiabDevCustomerPortalClient {
|
|
|
2725
3303
|
headers: this.headers(),
|
|
2726
3304
|
});
|
|
2727
3305
|
}
|
|
3306
|
+
/**
|
|
3307
|
+
* Dispatch status for a job — the same call as `getJobEta`, under the name
|
|
3308
|
+
* developers actually search for.
|
|
3309
|
+
*
|
|
3310
|
+
* An alias rather than a second route: two endpoints returning the same
|
|
3311
|
+
* thing is how they drift.
|
|
3312
|
+
*/
|
|
3313
|
+
async getDispatchStatus(jobId) {
|
|
3314
|
+
return this.getJobEta(jobId);
|
|
3315
|
+
}
|
|
2728
3316
|
/**
|
|
2729
3317
|
* Unified job activity feed: structured events (status changes,
|
|
2730
3318
|
* dispatch lifecycle, media uploads, quote/contract/invoice
|
|
@@ -2842,4 +3430,222 @@ export class BiabDevAuthClient {
|
|
|
2842
3430
|
});
|
|
2843
3431
|
}
|
|
2844
3432
|
}
|
|
3433
|
+
/**
|
|
3434
|
+
* Booking, rescheduling, cancelling — and the conference call attached to it.
|
|
3435
|
+
*
|
|
3436
|
+
* ## Both sides of every flow
|
|
3437
|
+
*
|
|
3438
|
+
* An invitee acts with a signed TOKEN from their confirmation email; staff act
|
|
3439
|
+
* with the API key. Both reach the same service, so the same notifications fire
|
|
3440
|
+
* to the invitee AND every host either way, and the booking records which of
|
|
3441
|
+
* them made the change.
|
|
3442
|
+
*
|
|
3443
|
+
* ## Three tokens, not one
|
|
3444
|
+
*
|
|
3445
|
+
* A confirmed booking yields `manageToken`, `rescheduleToken` and `cancelToken`
|
|
3446
|
+
* separately. A cancel link in an email must not also be able to reschedule,
|
|
3447
|
+
* and neither should be able to read the whole booking. One token for all three
|
|
3448
|
+
* would make every emailed link as powerful as the strongest thing it enables.
|
|
3449
|
+
*
|
|
3450
|
+
* ## The conference link is re-minted on reschedule
|
|
3451
|
+
*
|
|
3452
|
+
* Moving a booking can issue a new meeting URL. Read `conferenceLink` back from
|
|
3453
|
+
* the reschedule result rather than reusing the one from confirmation —
|
|
3454
|
+
* otherwise the calendar invite you send points at a dead room.
|
|
3455
|
+
*/
|
|
3456
|
+
/**
|
|
3457
|
+
* Customer-portal invitations.
|
|
3458
|
+
*
|
|
3459
|
+
* For an org running its own admin tooling rather than the dashboard.
|
|
3460
|
+
*/
|
|
3461
|
+
export class BiabDevCustomerInvitesClient {
|
|
3462
|
+
client;
|
|
3463
|
+
constructor(client) {
|
|
3464
|
+
this.client = client;
|
|
3465
|
+
}
|
|
3466
|
+
/**
|
|
3467
|
+
* Hand an invite link out again.
|
|
3468
|
+
*
|
|
3469
|
+
* **Rotates the token** — the previous link stops working. That is the
|
|
3470
|
+
* point rather than a side effect: if the reason for resending was "it went
|
|
3471
|
+
* to the wrong address", rotating IS the fix, and reusing the token would
|
|
3472
|
+
* leave the wrong recipient holding a working invitation. The cost is that
|
|
3473
|
+
* someone who finds the original email later gets a dead link, which is a
|
|
3474
|
+
* support message rather than an account.
|
|
3475
|
+
*
|
|
3476
|
+
* Rate limited to one send a minute per invitation, answering **429** with
|
|
3477
|
+
* a retry hint. Resend mails an address the caller chose, so an unbounded
|
|
3478
|
+
* one is a mail-bombing tool. Staff clicking the button in the dashboard
|
|
3479
|
+
* skip the wait; an API key does not, because an API key is the automated
|
|
3480
|
+
* caller the limit exists for.
|
|
3481
|
+
*
|
|
3482
|
+
* Refuses a **revoked** invitation (resending would quietly un-revoke it)
|
|
3483
|
+
* and a **fully-redeemed** one (it did its job; a new invitation should be
|
|
3484
|
+
* created as one, so the list keeps showing what happened).
|
|
3485
|
+
*/
|
|
3486
|
+
async resend(inviteId, opts) {
|
|
3487
|
+
return this.client.request({
|
|
3488
|
+
method: "POST",
|
|
3489
|
+
path: `customer-invites/${encodeURIComponent(inviteId)}/resend`,
|
|
3490
|
+
body: opts?.expiresInDays === undefined
|
|
3491
|
+
? {}
|
|
3492
|
+
: { expiresInDays: opts.expiresInDays },
|
|
3493
|
+
responseSchema: customerInviteResendResponseSchema,
|
|
3494
|
+
});
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
export class BiabDevSchedulingClient {
|
|
3498
|
+
client;
|
|
3499
|
+
siteId;
|
|
3500
|
+
constructor(client, siteId) {
|
|
3501
|
+
this.client = client;
|
|
3502
|
+
this.siteId = siteId;
|
|
3503
|
+
}
|
|
3504
|
+
path(suffix) {
|
|
3505
|
+
return `sites/${encodeURIComponent(this.siteId)}/scheduling/${suffix}`;
|
|
3506
|
+
}
|
|
3507
|
+
/** What the org offers to book. */
|
|
3508
|
+
async listEventTypes() {
|
|
3509
|
+
return this.client.request({
|
|
3510
|
+
path: this.path("event-types"),
|
|
3511
|
+
responseSchema: schedulingEventTypeListSchema,
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3514
|
+
/** One event type, plus the questions asked when booking it. */
|
|
3515
|
+
async getEventType(slug) {
|
|
3516
|
+
return this.client.request({
|
|
3517
|
+
path: this.path(`event-types/${encodeURIComponent(slug)}`),
|
|
3518
|
+
responseSchema: schedulingEventTypeDetailSchema,
|
|
3519
|
+
});
|
|
3520
|
+
}
|
|
3521
|
+
/**
|
|
3522
|
+
* Free slots in a window.
|
|
3523
|
+
*
|
|
3524
|
+
* Ask for the window you are about to render, not the whole month: slot
|
|
3525
|
+
* computation walks every host's calendar and busy times, so a wide range
|
|
3526
|
+
* is a slow one.
|
|
3527
|
+
*/
|
|
3528
|
+
async getAvailableSlots(slug, params) {
|
|
3529
|
+
const query = new URLSearchParams({
|
|
3530
|
+
from: typeof params.from === "string"
|
|
3531
|
+
? params.from
|
|
3532
|
+
: params.from.toISOString(),
|
|
3533
|
+
to: typeof params.to === "string" ? params.to : params.to.toISOString(),
|
|
3534
|
+
});
|
|
3535
|
+
return this.client.request({
|
|
3536
|
+
path: this.path(`event-types/${encodeURIComponent(slug)}/slots?${query.toString()}`),
|
|
3537
|
+
responseSchema: schedulingSlotsResponseSchema,
|
|
3538
|
+
});
|
|
3539
|
+
}
|
|
3540
|
+
/**
|
|
3541
|
+
* Book a slot.
|
|
3542
|
+
*
|
|
3543
|
+
* Returns `pending` rather than `confirmed` when the event type requires
|
|
3544
|
+
* approval — say "requested" in the UI for that case, because telling
|
|
3545
|
+
* someone their meeting is booked when staff still have to accept it is the
|
|
3546
|
+
* kind of thing they plan a day around.
|
|
3547
|
+
*/
|
|
3548
|
+
async confirmBooking(input) {
|
|
3549
|
+
const body = {
|
|
3550
|
+
...input,
|
|
3551
|
+
startAt: typeof input.startAt === "string"
|
|
3552
|
+
? input.startAt
|
|
3553
|
+
: input.startAt.toISOString(),
|
|
3554
|
+
};
|
|
3555
|
+
return this.client.request({
|
|
3556
|
+
method: "POST",
|
|
3557
|
+
path: this.path("bookings"),
|
|
3558
|
+
body,
|
|
3559
|
+
responseSchema: schedulingBookingResultSchema,
|
|
3560
|
+
});
|
|
3561
|
+
}
|
|
3562
|
+
/**
|
|
3563
|
+
* Read a booking with one of its signed tokens.
|
|
3564
|
+
*
|
|
3565
|
+
* `type` must match the token you hold — a cancel token will not open the
|
|
3566
|
+
* manage view. That is the point of issuing three.
|
|
3567
|
+
*/
|
|
3568
|
+
async getBooking(token, type = "manage") {
|
|
3569
|
+
return this.client.request({
|
|
3570
|
+
path: this.path(`bookings/by-token/${encodeURIComponent(token)}?type=${encodeURIComponent(type)}`),
|
|
3571
|
+
responseSchema: schedulingBookingViewSchema,
|
|
3572
|
+
});
|
|
3573
|
+
}
|
|
3574
|
+
/**
|
|
3575
|
+
* Move a booking — the INVITEE side, with their reschedule token.
|
|
3576
|
+
*
|
|
3577
|
+
* Notifies the invitee and every host, and cancels the reminder jobs queued
|
|
3578
|
+
* against the old time so nobody gets "your meeting starts in 15 minutes"
|
|
3579
|
+
* for a slot that moved.
|
|
3580
|
+
*/
|
|
3581
|
+
async rescheduleBooking(input) {
|
|
3582
|
+
return this.client.request({
|
|
3583
|
+
method: "POST",
|
|
3584
|
+
path: this.path(`bookings/by-token/${encodeURIComponent(input.token)}`),
|
|
3585
|
+
body: {
|
|
3586
|
+
action: "reschedule",
|
|
3587
|
+
newStartAt: typeof input.newStartAt === "string"
|
|
3588
|
+
? input.newStartAt
|
|
3589
|
+
: input.newStartAt.toISOString(),
|
|
3590
|
+
...(input.reason ? { reason: input.reason } : {}),
|
|
3591
|
+
},
|
|
3592
|
+
responseSchema: schedulingRescheduleResultSchema,
|
|
3593
|
+
});
|
|
3594
|
+
}
|
|
3595
|
+
/**
|
|
3596
|
+
* Move a booking as STAFF, with the API key rather than an invitee token.
|
|
3597
|
+
*
|
|
3598
|
+
* Same service as the token path, so the invitee AND every host are
|
|
3599
|
+
* notified either way, and the reminder jobs for the old time are
|
|
3600
|
+
* cancelled either way. `actorUserId` records WHO moved it, which is what
|
|
3601
|
+
* lets a customer's history say "they rescheduled" rather than leaving an
|
|
3602
|
+
* unexplained change.
|
|
3603
|
+
*/
|
|
3604
|
+
async rescheduleBookingAsStaff(input) {
|
|
3605
|
+
return this.client.request({
|
|
3606
|
+
method: "POST",
|
|
3607
|
+
path: this.path(`bookings/${encodeURIComponent(input.bookingId)}/manage`),
|
|
3608
|
+
body: {
|
|
3609
|
+
action: "reschedule",
|
|
3610
|
+
newStartAt: typeof input.newStartAt === "string"
|
|
3611
|
+
? input.newStartAt
|
|
3612
|
+
: input.newStartAt.toISOString(),
|
|
3613
|
+
...(input.reason ? { reason: input.reason } : {}),
|
|
3614
|
+
...(input.actorUserId ? { actorUserId: input.actorUserId } : {}),
|
|
3615
|
+
},
|
|
3616
|
+
responseSchema: schedulingRescheduleResultSchema,
|
|
3617
|
+
});
|
|
3618
|
+
}
|
|
3619
|
+
/** Cancel a booking as STAFF. Notifies the invitee and every host. */
|
|
3620
|
+
async cancelBookingAsStaff(input) {
|
|
3621
|
+
return this.client.request({
|
|
3622
|
+
method: "POST",
|
|
3623
|
+
path: this.path(`bookings/${encodeURIComponent(input.bookingId)}/manage`),
|
|
3624
|
+
body: {
|
|
3625
|
+
action: "cancel",
|
|
3626
|
+
...(input.reason ? { reason: input.reason } : {}),
|
|
3627
|
+
...(input.actorUserId ? { actorUserId: input.actorUserId } : {}),
|
|
3628
|
+
},
|
|
3629
|
+
responseSchema: schedulingCancelResultSchema,
|
|
3630
|
+
});
|
|
3631
|
+
}
|
|
3632
|
+
/**
|
|
3633
|
+
* Cancel a booking — the INVITEE side, with their cancel token.
|
|
3634
|
+
*
|
|
3635
|
+
* `reason` is passed to the hosts. Worth collecting: "something came up" and
|
|
3636
|
+
* "I booked the wrong service" lead to different follow-ups, and the second
|
|
3637
|
+
* is recoverable revenue.
|
|
3638
|
+
*/
|
|
3639
|
+
async cancelBooking(input) {
|
|
3640
|
+
return this.client.request({
|
|
3641
|
+
method: "POST",
|
|
3642
|
+
path: this.path(`bookings/by-token/${encodeURIComponent(input.token)}`),
|
|
3643
|
+
body: {
|
|
3644
|
+
action: "cancel",
|
|
3645
|
+
...(input.reason ? { reason: input.reason } : {}),
|
|
3646
|
+
},
|
|
3647
|
+
responseSchema: schedulingCancelResultSchema,
|
|
3648
|
+
});
|
|
3649
|
+
}
|
|
3650
|
+
}
|
|
2845
3651
|
//# sourceMappingURL=client.js.map
|