@c1m-public/channel-client 0.38.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -323,10 +323,12 @@ maintenance or private), the owner's `lifecycle`, `visibility` and
323
323
  `site_enabled`. Decide a request from it and never recompute availability:
324
324
 
325
325
  ```ts
326
- import { normalizeSignals, siteDecision } from "@c1m-public/channel-client/site";
326
+ import { normalizeSignals, siteDecision, siteResponse } from "@c1m-public/channel-client/site";
327
327
 
328
328
  const decision = siteDecision(normalizeSignals(init), pathname, { exempt: ["/account"] });
329
329
  // serve | no-site | inactive | private | gate-page | redirect | rewrite
330
+ const response = siteResponse(decision);
331
+ // serve | redirect | rewrite (path, status, retryAfter?)
330
332
  ```
331
333
 
332
334
  The order is the server's: no public site, then an inactive owner, then the
@@ -336,6 +338,13 @@ sessions checks membership before showing its private page. A backend that
336
338
  predates `signals` is read from its top-level `gate` as an active, public
337
339
  site.
338
340
 
341
+ `siteResponse` is what a proxy does with a decision. Only `serve` and
342
+ `gate-page` pass through. No site rewrites to `UNAVAILABLE_PATH`
343
+ (`/unavailable`) with 404, an inactive owner to the same path with 503, and a
344
+ private site to `PRIVATE_PATH` (`/private`) with 403. A waitlist or
345
+ maintenance gate never takes over those two paths, so each page should 404
346
+ itself when the site is available.
347
+
339
348
  `SITE_MODE_CHOICES`, `siteModeChoice`, `withSiteModeChoice`,
340
349
  `describeLiveGate`, `toDateTimeLocal` and `fromDateTimeLocal` are the shared
341
350
  pieces of a site-mode settings form.
@@ -1,4 +1,4 @@
1
- import { createChannelClient } from './chunk-LFHMWK6A.js';
1
+ import { createChannelClient } from './chunk-FBTHKZOP.js';
2
2
  import 'server-only';
3
3
 
4
4
  function narrow(client) {
@@ -6,7 +6,7 @@ function narrow(client) {
6
6
  ping: client.ping,
7
7
  geo: client.geo,
8
8
  dash: client.dash,
9
- audience: client.audience,
9
+ waitlist: client.waitlist,
10
10
  assetUrl: client.assetUrl,
11
11
  withVisitor: (visitor) => narrow(client.withVisitor(visitor))
12
12
  };
@@ -294,8 +294,8 @@ function createChannelClient(options) {
294
294
  { cache: "no-store" }
295
295
  )
296
296
  },
297
- /** Confirmation and unsubscribe links from waitlist emails. */
298
- audience: {
297
+ /** Confirmation and unsubscribe links from waitlist emails (any scope). */
298
+ waitlist: {
299
299
  verify: (token2) => linkRequest("/verify", { token: required(token2, "token") }),
300
300
  unsubscribe: (key) => linkRequest("/unsubscribe", { key: required(key, "key") })
301
301
  },
@@ -1,4 +1,4 @@
1
- import { isChannelAPIError, createChannelClient } from './chunk-LFHMWK6A.js';
1
+ import { isChannelAPIError, createChannelClient } from './chunk-FBTHKZOP.js';
2
2
  import { parseChannelWebhookEvent, isChannelWebhookVerificationError, isChannelWebhookEventType, ChannelConfigurationError } from './chunk-XPO7C3DW.js';
3
3
  import 'server-only';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import { DashChannelClient } from './dash.js';
2
2
  import { CreateNextChannelClientOptions } from './next.js';
3
3
  import './index.js';
4
- import './types-CPdlxf5p.js';
4
+ import './types-CgleEp97.js';
5
5
  import './webhooks.js';
6
6
 
7
7
  /**
package/dist/dash-next.js CHANGED
@@ -1,6 +1,6 @@
1
- import { createNextChannelClient } from './chunk-GPSFEKWL.js';
2
- import { narrow } from './chunk-VARU5HM6.js';
3
- import './chunk-LFHMWK6A.js';
1
+ import { createNextChannelClient } from './chunk-GWOZY23T.js';
2
+ import { narrow } from './chunk-BOZTNLMF.js';
3
+ import './chunk-FBTHKZOP.js';
4
4
  import './chunk-XPO7C3DW.js';
5
5
  import 'server-only';
6
6
 
package/dist/dash.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createChannelClient, ChannelVisitor, CreateChannelClientOptions } from './index.js';
2
- import './types-CPdlxf5p.js';
2
+ import './types-CgleEp97.js';
3
3
  import './webhooks.js';
4
4
 
5
5
  /**
@@ -13,10 +13,10 @@ import './webhooks.js';
13
13
  *
14
14
  * `ping` and `geo` are deliberately included: both are scope-agnostic on the
15
15
  * door (the credential self-check must answer for either scope, and geo lets
16
- * a dash site localise pricing). `audience` is the scope-free email-link
17
- * surface every waitlist site needs.
16
+ * a dash site localise pricing). `waitlist` is the scope-free email-link
17
+ * surface (verify, unsubscribe) every waitlist site needs.
18
18
  */
19
- type DashChannelClient = Pick<ReturnType<typeof createChannelClient>, "ping" | "geo" | "dash" | "audience" | "assetUrl"> & {
19
+ type DashChannelClient = Pick<ReturnType<typeof createChannelClient>, "ping" | "geo" | "dash" | "waitlist" | "assetUrl"> & {
20
20
  /** Request-scoped clone carrying signed visitor metadata (see ChannelVisitor). */
21
21
  withVisitor(visitor: ChannelVisitor): DashChannelClient;
22
22
  };
package/dist/dash.js CHANGED
@@ -1,3 +1,3 @@
1
- export { createDashChannelClient, narrow as narrowToDash } from './chunk-VARU5HM6.js';
2
- import './chunk-LFHMWK6A.js';
1
+ export { createDashChannelClient, narrow as narrowToDash } from './chunk-BOZTNLMF.js';
2
+ import './chunk-FBTHKZOP.js';
3
3
  import './chunk-XPO7C3DW.js';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { i as ChannelPing, j as ChannelGeo, P as PaymentCollectionAvailability, W as WaitlistVerification, k as WaitlistUnsubscription, D as DashProfileResponse, l as DashInitResponse, m as WaitlistGateStatus, n as WaitlistFormSettings, o as WaitlistSubmission, p as WaitlistAcknowledgement, q as DashPlansResponse, L as ListResponse, r as DashDirectoryRegion, s as DashDirectoryEntry, t as DashDirectoryProfileResponse, u as DashLead, v as DashLeadPortalRequestLinkInput, w as DashLeadPortalRequestLinkResponse, x as DashLeadPortalView, y as DashMovingQuoteInput, z as DashMovingQuoteReceipt, B as DashMovingAddressList, E as DashMovingAddress, F as DashMovingDistance, S as SiteDocument, G as PublicWorkspaceInit, H as LightInitResponse, I as PublicPageSummary, J as PublicPage, K as Product, M as ProductAsset, N as SlotsResponse, Q as DownloadResponse, aV as BeginUploadInput, U as UploadTicket, aW as CompleteUploadInput, R as ArtworkMutationReceipt, aX as DecisionInput, T as PublicConfiguration, V as PublicConfigurationQuoteInput, X as PublicConfigurationQuote, Y as CatalogCategory, Z as CatalogProductsResponse, _ as CatalogCollection, $ as CatalogBrand, a0 as CartLookupResponse, A as AddCartItemInput, C as CartResponse, a1 as UpdateCartItemInput, a2 as MergeCartInput, a as CheckoutOptions, b as CheckoutStatusResponse, c as CheckoutCustomerInput, d as CheckoutAddressesInput, e as CheckoutFulfillmentInput, f as CheckoutPayInput, g as CheckoutPayResponse, h as CheckoutCancelInput, a3 as Review, a4 as ReviewSummaryResponse, a5 as PublicSubmitReviewInput, a6 as ThemeResponse, a7 as MenuResponse, a8 as BlogPost, a9 as BlogPostResponse, aa as GivingEntry, ab as StartGivingInput, ac as StartGivingResponse, ad as SubscriptionPlanListResponse, ae as SubscriptionPlanResponse, af as BookingService, ag as BookingServiceResponse, ah as BookingAvailabilityParams, ai as BookingAvailabilityResponse, aj as BookingQuoteParams, ak as BookingQuoteResponse, al as CreateBookingHoldInput, am as BookingHoldResponse, an as PublicPaymentLinkResponse, ao as PaymentLinkCheckoutInput, ap as PaymentLinkCheckoutResponse, aq as PaymentLinkRedemptionStatusResponse, ar as PrintSettingsResponse, as as PrintOptionsSelection, at as PrintQuoteResponse, au as PrintIntakeInput, av as PrintJob, aw as DiningMenu, ax as CustomerSignupResponse, ay as SendCodeResponse, az as CustomerSession, aA as CustomerResponse, aB as CustomerAuthSession, aC as CustomerSecurityActivityPage, O as Order, aD as OrderSummary, aE as SavedAddress, aF as SavedAddressResponse, aG as SavedAddressInput, aH as SavedAddressUpdateInput, aI as SavedPaymentMethod, aJ as PaymentMethodSetupInput, aK as PaymentMethodSetupResult, aL as PaymentMethodConfirmInput, aM as PaymentMethodMutationResponse, aN as StartSubscriptionInput, aO as SubscriptionAgreementResponse, aP as SubscriptionListResponse, aQ as SubscriptionSourceResponse, aR as SubscriptionInvoiceListResponse, aS as SubscriptionInvoiceResponse, aT as GivingIntentListResponse, aU as LeadResponse, aY as Slot } from './types-CPdlxf5p.js';
2
- export { aZ as BookingAvailability, a_ as BookingCancellationPolicy, a$ as BookingCustomerInput, b0 as BookingFreeSpan, b1 as BookingHold, b2 as BookingIntakeQuestion, b3 as BookingPriceQuote, b4 as BookingServicePricing, b5 as BookingTimeRange, b6 as CatalogProduct, b7 as CheckoutAddress, b8 as CheckoutStatus, b9 as ConfigDocument, ba as ConfigQuote, bb as ConfigSelectionRequest, bc as Customer, bd as CustomerSecurityActivity, be as DashBrandingInfo, bf as DashDirectoryProfile, bg as DashLeadPortalMatch, bh as DashLeadPortalMovingSummary, bi as DashLeadPortalRequest, bj as DashLeadPortalRequestStatus, bk as DashLocaleInfo, bl as DashPlan, bm as DashPlanPricing, bn as DashPlanRegion, bo as DashPublicPage, bp as DashPublicProfileInfo, bq as DashTenantInfo, br as DiningAvailability, bs as DiningAvailabilityRule, bt as DiningComboChoice, bu as DiningComboGroup, bv as DiningItemSize, bw as DiningMenuItem, bx as DiningModifier, by as DiningModifierGroup, bz as DiningOffer, bA as DiningOfferBadge, bB as GivingIntent, bC as Menu, bD as MenuItem, bE as OrderItem, bF as PaymentLinkRedemptionStatus, bG as PaymentMethodOption, bH as PaymentReadiness, bI as PrintBranding, bJ as PrintIntakeLimits, bK as PrintJobFile, bL as PrintPaperSize, bM as PrintPerPagePricing, bN as PrintPriceBreakdown, bO as PrintPriceLine, bP as PrintPricing, bQ as PrintPricingOption, bR as ProductLineConfiguration, bS as PublicGate, bT as PublicPaymentLink, bU as PublicSiteSignals, bV as ShippingMethodOption, bW as SiteGatedDocument, bX as SiteRef, bY as SiteResolvedDocument, bZ as SiteSubject, b_ as SubscriptionAgreement, b$ as SubscriptionInvoice, c0 as SubscriptionPlanOffer, c1 as SubscriptionSourceDisplay, c2 as WaitlistAttribution, c3 as WorkspaceInfo } from './types-CPdlxf5p.js';
1
+ import { i as ChannelPing, j as ChannelGeo, P as PaymentCollectionAvailability, W as WaitlistVerification, k as WaitlistUnsubscription, D as DashProfileResponse, l as DashInitResponse, m as WaitlistGateStatus, n as WaitlistFormSettings, o as WaitlistSubmission, p as WaitlistAcknowledgement, q as DashPlansResponse, L as ListResponse, r as DashDirectoryRegion, s as DashDirectoryEntry, t as DashDirectoryProfileResponse, u as DashLead, v as DashLeadPortalRequestLinkInput, w as DashLeadPortalRequestLinkResponse, x as DashLeadPortalView, y as DashMovingQuoteInput, z as DashMovingQuoteReceipt, B as DashMovingAddressList, E as DashMovingAddress, F as DashMovingDistance, S as SiteDocument, G as PublicWorkspaceInit, H as LightInitResponse, I as PublicPageSummary, J as PublicPage, K as Product, M as ProductAsset, N as SlotsResponse, Q as DownloadResponse, aV as BeginUploadInput, U as UploadTicket, aW as CompleteUploadInput, R as ArtworkMutationReceipt, aX as DecisionInput, T as PublicConfiguration, V as PublicConfigurationQuoteInput, X as PublicConfigurationQuote, Y as CatalogCategory, Z as CatalogProductsResponse, _ as CatalogCollection, $ as CatalogBrand, a0 as CartLookupResponse, A as AddCartItemInput, C as CartResponse, a1 as UpdateCartItemInput, a2 as MergeCartInput, a as CheckoutOptions, b as CheckoutStatusResponse, c as CheckoutCustomerInput, d as CheckoutAddressesInput, e as CheckoutFulfillmentInput, f as CheckoutPayInput, g as CheckoutPayResponse, h as CheckoutCancelInput, a3 as Review, a4 as ReviewSummaryResponse, a5 as PublicSubmitReviewInput, a6 as ThemeResponse, a7 as MenuResponse, a8 as BlogPost, a9 as BlogPostResponse, aa as GivingEntry, ab as StartGivingInput, ac as StartGivingResponse, ad as SubscriptionPlanListResponse, ae as SubscriptionPlanResponse, af as BookingService, ag as BookingServiceResponse, ah as BookingAvailabilityParams, ai as BookingAvailabilityResponse, aj as BookingQuoteParams, ak as BookingQuoteResponse, al as CreateBookingHoldInput, am as BookingHoldResponse, an as PublicPaymentLinkResponse, ao as PaymentLinkCheckoutInput, ap as PaymentLinkCheckoutResponse, aq as PaymentLinkRedemptionStatusResponse, ar as PrintSettingsResponse, as as PrintOptionsSelection, at as PrintQuoteResponse, au as PrintIntakeInput, av as PrintJob, aw as DiningMenu, ax as CustomerSignupResponse, ay as SendCodeResponse, az as CustomerSession, aA as CustomerResponse, aB as CustomerAuthSession, aC as CustomerSecurityActivityPage, O as Order, aD as OrderSummary, aE as SavedAddress, aF as SavedAddressResponse, aG as SavedAddressInput, aH as SavedAddressUpdateInput, aI as SavedPaymentMethod, aJ as PaymentMethodSetupInput, aK as PaymentMethodSetupResult, aL as PaymentMethodConfirmInput, aM as PaymentMethodMutationResponse, aN as StartSubscriptionInput, aO as SubscriptionAgreementResponse, aP as SubscriptionListResponse, aQ as SubscriptionSourceResponse, aR as SubscriptionInvoiceListResponse, aS as SubscriptionInvoiceResponse, aT as GivingIntentListResponse, aU as LeadResponse, aY as Slot } from './types-CgleEp97.js';
2
+ export { aZ as BookingAvailability, a_ as BookingCancellationPolicy, a$ as BookingCustomerInput, b0 as BookingFreeSpan, b1 as BookingHold, b2 as BookingIntakeQuestion, b3 as BookingPriceQuote, b4 as BookingServicePricing, b5 as BookingTimeRange, b6 as CatalogProduct, b7 as CheckoutAddress, b8 as CheckoutStatus, b9 as ConfigDocument, ba as ConfigQuote, bb as ConfigSelectionRequest, bc as Customer, bd as CustomerSecurityActivity, be as DashBrandingInfo, bf as DashDirectoryProfile, bg as DashLeadPortalMatch, bh as DashLeadPortalMovingSummary, bi as DashLeadPortalRequest, bj as DashLeadPortalRequestStatus, bk as DashLocaleInfo, bl as DashPlan, bm as DashPlanPricing, bn as DashPlanRegion, bo as DashPublicPage, bp as DashPublicProfileInfo, bq as DashTenantInfo, br as DiningAvailability, bs as DiningAvailabilityRule, bt as DiningComboChoice, bu as DiningComboGroup, bv as DiningItemSize, bw as DiningMenuItem, bx as DiningModifier, by as DiningModifierGroup, bz as DiningOffer, bA as DiningOfferBadge, bB as GivingIntent, bC as Menu, bD as MenuItem, bE as OrderItem, bF as PaymentLinkRedemptionStatus, bG as PaymentMethodOption, bH as PaymentReadiness, bI as PrintBranding, bJ as PrintIntakeLimits, bK as PrintJobFile, bL as PrintPaperSize, bM as PrintPerPagePricing, bN as PrintPriceBreakdown, bO as PrintPriceLine, bP as PrintPricing, bQ as PrintPricingOption, bR as ProductLineConfiguration, bS as PublicGate, bT as PublicPaymentLink, bU as PublicSiteSignals, bV as ShippingMethodOption, bW as SiteGatedDocument, bX as SiteRef, bY as SiteResolvedDocument, bZ as SiteSubject, b_ as SubscriptionAgreement, b$ as SubscriptionInvoice, c0 as SubscriptionPlanOffer, c1 as SubscriptionSourceDisplay, c2 as WaitlistAttribution, c3 as WorkspaceInfo } from './types-CgleEp97.js';
3
3
  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';
4
4
 
5
5
  /**
@@ -161,8 +161,8 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
161
161
  */
162
162
  readonly availability: () => Promise<PaymentCollectionAvailability>;
163
163
  };
164
- /** Confirmation and unsubscribe links from waitlist emails. */
165
- readonly audience: {
164
+ /** Confirmation and unsubscribe links from waitlist emails (any scope). */
165
+ readonly waitlist: {
166
166
  readonly verify: (token: string) => Promise<WaitlistVerification>;
167
167
  readonly unsubscribe: (key: string) => Promise<WaitlistUnsubscription>;
168
168
  };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-LFHMWK6A.js';
1
+ export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-FBTHKZOP.js';
2
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,5 +1,5 @@
1
1
  import { createChannelClient, ChannelCheckoutStatusParams, ChannelMutationOptions, CreateChannelClientOptions, ChannelVisitor, DashDirectoryListParams, ChannelLeadInput, ChannelSiteResolveParams, ChannelListParams, ChannelProductListParams, ArtworkUploadInput, ArtworkCompleteInput, ArtworkProofDecision, RequiredIdempotency, ChannelSubscriptionListParams, ChannelSubscriptionCancelParams, ChannelInvoiceListParams } from './index.js';
2
- import { O as Order, A as AddCartItemInput, C as CartResponse, a as CheckoutOptions, b as CheckoutStatusResponse, c as CheckoutCustomerInput, d as CheckoutAddressesInput, e as CheckoutFulfillmentInput, f as CheckoutPayInput, g as CheckoutPayResponse, h as CheckoutCancelInput, i as ChannelPing, j as ChannelGeo, P as PaymentCollectionAvailability, W as WaitlistVerification, k as WaitlistUnsubscription, D as DashProfileResponse, l as DashInitResponse, m as WaitlistGateStatus, n as WaitlistFormSettings, o as WaitlistSubmission, p as WaitlistAcknowledgement, q as DashPlansResponse, L as ListResponse, r as DashDirectoryRegion, s as DashDirectoryEntry, t as DashDirectoryProfileResponse, u as DashLead, v as DashLeadPortalRequestLinkInput, w as DashLeadPortalRequestLinkResponse, x as DashLeadPortalView, y as DashMovingQuoteInput, z as DashMovingQuoteReceipt, B as DashMovingAddressList, E as DashMovingAddress, F as DashMovingDistance, S as SiteDocument, G as PublicWorkspaceInit, H as LightInitResponse, I as PublicPageSummary, J as PublicPage, K as Product, M as ProductAsset, N as SlotsResponse, Q as DownloadResponse, U as UploadTicket, R as ArtworkMutationReceipt, T as PublicConfiguration, V as PublicConfigurationQuoteInput, X as PublicConfigurationQuote, Y as CatalogCategory, Z as CatalogProductsResponse, _ as CatalogCollection, $ as CatalogBrand, a0 as CartLookupResponse, a1 as UpdateCartItemInput, a2 as MergeCartInput, a3 as Review, a4 as ReviewSummaryResponse, a5 as PublicSubmitReviewInput, a6 as ThemeResponse, a7 as MenuResponse, a8 as BlogPost, a9 as BlogPostResponse, aa as GivingEntry, ab as StartGivingInput, ac as StartGivingResponse, ad as SubscriptionPlanListResponse, ae as SubscriptionPlanResponse, af as BookingService, ag as BookingServiceResponse, ah as BookingAvailabilityParams, ai as BookingAvailabilityResponse, aj as BookingQuoteParams, ak as BookingQuoteResponse, al as CreateBookingHoldInput, am as BookingHoldResponse, an as PublicPaymentLinkResponse, ao as PaymentLinkCheckoutInput, ap as PaymentLinkCheckoutResponse, aq as PaymentLinkRedemptionStatusResponse, ar as PrintSettingsResponse, as as PrintOptionsSelection, at as PrintQuoteResponse, au as PrintIntakeInput, av as PrintJob, aw as DiningMenu, ax as CustomerSignupResponse, ay as SendCodeResponse, az as CustomerSession, aA as CustomerResponse, aB as CustomerAuthSession, aC as CustomerSecurityActivityPage, aD as OrderSummary, aE as SavedAddress, aF as SavedAddressResponse, aG as SavedAddressInput, aH as SavedAddressUpdateInput, aI as SavedPaymentMethod, aJ as PaymentMethodSetupInput, aK as PaymentMethodSetupResult, aL as PaymentMethodConfirmInput, aM as PaymentMethodMutationResponse, aN as StartSubscriptionInput, aO as SubscriptionAgreementResponse, aP as SubscriptionListResponse, aQ as SubscriptionSourceResponse, aR as SubscriptionInvoiceListResponse, aS as SubscriptionInvoiceResponse, aT as GivingIntentListResponse, aU as LeadResponse } from './types-CPdlxf5p.js';
2
+ import { O as Order, A as AddCartItemInput, C as CartResponse, a as CheckoutOptions, b as CheckoutStatusResponse, c as CheckoutCustomerInput, d as CheckoutAddressesInput, e as CheckoutFulfillmentInput, f as CheckoutPayInput, g as CheckoutPayResponse, h as CheckoutCancelInput, i as ChannelPing, j as ChannelGeo, P as PaymentCollectionAvailability, W as WaitlistVerification, k as WaitlistUnsubscription, D as DashProfileResponse, l as DashInitResponse, m as WaitlistGateStatus, n as WaitlistFormSettings, o as WaitlistSubmission, p as WaitlistAcknowledgement, q as DashPlansResponse, L as ListResponse, r as DashDirectoryRegion, s as DashDirectoryEntry, t as DashDirectoryProfileResponse, u as DashLead, v as DashLeadPortalRequestLinkInput, w as DashLeadPortalRequestLinkResponse, x as DashLeadPortalView, y as DashMovingQuoteInput, z as DashMovingQuoteReceipt, B as DashMovingAddressList, E as DashMovingAddress, F as DashMovingDistance, S as SiteDocument, G as PublicWorkspaceInit, H as LightInitResponse, I as PublicPageSummary, J as PublicPage, K as Product, M as ProductAsset, N as SlotsResponse, Q as DownloadResponse, U as UploadTicket, R as ArtworkMutationReceipt, T as PublicConfiguration, V as PublicConfigurationQuoteInput, X as PublicConfigurationQuote, Y as CatalogCategory, Z as CatalogProductsResponse, _ as CatalogCollection, $ as CatalogBrand, a0 as CartLookupResponse, a1 as UpdateCartItemInput, a2 as MergeCartInput, a3 as Review, a4 as ReviewSummaryResponse, a5 as PublicSubmitReviewInput, a6 as ThemeResponse, a7 as MenuResponse, a8 as BlogPost, a9 as BlogPostResponse, aa as GivingEntry, ab as StartGivingInput, ac as StartGivingResponse, ad as SubscriptionPlanListResponse, ae as SubscriptionPlanResponse, af as BookingService, ag as BookingServiceResponse, ah as BookingAvailabilityParams, ai as BookingAvailabilityResponse, aj as BookingQuoteParams, ak as BookingQuoteResponse, al as CreateBookingHoldInput, am as BookingHoldResponse, an as PublicPaymentLinkResponse, ao as PaymentLinkCheckoutInput, ap as PaymentLinkCheckoutResponse, aq as PaymentLinkRedemptionStatusResponse, ar as PrintSettingsResponse, as as PrintOptionsSelection, at as PrintQuoteResponse, au as PrintIntakeInput, av as PrintJob, aw as DiningMenu, ax as CustomerSignupResponse, ay as SendCodeResponse, az as CustomerSession, aA as CustomerResponse, aB as CustomerAuthSession, aC as CustomerSecurityActivityPage, aD as OrderSummary, aE as SavedAddress, aF as SavedAddressResponse, aG as SavedAddressInput, aH as SavedAddressUpdateInput, aI as SavedPaymentMethod, aJ as PaymentMethodSetupInput, aK as PaymentMethodSetupResult, aL as PaymentMethodConfirmInput, aM as PaymentMethodMutationResponse, aN as StartSubscriptionInput, aO as SubscriptionAgreementResponse, aP as SubscriptionListResponse, aQ as SubscriptionSourceResponse, aR as SubscriptionInvoiceListResponse, aS as SubscriptionInvoiceResponse, aT as GivingIntentListResponse, aU as LeadResponse } from './types-CgleEp97.js';
3
3
  import { ChannelWebhookEventDataMap, ChannelWebhookEvent } from './webhooks.js';
4
4
 
5
5
  /**
@@ -290,7 +290,7 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
290
290
  readonly payments: {
291
291
  readonly availability: () => Promise<PaymentCollectionAvailability>;
292
292
  };
293
- readonly audience: {
293
+ readonly waitlist: {
294
294
  readonly verify: (token: string) => Promise<WaitlistVerification>;
295
295
  readonly unsubscribe: (key: string) => Promise<WaitlistUnsubscription>;
296
296
  };
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-GPSFEKWL.js';
2
- import './chunk-LFHMWK6A.js';
1
+ export { CHANNEL_CATALOG_CACHE_TAG, CHANNEL_SITE_CACHE_TAG, cartCookie, createCart, createChannelWebhookRoute, createCustomerSession, createNextChannelClient, defaultChannelCacheTags, safePublishedPath, sessionCookie } from './chunk-GWOZY23T.js';
2
+ import './chunk-FBTHKZOP.js';
3
3
  import './chunk-XPO7C3DW.js';
package/dist/site.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { bX as SiteRef, bS as PublicGate, bU as PublicSiteSignals } from './types-CPdlxf5p.js';
1
+ import { bX as SiteRef, bS as PublicGate, bU as PublicSiteSignals } from './types-CgleEp97.js';
2
2
 
3
3
  /**
4
4
  * Site signals: what a public site serves, decided from the `signals` block
@@ -37,6 +37,10 @@ interface SiteSignals {
37
37
  * links) through `exempt`.
38
38
  */
39
39
  declare const GATE_EXEMPT_PATHS: readonly string[];
40
+ /** Where a site renders "not available" (no site on the plan, or an inactive owner). */
41
+ declare const UNAVAILABLE_PATH = "/unavailable";
42
+ /** Where a site renders "this site is private". */
43
+ declare const PRIVATE_PATH = "/private";
40
44
  /**
41
45
  * Keeps only a gate this client can enforce. An unknown kind is dropped, so a
42
46
  * mode added on the server after a site shipped never breaks that site.
@@ -70,13 +74,34 @@ type SiteDecision = {
70
74
  };
71
75
  /**
72
76
  * Decides one request, in the server's order: no public site, then an
73
- * inactive owner, then the gate. Exempt paths are always served. `private`
74
- * means the public may not see the site; a site with member sessions checks
75
- * membership (site/resolve does) before showing its private page.
77
+ * inactive owner, then the gate. Exempt paths are always served, and a
78
+ * waitlist or maintenance gate never takes over `UNAVAILABLE_PATH` or
79
+ * `PRIVATE_PATH`. `private` means nobody but the owner may see the site:
80
+ * neither this nor site/resolve checks membership, and only a signed editor
81
+ * preview bypasses a private site. `siteResponse` turns the decision into what
82
+ * a proxy does.
76
83
  */
77
84
  declare function siteDecision(signals: SiteSignals, pathname: string, options?: {
78
85
  exempt?: readonly string[];
79
86
  }): SiteDecision;
87
+ /** What a proxy does with a request: serve it, redirect it, or rewrite it in place. */
88
+ type SiteResponse = {
89
+ type: "serve";
90
+ } | {
91
+ type: "redirect";
92
+ path: string;
93
+ } | {
94
+ type: "rewrite";
95
+ path: string;
96
+ status: number;
97
+ retryAfter?: number;
98
+ };
99
+ /**
100
+ * One decision as a response. `serve` and `gate-page` pass through; no site answers
101
+ * 404 and an inactive owner 503 at `UNAVAILABLE_PATH`, a private site 403 at
102
+ * `PRIVATE_PATH`.
103
+ */
104
+ declare function siteResponse(decision: SiteDecision): SiteResponse;
80
105
  /** A site mode as an owner picks it: mode and placement in one choice. */
81
106
  type SiteModeChoice = "off" | "waitlist-page" | "waitlist-block" | "maintenance";
82
107
  interface SiteModeFields {
@@ -98,4 +123,4 @@ declare function toDateTimeLocal(value?: string): string;
98
123
  /** A datetime-local value back to RFC 3339; undefined when empty or invalid. */
99
124
  declare function fromDateTimeLocal(value: string): string | undefined;
100
125
 
101
- export { GATE_EXEMPT_PATHS, PublicGate, PublicSiteSignals, SITE_MODE_CHOICES, type SiteDecision, type SiteGate, type SiteGateKind, type SiteModeChoice, type SiteModeFields, SiteRef, type SiteSignals, describeLiveGate, fromDateTimeLocal, normalizeGate, normalizeSignals, siteDecision, siteModeChoice, toDateTimeLocal, withSiteModeChoice };
126
+ export { GATE_EXEMPT_PATHS, PRIVATE_PATH, PublicGate, PublicSiteSignals, SITE_MODE_CHOICES, type SiteDecision, type SiteGate, type SiteGateKind, type SiteModeChoice, type SiteModeFields, SiteRef, type SiteResponse, type SiteSignals, UNAVAILABLE_PATH, describeLiveGate, fromDateTimeLocal, normalizeGate, normalizeSignals, siteDecision, siteModeChoice, siteResponse, toDateTimeLocal, withSiteModeChoice };
package/dist/site.js CHANGED
@@ -11,6 +11,9 @@ var GATE_EXEMPT_PATHS = [
11
11
  "/cookies",
12
12
  "/legal"
13
13
  ];
14
+ var UNAVAILABLE_PATH = "/unavailable";
15
+ var PRIVATE_PATH = "/private";
16
+ var SITE_STATE_PATHS = [UNAVAILABLE_PATH, PRIVATE_PATH];
14
17
  var DEFAULT_GATE_PATH = { waitlist: "/waitlist", maintenance: "/maintenance" };
15
18
  function safePath(path) {
16
19
  return typeof path === "string" && path.startsWith("/") && !path.startsWith("//") ? path : void 0;
@@ -58,11 +61,29 @@ function siteDecision(signals, pathname, options = {}) {
58
61
  if (!gate || gate.placement !== "page") return { type: "serve" };
59
62
  if (gate.kind === "private") return { type: "private" };
60
63
  if (underPath(pathname, gate.path)) return { type: "gate-page", gate };
64
+ if (SITE_STATE_PATHS.some((prefix) => underPath(pathname, prefix))) return { type: "serve" };
61
65
  if (gate.enforcement === "rewrite") {
62
66
  return { type: "rewrite", path: gate.path, status: gate.status ?? 200, ...gate.retryAfter ? { retryAfter: gate.retryAfter } : {} };
63
67
  }
64
68
  return { type: "redirect", path: gate.path };
65
69
  }
70
+ function siteResponse(decision) {
71
+ switch (decision.type) {
72
+ case "serve":
73
+ case "gate-page":
74
+ return { type: "serve" };
75
+ case "no-site":
76
+ return { type: "rewrite", path: UNAVAILABLE_PATH, status: 404 };
77
+ case "inactive":
78
+ return { type: "rewrite", path: UNAVAILABLE_PATH, status: 503 };
79
+ case "private":
80
+ return { type: "rewrite", path: PRIVATE_PATH, status: 403 };
81
+ case "redirect":
82
+ return { type: "redirect", path: decision.path };
83
+ case "rewrite":
84
+ return { type: "rewrite", path: decision.path, status: decision.status, ...decision.retryAfter ? { retryAfter: decision.retryAfter } : {} };
85
+ }
86
+ }
66
87
  var SITE_MODE_CHOICES = [
67
88
  { value: "off", label: "Live", description: "Visitors see the normal site." },
68
89
  { value: "waitlist-page", label: "Waitlist page", description: "Every storefront page redirects to /waitlist. Account and legal pages stay reachable." },
@@ -89,7 +110,7 @@ function withSiteModeChoice(base, choice) {
89
110
  function describeLiveGate(gate) {
90
111
  if (!gate) return "Live \xB7 visitors see the normal site";
91
112
  if (gate.kind === "maintenance") return "Maintenance \xB7 visitors see the maintenance notice";
92
- if (gate.kind === "private") return "Private \xB7 only members see the site";
113
+ if (gate.kind === "private") return "Private \xB7 only the owner can preview the site";
93
114
  return gate.placement === "page" ? "Waitlist \xB7 every page redirects to /waitlist" : "Waitlist \xB7 the site stays open with a signup form";
94
115
  }
95
116
  function toDateTimeLocal(value) {
@@ -104,4 +125,4 @@ function fromDateTimeLocal(value) {
104
125
  return Number.isNaN(date.getTime()) ? void 0 : date.toISOString();
105
126
  }
106
127
 
107
- export { GATE_EXEMPT_PATHS, SITE_MODE_CHOICES, describeLiveGate, fromDateTimeLocal, normalizeGate, normalizeSignals, siteDecision, siteModeChoice, toDateTimeLocal, withSiteModeChoice };
128
+ export { GATE_EXEMPT_PATHS, PRIVATE_PATH, SITE_MODE_CHOICES, UNAVAILABLE_PATH, describeLiveGate, fromDateTimeLocal, normalizeGate, normalizeSignals, siteDecision, siteModeChoice, siteResponse, toDateTimeLocal, withSiteModeChoice };
@@ -37,17 +37,9 @@ interface Choice {
37
37
  description?: string;
38
38
  key: string;
39
39
  label: string;
40
+ lead_days?: number;
40
41
  price?: PriceChange;
41
42
  }
42
- interface ChoiceGroup {
43
- choices: Choice[];
44
- key: string;
45
- kind: string;
46
- label: string;
47
- max_picks?: number;
48
- min_picks?: number;
49
- required?: boolean;
50
- }
51
43
  interface ChoiceRule {
52
44
  allowed: string[];
53
45
  in: string[];
@@ -59,9 +51,7 @@ interface CompleteUploadInput {
59
51
  cart_token?: string;
60
52
  }
61
53
  interface ConfigDocument {
62
- base_price?: number;
63
- groups: ChoiceGroup[];
64
- inputs?: CustomerInputs;
54
+ fields: ConfigField[];
65
55
  minimum_total?: number;
66
56
  notes?: string;
67
57
  quantity?: QuantityPricing;
@@ -69,6 +59,31 @@ interface ConfigDocument {
69
59
  setup_fee?: number;
70
60
  version: number;
71
61
  }
62
+ interface ConfigField {
63
+ bleed_mm?: number;
64
+ choices?: Choice[];
65
+ formats?: string[];
66
+ key: string;
67
+ label: string;
68
+ max_height_mm?: number;
69
+ max_length?: number;
70
+ max_mb?: number;
71
+ max_picks?: number;
72
+ max_width_mm?: number;
73
+ min_billable_area_mm2?: number;
74
+ min_dpi?: number;
75
+ min_height_mm?: number;
76
+ min_picks?: number;
77
+ min_width_mm?: number;
78
+ multi?: boolean;
79
+ proof_required?: boolean;
80
+ rate_per_m2?: number;
81
+ required?: boolean;
82
+ safe_mm?: number;
83
+ trim_h_mm?: number;
84
+ trim_w_mm?: number;
85
+ type: string;
86
+ }
72
87
  interface ConfigQuote {
73
88
  doc_hash: string;
74
89
  lead_days: number;
@@ -84,14 +99,12 @@ interface ConfigSelection {
84
99
  dimensions?: CustomSize;
85
100
  quantity?: number;
86
101
  text?: Record<string, string>;
87
- turnaround?: string;
88
102
  }
89
103
  interface ConfigSelectionRequest {
90
104
  choices?: Record<string, string[]>;
91
105
  dimensions?: CustomSizeRequest;
92
106
  quantity?: number;
93
107
  text?: Record<string, string>;
94
- turnaround?: string;
95
108
  }
96
109
  interface CustomSize {
97
110
  height_mm: number;
@@ -101,26 +114,11 @@ interface CustomSizeRequest {
101
114
  height_mm?: number;
102
115
  width_mm?: number;
103
116
  }
104
- interface CustomerInputs {
105
- artwork?: ArtworkSlot[];
106
- dimensions?: DimensionPricing;
107
- text?: TextInput[];
108
- turnaround?: TurnaroundOption[];
109
- }
110
117
  interface DecisionInput {
111
118
  approve?: boolean;
112
119
  cart_token: string;
113
120
  version: number;
114
121
  }
115
- interface DimensionPricing {
116
- label?: string;
117
- max_height_mm: number;
118
- max_width_mm: number;
119
- min_billable_area_mm2?: number;
120
- min_height_mm: number;
121
- min_width_mm: number;
122
- rate_per_m2: number;
123
- }
124
122
  interface DownloadResponse {
125
123
  expires_in: number;
126
124
  url: string;
@@ -164,6 +162,7 @@ interface PublicConfigurationQuote {
164
162
  interface PublicConfigurationQuoteInput {
165
163
  revision_id?: string;
166
164
  selection?: ConfigSelectionRequest;
165
+ variant_id?: string;
167
166
  }
168
167
  interface QuantityPricing {
169
168
  axes?: string[];
@@ -195,19 +194,6 @@ interface Slot {
195
194
  interface SlotsResponse {
196
195
  items: Slot[];
197
196
  }
198
- interface TextInput {
199
- key: string;
200
- label: string;
201
- max_length: number;
202
- required?: boolean;
203
- }
204
- interface TurnaroundOption {
205
- default?: boolean;
206
- key: string;
207
- label: string;
208
- lead_days: number;
209
- surcharge?: PriceChange;
210
- }
211
197
  interface UploadTicket {
212
198
  expires_at: string;
213
199
  upload_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c1m-public/channel-client",
3
- "version": "0.38.0",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Typed server-side client for the MML headless Channel API",