@c1m-public/channel-client 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { ChannelConfigurationError } from './chunk-P3HX34X7.js';
1
+ import { ChannelConfigurationError } from './chunk-XPO7C3DW.js';
2
2
  import 'server-only';
3
3
 
4
4
  // ../resilience/src/index.ts
@@ -278,6 +278,15 @@ function createChannelClient(options) {
278
278
  dash: {
279
279
  profile: () => request("channel.dash.profile", "/dash/profile"),
280
280
  init: () => request("channel.dash.init", "/dash/init"),
281
+ waitlist: {
282
+ status: () => request("channel.dash.waitlist.status", "/dash/waitlist", { cache: "no-store" }),
283
+ form: () => request("channel.dash.waitlist.form", "/dash/waitlist/form", { cache: "no-store" }),
284
+ submit: (input, mutation) => request("channel.dash.waitlist.submit", "/dash/waitlist/entries", {
285
+ method: "POST",
286
+ headers: mutationHeaders(mutation),
287
+ body: JSON.stringify(input)
288
+ })
289
+ },
281
290
  plans: () => request("channel.dash.plans", "/dash/plans"),
282
291
  directory: {
283
292
  regions: () => request("channel.dash.directory.regions", "/dash/directory/regions"),
@@ -394,6 +403,11 @@ function createChannelClient(options) {
394
403
  method: "POST",
395
404
  headers: mutationHeaders(mutation),
396
405
  body: JSON.stringify(input)
406
+ }),
407
+ cancel: (orderId, input, mutation) => request("channel.checkout.cancel", `/checkout/${encodePath(orderId)}/cancel`, {
408
+ method: "POST",
409
+ headers: mutationHeaders(mutation),
410
+ body: JSON.stringify(input)
397
411
  })
398
412
  },
399
413
  reviews: {
@@ -533,10 +547,10 @@ function createChannelClient(options) {
533
547
  method: "DELETE",
534
548
  headers: mutationHeaders(mutation)
535
549
  }, customerSession),
536
- setDefault: (addressId, kind, mutation) => request("channel.account.addresses.set_default", `/account/addresses/${encodePath(addressId)}/default`, {
550
+ setDefault: (addressId, mutation) => request("channel.account.addresses.set_default", `/account/addresses/${encodePath(addressId)}/default`, {
537
551
  method: "POST",
538
552
  headers: mutationHeaders(mutation),
539
- body: JSON.stringify({ kind })
553
+ body: JSON.stringify({ kind: "shipping" })
540
554
  }, customerSession)
541
555
  },
542
556
  paymentMethods: {
@@ -1,5 +1,5 @@
1
- import { isChannelAPIError, createChannelClient } from './chunk-UX7PRF5Z.js';
2
- import { parseChannelWebhookEvent, isChannelWebhookVerificationError, isChannelWebhookEventType, ChannelConfigurationError } from './chunk-P3HX34X7.js';
1
+ import { isChannelAPIError, createChannelClient } from './chunk-E5J5UOPS.js';
2
+ import { parseChannelWebhookEvent, isChannelWebhookVerificationError, isChannelWebhookEventType, ChannelConfigurationError } from './chunk-XPO7C3DW.js';
3
3
  import 'server-only';
4
4
 
5
5
  var MAX_AGE_SECONDS = 60 * 60 * 24 * 30;
@@ -286,7 +286,9 @@ function createCart(options) {
286
286
  * must be on the channel's registered site_url — the server refuses
287
287
  * anything else, because an unchecked return URL is an open redirect.
288
288
  */
289
- pay: (orderId, input, attempt) => resolve().checkout.pay(orderId, input, attempt)
289
+ pay: (orderId, input, attempt) => resolve().checkout.pay(orderId, input, attempt),
290
+ /** Expire the hosted provider session before returning the cart to editing. */
291
+ cancel: (orderId, input, attempt) => resolve().checkout.cancel(orderId, input, attempt)
290
292
  }
291
293
  };
292
294
  }
@@ -1,4 +1,4 @@
1
- import { createChannelClient } from './chunk-UX7PRF5Z.js';
1
+ import { createChannelClient } from './chunk-E5J5UOPS.js';
2
2
  import 'server-only';
3
3
 
4
4
  function narrow(client) {
@@ -10,7 +10,7 @@ function isChannelConfigurationError(error) {
10
10
  }
11
11
 
12
12
  // src/generated/webhook-events.ts
13
- var GENERATED_CHANNEL_WEBHOOK_EVENT_TYPES = ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
13
+ var GENERATED_CHANNEL_WEBHOOK_EVENT_TYPES = ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "fulfillment.shipped", "fulfillment.delivered", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
14
14
 
15
15
  // src/webhooks.ts
16
16
  var CHANNEL_WEBHOOK_EVENT_TYPES = GENERATED_CHANNEL_WEBHOOK_EVENT_TYPES;
@@ -152,6 +152,9 @@ function isKnownEventData(type, value) {
152
152
  case "order.cancelled":
153
153
  case "order.refunded":
154
154
  return hasStrings(value, ["order_id", "order_number", "status", "payment_status", "currency", "created_at"]) && typeof value.total_cents === "number";
155
+ case "fulfillment.shipped":
156
+ case "fulfillment.delivered":
157
+ return hasStrings(value, ["fulfillment_id", "order_id", "status"]) && (value.tracking_number === void 0 || typeof value.tracking_number === "string") && (value.tracking_url === void 0 || typeof value.tracking_url === "string") && (value.carrier === void 0 || typeof value.carrier === "string") && (value.shipped_at === void 0 || typeof value.shipped_at === "string") && (value.delivered_at === void 0 || typeof value.delivered_at === "string");
155
158
  case "lead.created":
156
159
  return hasStrings(value, ["lead_id", "source", "created_at"]);
157
160
  case "review.submitted":
package/dist/dash-next.js CHANGED
@@ -1,7 +1,7 @@
1
- import { createNextChannelClient } from './chunk-BANE7WSW.js';
2
- import { narrow } from './chunk-O4N7PQJF.js';
3
- import './chunk-UX7PRF5Z.js';
4
- import './chunk-P3HX34X7.js';
1
+ import { createNextChannelClient } from './chunk-HOR5MOYI.js';
2
+ import { narrow } from './chunk-LRHQXWLD.js';
3
+ import './chunk-E5J5UOPS.js';
4
+ import './chunk-XPO7C3DW.js';
5
5
  import 'server-only';
6
6
 
7
7
  function createNextDashChannelClient(options) {
package/dist/dash.js CHANGED
@@ -1,3 +1,3 @@
1
- export { createDashChannelClient, narrow as narrowToDash } from './chunk-O4N7PQJF.js';
2
- import './chunk-UX7PRF5Z.js';
3
- import './chunk-P3HX34X7.js';
1
+ export { createDashChannelClient, narrow as narrowToDash } from './chunk-LRHQXWLD.js';
2
+ import './chunk-E5J5UOPS.js';
3
+ import './chunk-XPO7C3DW.js';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookEvent, ChannelWebhookEventDataMap, ChannelWebhookEventType, ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, LeadCreatedEventData, MenuUpdatedEventData, OrderEventData, PagePublishedEventData, ParseChannelWebhookEventOptions, ParsedChannelWebhookEvent, ProductEventData, ReviewPublishedEventData, ReviewSubmittedEventData, UnknownChannelWebhookEvent, VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './webhooks.js';
1
+ export { AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookEvent, ChannelWebhookEventDataMap, ChannelWebhookEventType, ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, FulfillmentEventData, LeadCreatedEventData, MenuUpdatedEventData, OrderEventData, PagePublishedEventData, ParseChannelWebhookEventOptions, ParsedChannelWebhookEvent, ProductEventData, ReviewPublishedEventData, ReviewSubmittedEventData, UnknownChannelWebhookEvent, VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './webhooks.js';
2
2
 
3
3
  interface ListResponse<T> {
4
4
  items: T[];
@@ -18,6 +18,19 @@ interface WaitlistPublicStatus {
18
18
  accepting_entries: boolean;
19
19
  display: "page" | "block";
20
20
  }
21
+ interface WaitlistPublicFormResponse {
22
+ status: WaitlistPublicStatus;
23
+ collect_marketing_consent: boolean;
24
+ }
25
+ interface WaitlistSubmission {
26
+ email: string;
27
+ name?: string;
28
+ source?: string;
29
+ marketing_opt_in?: boolean;
30
+ }
31
+ interface WaitlistAcknowledgement {
32
+ accepted: boolean;
33
+ }
21
34
  interface PublicWorkspaceInit {
22
35
  workspace: WorkspaceInfo;
23
36
  branding?: Record<string, unknown>;
@@ -574,7 +587,6 @@ interface GivingIntentListResponse {
574
587
  }
575
588
  interface SavedAddress {
576
589
  id: string;
577
- end_user_id: string;
578
590
  label: string;
579
591
  name: string;
580
592
  phone: string;
@@ -584,36 +596,29 @@ interface SavedAddress {
584
596
  region: string;
585
597
  postal_code: string;
586
598
  country_code: string;
587
- is_default_shipping: boolean;
588
- is_default_billing: boolean;
599
+ is_default: boolean;
589
600
  created_at: string;
590
601
  updated_at: string;
591
602
  }
592
603
  interface SavedAddressInput {
604
+ name: string;
593
605
  line1: string;
594
606
  city: string;
595
607
  country_code: string;
596
608
  label?: string;
597
- name?: string;
598
609
  phone?: string;
599
610
  line2?: string;
600
611
  region?: string;
601
612
  postal_code?: string;
602
- is_default_shipping?: boolean;
603
- is_default_billing?: boolean;
613
+ is_default?: boolean;
604
614
  }
605
615
  type SavedAddressUpdateInput = SavedAddressInput;
606
- type SavedAddressDefaultKind = "shipping" | "billing";
607
616
  interface SavedAddressResponse {
608
617
  address: SavedAddress;
609
618
  }
610
619
  interface SavedPaymentMethod {
611
620
  id: string;
612
- workspace_id: string;
613
- end_user_ref?: string;
614
621
  provider: string;
615
- provider_customer_id?: string;
616
- provider_payment_method_id: string;
617
622
  status: string;
618
623
  is_default: boolean;
619
624
  display_brand?: string;
@@ -625,6 +630,8 @@ interface SavedPaymentMethod {
625
630
  }
626
631
  interface PaymentMethodSetupInput {
627
632
  provider: string;
633
+ consent: boolean;
634
+ consent_version: "saved_payment_method_v1";
628
635
  }
629
636
  interface PaymentMethodSetupResult {
630
637
  type: string;
@@ -1204,6 +1211,9 @@ interface CheckoutPayInput {
1204
1211
  cart_token: string;
1205
1212
  return_url?: string;
1206
1213
  }
1214
+ interface CheckoutCancelInput {
1215
+ cart_token: string;
1216
+ }
1207
1217
  interface PaymentMethodOption {
1208
1218
  provider: string;
1209
1219
  name: string;
@@ -1229,6 +1239,7 @@ interface ShippingMethodOption {
1229
1239
  interface CheckoutOptions {
1230
1240
  checkout_variant: string;
1231
1241
  order: Order;
1242
+ checkout_active?: boolean;
1232
1243
  shipping_methods?: ShippingMethodOption[];
1233
1244
  payment_methods?: PaymentMethodOption[];
1234
1245
  payment_ready?: boolean;
@@ -1350,7 +1361,7 @@ interface ChannelVisitor {
1350
1361
  userAgent?: string;
1351
1362
  }
1352
1363
  type ChannelRequestOutcome = "success" | "api_error" | "network_error" | "timeout" | "invalid_response" | "cancelled";
1353
- type ChannelOperation = "channel.ping" | "channel.geo.detect" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "content.pages.public.list.channel" | "content.pages.public.get.channel" | "shop.public.products.list.channel" | "shop.public.products.get.channel" | "shop.public.products.media.channel" | "reviews.public.list.channel" | "reviews.public.summary.channel" | "reviews.public.submit.channel" | "channel.theme.get" | "channel.menus.get" | "channel.blog.get" | "channel.blog.list" | "channel.payments.availability" | "channel.giving.entries.list" | "channel.giving.entries.get" | "channel.giving.start" | "channel.subscriptions.plans.list" | "channel.subscriptions.plans.get" | "channel.subscriptions.start" | "monetization.payment_links.public_get.channel" | "monetization.payment_links.public_checkout.channel" | "monetization.payment_links.public_redemption_get.channel" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "menu.public.board_menu.channel" | "channel.auth.check" | "channel.auth.signup" | "channel.auth.send_code" | "channel.auth.verify_code" | "channel.auth.refresh" | "channel.auth.me" | "channel.auth.me.update" | "channel.auth.logout" | "channel.auth.sessions.list" | "channel.auth.sessions.revoke" | "channel.auth.sessions.revoke_others" | "channel.auth.sessions.revoke_all" | "channel.auth.security_activity.list" | "channel.account.addresses.list" | "channel.account.addresses.create" | "channel.account.addresses.get" | "channel.account.addresses.update" | "channel.account.addresses.delete" | "channel.account.addresses.set_default" | "channel.account.giving.list" | "channel.account.orders.list" | "channel.account.orders.summary" | "channel.account.orders.get" | "channel.account.payment_methods.list" | "channel.account.payment_methods.setup" | "channel.account.payment_methods.confirm" | "channel.account.payment_methods.default" | "channel.account.payment_methods.delete" | "channel.account.subscriptions.list" | "channel.account.subscriptions.get" | "channel.account.subscriptions.source" | "channel.account.subscriptions.cancel" | "channel.account.subscriptions.pause" | "channel.account.subscriptions.resume" | "channel.account.subscriptions.invoices.list" | "channel.account.subscriptions.invoices.get" | "channel.account.subscriptions.invoices.pay_now" | "channel.catalog.brands.list" | "channel.catalog.categories.list" | "channel.catalog.categories.products" | "channel.catalog.collections.list" | "channel.catalog.collections.products" | "shop.public.collections.get.channel" | "channel.cart.get" | "channel.cart.items.add" | "channel.cart.items.update" | "channel.cart.items.remove" | "channel.cart.clear" | "channel.cart.merge" | "channel.checkout.options" | "channel.checkout.status" | "channel.checkout.customer.set" | "channel.checkout.addresses.set" | "channel.checkout.fulfillment.set" | "channel.checkout.pay" | "channel.dash.profile" | "channel.dash.init" | "channel.dash.plans" | "channel.dash.directory.regions" | "channel.dash.directory.browse" | "channel.dash.directory.get" | "channel.dash.leads.capture" | "channel.dash.lead_portal.my_quotes" | "channel.dash.lead_portal.request_link" | "growth.public_workspace.leads.capture.channel";
1364
+ type ChannelOperation = "channel.ping" | "channel.geo.detect" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "content.pages.public.list.channel" | "content.pages.public.get.channel" | "shop.public.products.list.channel" | "shop.public.products.get.channel" | "shop.public.products.media.channel" | "reviews.public.list.channel" | "reviews.public.summary.channel" | "reviews.public.submit.channel" | "channel.theme.get" | "channel.menus.get" | "channel.blog.get" | "channel.blog.list" | "channel.payments.availability" | "channel.giving.entries.list" | "channel.giving.entries.get" | "channel.giving.start" | "channel.subscriptions.plans.list" | "channel.subscriptions.plans.get" | "channel.subscriptions.start" | "monetization.payment_links.public_get.channel" | "monetization.payment_links.public_checkout.channel" | "monetization.payment_links.public_redemption_get.channel" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "menu.public.board_menu.channel" | "channel.auth.check" | "channel.auth.signup" | "channel.auth.send_code" | "channel.auth.verify_code" | "channel.auth.refresh" | "channel.auth.me" | "channel.auth.me.update" | "channel.auth.logout" | "channel.auth.sessions.list" | "channel.auth.sessions.revoke" | "channel.auth.sessions.revoke_others" | "channel.auth.sessions.revoke_all" | "channel.auth.security_activity.list" | "channel.account.addresses.list" | "channel.account.addresses.create" | "channel.account.addresses.get" | "channel.account.addresses.update" | "channel.account.addresses.delete" | "channel.account.addresses.set_default" | "channel.account.giving.list" | "channel.account.orders.list" | "channel.account.orders.summary" | "channel.account.orders.get" | "channel.account.payment_methods.list" | "channel.account.payment_methods.setup" | "channel.account.payment_methods.confirm" | "channel.account.payment_methods.default" | "channel.account.payment_methods.delete" | "channel.account.subscriptions.list" | "channel.account.subscriptions.get" | "channel.account.subscriptions.source" | "channel.account.subscriptions.cancel" | "channel.account.subscriptions.pause" | "channel.account.subscriptions.resume" | "channel.account.subscriptions.invoices.list" | "channel.account.subscriptions.invoices.get" | "channel.account.subscriptions.invoices.pay_now" | "channel.catalog.brands.list" | "channel.catalog.categories.list" | "channel.catalog.categories.products" | "channel.catalog.collections.list" | "channel.catalog.collections.products" | "shop.public.collections.get.channel" | "channel.cart.get" | "channel.cart.items.add" | "channel.cart.items.update" | "channel.cart.items.remove" | "channel.cart.clear" | "channel.cart.merge" | "channel.checkout.options" | "channel.checkout.status" | "channel.checkout.customer.set" | "channel.checkout.addresses.set" | "channel.checkout.fulfillment.set" | "channel.checkout.pay" | "channel.checkout.cancel" | "channel.dash.profile" | "channel.dash.init" | "channel.dash.waitlist.status" | "channel.dash.waitlist.form" | "channel.dash.waitlist.submit" | "channel.dash.plans" | "channel.dash.directory.regions" | "channel.dash.directory.browse" | "channel.dash.directory.get" | "channel.dash.leads.capture" | "channel.dash.lead_portal.my_quotes" | "channel.dash.lead_portal.request_link" | "growth.public_workspace.leads.capture.channel";
1354
1365
  interface ChannelRequestObservation {
1355
1366
  operation: ChannelOperation;
1356
1367
  method: string;
@@ -1442,6 +1453,11 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
1442
1453
  readonly dash: {
1443
1454
  readonly profile: () => Promise<DashProfileResponse>;
1444
1455
  readonly init: () => Promise<DashInitResponse>;
1456
+ readonly waitlist: {
1457
+ readonly status: () => Promise<WaitlistPublicStatus>;
1458
+ readonly form: () => Promise<WaitlistPublicFormResponse>;
1459
+ readonly submit: (input: WaitlistSubmission, mutation?: ChannelMutationOptions) => Promise<WaitlistAcknowledgement>;
1460
+ };
1445
1461
  readonly plans: () => Promise<DashPlansResponse>;
1446
1462
  readonly directory: {
1447
1463
  readonly regions: () => Promise<ListResponse<DashDirectoryRegion>>;
@@ -1508,6 +1524,7 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
1508
1524
  readonly setAddresses: (orderId: string, input: CheckoutAddressesInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
1509
1525
  readonly setFulfillment: (orderId: string, input: CheckoutFulfillmentInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
1510
1526
  readonly pay: (orderId: string, input: CheckoutPayInput, mutation?: ChannelMutationOptions) => Promise<CheckoutPayResponse>;
1527
+ readonly cancel: (orderId: string, input: CheckoutCancelInput, mutation?: ChannelMutationOptions) => Promise<void>;
1511
1528
  };
1512
1529
  readonly reviews: {
1513
1530
  readonly list: (params?: ChannelListParams) => Promise<ListResponse<Review>>;
@@ -1631,7 +1648,7 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
1631
1648
  readonly delete: (addressId: string, mutation?: ChannelMutationOptions) => Promise<{
1632
1649
  status?: string;
1633
1650
  }>;
1634
- readonly setDefault: (addressId: string, kind: SavedAddressDefaultKind, mutation?: ChannelMutationOptions) => Promise<SavedAddressResponse>;
1651
+ readonly setDefault: (addressId: string, mutation?: ChannelMutationOptions) => Promise<SavedAddressResponse>;
1635
1652
  };
1636
1653
  readonly paymentMethods: {
1637
1654
  readonly list: () => Promise<ListResponse<SavedPaymentMethod>>;
@@ -1666,4 +1683,4 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
1666
1683
  };
1667
1684
  };
1668
1685
 
1669
- export { type AddCartItemInput, type BlogPost, type BlogPostResponse, type CartResponse, type CatalogBrand, type CatalogCategory, type CatalogCollection, type CatalogProduct, type CatalogProductsResponse, ChannelAPIError, type ChannelCheckoutStatusParams, ChannelConfigurationError, type ChannelGeo, type ChannelInvoiceListParams, type ChannelLeadInput, type ChannelListParams, type ChannelMutationOptions, type ChannelOperation, type ChannelPing, type ChannelProductListParams, type ChannelRequestObservation, type ChannelRequestObserver, type ChannelRequestOutcome, type ChannelRetryPolicy, type ChannelSiteResolveParams, type ChannelSubscriptionCancelParams, type ChannelSubscriptionListParams, type ChannelVisitor, type CheckoutAddress, type CheckoutAddressesInput, type CheckoutCustomerInput, type CheckoutFulfillmentInput, type CheckoutOptions, type CheckoutPayInput, type CheckoutPayResponse, type CheckoutStatus, type CheckoutStatusResponse, type CreateChannelClientOptions, type Customer, type CustomerAuthSession, type CustomerResponse, type CustomerSecurityActivity, type CustomerSecurityActivityPage, type CustomerSession, type CustomerSignupResponse, DEFAULT_CHANNEL_API_URL, type DashBrandingInfo, type DashDirectoryEntry, type DashDirectoryListParams, type DashDirectoryProfile, type DashDirectoryProfileResponse, type DashDirectoryRegion, type DashInitResponse, type DashLead, type DashLeadPortalMatch, type DashLeadPortalMovingSummary, type DashLeadPortalRequest, type DashLeadPortalRequestLinkInput, type DashLeadPortalRequestLinkResponse, type DashLeadPortalRequestStatus, type DashLeadPortalView, type DashLocaleInfo, type DashPlan, type DashPlanPricing, type DashPlanRegion, type DashPlansResponse, type DashProfileResponse, type DashPublicPage, type DashPublicProfileInfo, type DashTenantInfo, type DiningAvailability, type DiningAvailabilityRule, type DiningComboChoice, type DiningComboGroup, type DiningItemSize, type DiningMenu, type DiningMenuItem, type DiningModifier, type DiningModifierGroup, type DiningOffer, type DiningOfferBadge, type GivingEntry, type GivingIntent, type GivingIntentListResponse, type LeadResponse, type LightInitResponse, type ListResponse, type Menu, type MenuItem, type MenuResponse, type MergeCartInput, type Order, type OrderItem, type OrderSummary, type PaymentCollectionAvailability, type PaymentLinkCheckoutInput, type PaymentLinkCheckoutResponse, type PaymentLinkRedemptionStatus, type PaymentLinkRedemptionStatusResponse, type PaymentMethodConfirmInput, type PaymentMethodMutationResponse, type PaymentMethodOption, type PaymentMethodSetupInput, type PaymentMethodSetupResult, type PaymentReadiness, type PrintBranding, type PrintIntakeInput, type PrintIntakeLimits, type PrintJob, type PrintJobFile, type PrintOptionsSelection, type PrintPaperSize, type PrintPerPagePricing, type PrintPriceBreakdown, type PrintPriceLine, type PrintPricing, type PrintPricingOption, type PrintQuoteResponse, type PrintSettingsResponse, type Product, type ProductAsset, type PublicPage, type PublicPageSummary, type PublicPaymentLink, type PublicPaymentLinkResponse, type PublicSubmitReviewInput, type PublicWorkspaceInit, type Review, type ReviewSummaryResponse, type SavedAddress, type SavedAddressDefaultKind, type SavedAddressInput, type SavedAddressResponse, type SavedAddressUpdateInput, type SavedPaymentMethod, type SendCodeResponse, type ShippingMethodOption, type SiteDocument, type SiteGatedDocument, type SiteRef, type SiteResolvedDocument, type SiteSubject, type StartGivingInput, type StartGivingResponse, type StartSubscriptionInput, type SubscriptionAgreement, type SubscriptionAgreementResponse, type SubscriptionInvoice, type SubscriptionInvoiceListResponse, type SubscriptionInvoiceResponse, type SubscriptionListResponse, type SubscriptionPlanListResponse, type SubscriptionPlanOffer, type SubscriptionPlanResponse, type SubscriptionSourceDisplay, type SubscriptionSourceResponse, type ThemeResponse, type UpdateCartItemInput, type WaitlistPublicStatus, type WorkspaceInfo, createChannelClient, isChannelAPIError, isChannelConfigurationError };
1686
+ export { type AddCartItemInput, type BlogPost, type BlogPostResponse, type CartResponse, type CatalogBrand, type CatalogCategory, type CatalogCollection, type CatalogProduct, type CatalogProductsResponse, ChannelAPIError, type ChannelCheckoutStatusParams, ChannelConfigurationError, type ChannelGeo, type ChannelInvoiceListParams, type ChannelLeadInput, type ChannelListParams, type ChannelMutationOptions, type ChannelOperation, type ChannelPing, type ChannelProductListParams, type ChannelRequestObservation, type ChannelRequestObserver, type ChannelRequestOutcome, type ChannelRetryPolicy, type ChannelSiteResolveParams, type ChannelSubscriptionCancelParams, type ChannelSubscriptionListParams, type ChannelVisitor, type CheckoutAddress, type CheckoutAddressesInput, type CheckoutCancelInput, type CheckoutCustomerInput, type CheckoutFulfillmentInput, type CheckoutOptions, type CheckoutPayInput, type CheckoutPayResponse, type CheckoutStatus, type CheckoutStatusResponse, type CreateChannelClientOptions, type Customer, type CustomerAuthSession, type CustomerResponse, type CustomerSecurityActivity, type CustomerSecurityActivityPage, type CustomerSession, type CustomerSignupResponse, DEFAULT_CHANNEL_API_URL, type DashBrandingInfo, type DashDirectoryEntry, type DashDirectoryListParams, type DashDirectoryProfile, type DashDirectoryProfileResponse, type DashDirectoryRegion, type DashInitResponse, type DashLead, type DashLeadPortalMatch, type DashLeadPortalMovingSummary, type DashLeadPortalRequest, type DashLeadPortalRequestLinkInput, type DashLeadPortalRequestLinkResponse, type DashLeadPortalRequestStatus, type DashLeadPortalView, type DashLocaleInfo, type DashPlan, type DashPlanPricing, type DashPlanRegion, type DashPlansResponse, type DashProfileResponse, type DashPublicPage, type DashPublicProfileInfo, type DashTenantInfo, type DiningAvailability, type DiningAvailabilityRule, type DiningComboChoice, type DiningComboGroup, type DiningItemSize, type DiningMenu, type DiningMenuItem, type DiningModifier, type DiningModifierGroup, type DiningOffer, type DiningOfferBadge, type GivingEntry, type GivingIntent, type GivingIntentListResponse, type LeadResponse, type LightInitResponse, type ListResponse, type Menu, type MenuItem, type MenuResponse, type MergeCartInput, type Order, type OrderItem, type OrderSummary, type PaymentCollectionAvailability, type PaymentLinkCheckoutInput, type PaymentLinkCheckoutResponse, type PaymentLinkRedemptionStatus, type PaymentLinkRedemptionStatusResponse, type PaymentMethodConfirmInput, type PaymentMethodMutationResponse, type PaymentMethodOption, type PaymentMethodSetupInput, type PaymentMethodSetupResult, type PaymentReadiness, type PrintBranding, type PrintIntakeInput, type PrintIntakeLimits, type PrintJob, type PrintJobFile, type PrintOptionsSelection, type PrintPaperSize, type PrintPerPagePricing, type PrintPriceBreakdown, type PrintPriceLine, type PrintPricing, type PrintPricingOption, type PrintQuoteResponse, type PrintSettingsResponse, type Product, type ProductAsset, type PublicPage, type PublicPageSummary, type PublicPaymentLink, type PublicPaymentLinkResponse, type PublicSubmitReviewInput, type PublicWorkspaceInit, type Review, type ReviewSummaryResponse, type SavedAddress, type SavedAddressInput, type SavedAddressResponse, type SavedAddressUpdateInput, type SavedPaymentMethod, type SendCodeResponse, type ShippingMethodOption, type SiteDocument, type SiteGatedDocument, type SiteRef, type SiteResolvedDocument, type SiteSubject, type StartGivingInput, type StartGivingResponse, type StartSubscriptionInput, type SubscriptionAgreement, type SubscriptionAgreementResponse, type SubscriptionInvoice, type SubscriptionInvoiceListResponse, type SubscriptionInvoiceResponse, type SubscriptionListResponse, type SubscriptionPlanListResponse, type SubscriptionPlanOffer, type SubscriptionPlanResponse, type SubscriptionSourceDisplay, type SubscriptionSourceResponse, type ThemeResponse, type UpdateCartItemInput, type WaitlistAcknowledgement, type WaitlistPublicFormResponse, type WaitlistPublicStatus, type WaitlistSubmission, type WorkspaceInfo, createChannelClient, isChannelAPIError, isChannelConfigurationError };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-UX7PRF5Z.js';
2
- export { CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelConfigurationError, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, isChannelConfigurationError, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './chunk-P3HX34X7.js';
1
+ export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-E5J5UOPS.js';
2
+ export { CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelConfigurationError, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, isChannelConfigurationError, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './chunk-XPO7C3DW.js';
package/dist/next.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { createChannelClient, Order, AddCartItemInput, CartResponse, CheckoutOptions, ChannelCheckoutStatusParams, CheckoutStatusResponse, CheckoutCustomerInput, CheckoutAddressesInput, CheckoutFulfillmentInput, CheckoutPayInput, ChannelMutationOptions, CheckoutPayResponse, CreateChannelClientOptions, ChannelPing, ChannelVisitor, ChannelGeo, PaymentCollectionAvailability, DashProfileResponse, DashInitResponse, DashPlansResponse, ListResponse, DashDirectoryRegion, DashDirectoryListParams, DashDirectoryEntry, DashDirectoryProfileResponse, ChannelLeadInput, DashLead, DashLeadPortalRequestLinkInput, DashLeadPortalRequestLinkResponse, DashLeadPortalView, ChannelSiteResolveParams, SiteDocument, PublicWorkspaceInit, LightInitResponse, ChannelListParams, PublicPageSummary, PublicPage, ChannelProductListParams, Product, ProductAsset, CatalogCategory, CatalogProductsResponse, CatalogCollection, CatalogBrand, UpdateCartItemInput, MergeCartInput, Review, ReviewSummaryResponse, PublicSubmitReviewInput, ThemeResponse, MenuResponse, BlogPost, BlogPostResponse, GivingEntry, StartGivingInput, StartGivingResponse, SubscriptionPlanListResponse, SubscriptionPlanResponse, PublicPaymentLinkResponse, PaymentLinkCheckoutInput, PaymentLinkCheckoutResponse, PaymentLinkRedemptionStatusResponse, PrintSettingsResponse, PrintOptionsSelection, PrintQuoteResponse, PrintIntakeInput, PrintJob, DiningMenu, CustomerSignupResponse, SendCodeResponse, CustomerSession, CustomerResponse, CustomerAuthSession, CustomerSecurityActivityPage, OrderSummary, SavedAddress, SavedAddressResponse, SavedAddressInput, SavedAddressUpdateInput, SavedAddressDefaultKind, SavedPaymentMethod, PaymentMethodSetupInput, PaymentMethodSetupResult, PaymentMethodConfirmInput, PaymentMethodMutationResponse, StartSubscriptionInput, SubscriptionAgreementResponse, ChannelSubscriptionListParams, SubscriptionListResponse, SubscriptionSourceResponse, ChannelSubscriptionCancelParams, ChannelInvoiceListParams, SubscriptionInvoiceListResponse, SubscriptionInvoiceResponse, GivingIntentListResponse, LeadResponse } from './index.js';
1
+ import { createChannelClient, Order, AddCartItemInput, CartResponse, CheckoutOptions, ChannelCheckoutStatusParams, CheckoutStatusResponse, CheckoutCustomerInput, CheckoutAddressesInput, CheckoutFulfillmentInput, CheckoutPayInput, ChannelMutationOptions, CheckoutPayResponse, CheckoutCancelInput, CreateChannelClientOptions, ChannelPing, ChannelVisitor, ChannelGeo, PaymentCollectionAvailability, DashProfileResponse, DashInitResponse, WaitlistPublicStatus, WaitlistPublicFormResponse, WaitlistSubmission, WaitlistAcknowledgement, DashPlansResponse, ListResponse, DashDirectoryRegion, DashDirectoryListParams, DashDirectoryEntry, DashDirectoryProfileResponse, ChannelLeadInput, DashLead, DashLeadPortalRequestLinkInput, DashLeadPortalRequestLinkResponse, DashLeadPortalView, ChannelSiteResolveParams, SiteDocument, PublicWorkspaceInit, LightInitResponse, ChannelListParams, PublicPageSummary, PublicPage, ChannelProductListParams, Product, ProductAsset, CatalogCategory, CatalogProductsResponse, CatalogCollection, CatalogBrand, UpdateCartItemInput, MergeCartInput, Review, ReviewSummaryResponse, PublicSubmitReviewInput, ThemeResponse, MenuResponse, BlogPost, BlogPostResponse, GivingEntry, StartGivingInput, StartGivingResponse, SubscriptionPlanListResponse, SubscriptionPlanResponse, PublicPaymentLinkResponse, PaymentLinkCheckoutInput, PaymentLinkCheckoutResponse, PaymentLinkRedemptionStatusResponse, PrintSettingsResponse, PrintOptionsSelection, PrintQuoteResponse, PrintIntakeInput, PrintJob, DiningMenu, CustomerSignupResponse, SendCodeResponse, CustomerSession, CustomerResponse, CustomerAuthSession, CustomerSecurityActivityPage, OrderSummary, SavedAddress, SavedAddressResponse, SavedAddressInput, SavedAddressUpdateInput, SavedPaymentMethod, PaymentMethodSetupInput, PaymentMethodSetupResult, PaymentMethodConfirmInput, PaymentMethodMutationResponse, StartSubscriptionInput, SubscriptionAgreementResponse, ChannelSubscriptionListParams, SubscriptionListResponse, SubscriptionSourceResponse, ChannelSubscriptionCancelParams, ChannelInvoiceListParams, SubscriptionInvoiceListResponse, SubscriptionInvoiceResponse, GivingIntentListResponse, LeadResponse } from './index.js';
2
2
  import { ChannelWebhookEventDataMap, ChannelWebhookEvent } from './webhooks.js';
3
3
 
4
4
  /**
@@ -243,6 +243,10 @@ declare function createCart(options: CreateCartOptions): {
243
243
  }, attempt: ChannelMutationOptions & {
244
244
  idempotencyKey: string;
245
245
  }) => Promise<CheckoutPayResponse>;
246
+ /** Expire the hosted provider session before returning the cart to editing. */
247
+ readonly cancel: (orderId: string, input: CheckoutCancelInput, attempt: ChannelMutationOptions & {
248
+ idempotencyKey: string;
249
+ }) => Promise<void>;
246
250
  };
247
251
  };
248
252
  type CartKit = ReturnType<typeof createCart>;
@@ -288,6 +292,11 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
288
292
  readonly dash: {
289
293
  readonly profile: () => Promise<DashProfileResponse>;
290
294
  readonly init: () => Promise<DashInitResponse>;
295
+ readonly waitlist: {
296
+ readonly status: () => Promise<WaitlistPublicStatus>;
297
+ readonly form: () => Promise<WaitlistPublicFormResponse>;
298
+ readonly submit: (input: WaitlistSubmission, mutation?: ChannelMutationOptions) => Promise<WaitlistAcknowledgement>;
299
+ };
291
300
  readonly plans: () => Promise<DashPlansResponse>;
292
301
  readonly directory: {
293
302
  readonly regions: () => Promise<ListResponse<DashDirectoryRegion>>;
@@ -354,6 +363,7 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
354
363
  readonly setAddresses: (orderId: string, input: CheckoutAddressesInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
355
364
  readonly setFulfillment: (orderId: string, input: CheckoutFulfillmentInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
356
365
  readonly pay: (orderId: string, input: CheckoutPayInput, mutation?: ChannelMutationOptions) => Promise<CheckoutPayResponse>;
366
+ readonly cancel: (orderId: string, input: CheckoutCancelInput, mutation?: ChannelMutationOptions) => Promise<void>;
357
367
  };
358
368
  readonly reviews: {
359
369
  readonly list: (params?: ChannelListParams) => Promise<ListResponse<Review>>;
@@ -466,7 +476,7 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
466
476
  readonly delete: (addressId: string, mutation?: ChannelMutationOptions) => Promise<{
467
477
  status?: string;
468
478
  }>;
469
- readonly setDefault: (addressId: string, kind: SavedAddressDefaultKind, mutation?: ChannelMutationOptions) => Promise<SavedAddressResponse>;
479
+ readonly setDefault: (addressId: string, mutation?: ChannelMutationOptions) => Promise<SavedAddressResponse>;
470
480
  };
471
481
  readonly paymentMethods: {
472
482
  readonly list: () => Promise<ListResponse<SavedPaymentMethod>>;
package/dist/next.js CHANGED
@@ -1,3 +1,3 @@
1
- export { CHANNEL_CATALOG_CACHE_TAG, CHANNEL_SITE_CACHE_TAG, cartCookie, createCart, createChannelWebhookRoute, createCustomerSession, createNextChannelClient, defaultChannelCacheTags, safePublishedPath, sessionCookie } from './chunk-BANE7WSW.js';
2
- import './chunk-UX7PRF5Z.js';
3
- import './chunk-P3HX34X7.js';
1
+ export { CHANNEL_CATALOG_CACHE_TAG, CHANNEL_SITE_CACHE_TAG, cartCookie, createCart, createChannelWebhookRoute, createCustomerSession, createNextChannelClient, defaultChannelCacheTags, safePublishedPath, sessionCookie } from './chunk-HOR5MOYI.js';
2
+ import './chunk-E5J5UOPS.js';
3
+ import './chunk-XPO7C3DW.js';
@@ -9,7 +9,7 @@
9
9
  * PII-free fields; fetch the detail back through the channel client. Data POSTed
10
10
  * to your server can never be reached by a GDPR erasure on ours.
11
11
  */
12
- declare const CHANNEL_WEBHOOK_EVENT_TYPES: readonly ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
12
+ declare const CHANNEL_WEBHOOK_EVENT_TYPES: readonly ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "fulfillment.shipped", "fulfillment.delivered", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
13
13
  type ChannelWebhookEventType = (typeof CHANNEL_WEBHOOK_EVENT_TYPES)[number];
14
14
  interface OrderEventData {
15
15
  order_id: string;
@@ -20,6 +20,16 @@ interface OrderEventData {
20
20
  total_cents: number;
21
21
  created_at: string;
22
22
  }
23
+ interface FulfillmentEventData {
24
+ fulfillment_id: string;
25
+ order_id: string;
26
+ status: string;
27
+ tracking_number?: string;
28
+ tracking_url?: string;
29
+ carrier?: string;
30
+ shipped_at?: string;
31
+ delivered_at?: string;
32
+ }
23
33
  interface LeadCreatedEventData {
24
34
  lead_id: string;
25
35
  source: string;
@@ -72,6 +82,8 @@ interface ChannelWebhookEventDataMap {
72
82
  "order.updated": OrderEventData;
73
83
  "order.cancelled": OrderEventData;
74
84
  "order.refunded": OrderEventData;
85
+ "fulfillment.shipped": FulfillmentEventData;
86
+ "fulfillment.delivered": FulfillmentEventData;
75
87
  "lead.created": LeadCreatedEventData;
76
88
  "review.submitted": ReviewSubmittedEventData;
77
89
  "review.published": ReviewPublishedEventData;
@@ -181,4 +193,4 @@ interface ParseChannelWebhookEventOptions {
181
193
  */
182
194
  declare function parseChannelWebhookEvent(request: Request, options: ParseChannelWebhookEventOptions): Promise<ParsedChannelWebhookEvent>;
183
195
 
184
- export { type AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, type ChannelWebhookEvent, type ChannelWebhookEventDataMap, type ChannelWebhookEventType, type ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, type LeadCreatedEventData, type MenuUpdatedEventData, type OrderEventData, type PagePublishedEventData, type ParseChannelWebhookEventOptions, type ParsedChannelWebhookEvent, type ProductEventData, type ReviewPublishedEventData, type ReviewSubmittedEventData, type UnknownChannelWebhookEvent, type VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature };
196
+ export { type AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, type ChannelWebhookEvent, type ChannelWebhookEventDataMap, type ChannelWebhookEventType, type ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, type FulfillmentEventData, type LeadCreatedEventData, type MenuUpdatedEventData, type OrderEventData, type PagePublishedEventData, type ParseChannelWebhookEventOptions, type ParsedChannelWebhookEvent, type ProductEventData, type ReviewPublishedEventData, type ReviewSubmittedEventData, type UnknownChannelWebhookEvent, type VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature };
package/dist/webhooks.js CHANGED
@@ -1 +1 @@
1
- export { CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './chunk-P3HX34X7.js';
1
+ export { CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './chunk-XPO7C3DW.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c1m-public/channel-client",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Typed server-side client for the MML headless Channel API",
@@ -71,8 +71,8 @@
71
71
  "typescript": "5.9.3",
72
72
  "vitest": "^4.1.4",
73
73
  "zod": "^4.3.6",
74
- "@c1m-public/transport": "0.0.0",
75
- "@c1m-public/resilience": "0.1.0"
74
+ "@c1m-public/resilience": "0.1.0",
75
+ "@c1m-public/transport": "0.0.0"
76
76
  },
77
77
  "scripts": {
78
78
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",