@c1m-public/channel-client 0.37.0 → 0.39.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 +10 -1
- package/dist/{chunk-HZBHUOJ5.js → chunk-GPSFEKWL.js} +1 -1
- package/dist/{chunk-T6OQ4CBQ.js → chunk-LFHMWK6A.js} +11 -0
- package/dist/{chunk-KQI2FMHI.js → chunk-VARU5HM6.js} +1 -1
- package/dist/dash-next.d.ts +1 -1
- package/dist/dash-next.js +3 -3
- package/dist/dash.d.ts +1 -1
- package/dist/dash.js +2 -2
- package/dist/index.d.ts +26 -4
- package/dist/index.js +1 -1
- package/dist/next.d.ts +13 -2
- package/dist/next.js +2 -2
- package/dist/site.d.ts +29 -5
- package/dist/site.js +22 -1
- package/dist/{types-D1GrAYBX.d.ts → types-CgleEp97.d.ts} +214 -1
- package/package.json +1 -1
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 { isChannelAPIError, createChannelClient } from './chunk-
|
|
1
|
+
import { isChannelAPIError, createChannelClient } from './chunk-LFHMWK6A.js';
|
|
2
2
|
import { parseChannelWebhookEvent, isChannelWebhookVerificationError, isChannelWebhookEventType, ChannelConfigurationError } from './chunk-XPO7C3DW.js';
|
|
3
3
|
import 'server-only';
|
|
4
4
|
|
|
@@ -371,6 +371,17 @@ function createChannelClient(options) {
|
|
|
371
371
|
get: (slug) => request("channel.catalog.products.get", `/products/${encodePath(slug)}`),
|
|
372
372
|
media: (slug) => request("channel.catalog.products.media", `/products/${encodePath(slug)}/media`)
|
|
373
373
|
},
|
|
374
|
+
artwork: {
|
|
375
|
+
list: (orderId, cartToken) => request("channel.commerce.artwork.list", appendQuery(`/orders/${encodePath(orderId)}/artwork`, { cart_token: required(cartToken, "cartToken") })),
|
|
376
|
+
download: (orderId, itemId, slotKey, assetId, cartToken) => request("channel.commerce.artwork.download", appendQuery(`/orders/${encodePath(orderId)}/artwork/${encodePath(itemId)}/${encodePath(slotKey)}/files/${encodePath(assetId)}`, { cart_token: required(cartToken, "cartToken") })),
|
|
377
|
+
beginUpload: (orderId, itemId, slotKey, input) => request("channel.commerce.artwork.uploads.begin", `/orders/${encodePath(orderId)}/artwork/${encodePath(itemId)}/${encodePath(slotKey)}/uploads`, { method: "POST", body: JSON.stringify(input) }),
|
|
378
|
+
completeUpload: (orderId, itemId, slotKey, uploadId, input) => request("channel.commerce.artwork.uploads.complete", `/orders/${encodePath(orderId)}/artwork/${encodePath(itemId)}/${encodePath(slotKey)}/uploads/${encodePath(uploadId)}/complete`, { method: "POST", body: JSON.stringify(input) }),
|
|
379
|
+
decide: (orderId, itemId, slotKey, input) => request("channel.commerce.artwork.decide", `/orders/${encodePath(orderId)}/artwork/${encodePath(itemId)}/${encodePath(slotKey)}/decision`, { method: "POST", body: JSON.stringify(input) })
|
|
380
|
+
},
|
|
381
|
+
configurations: {
|
|
382
|
+
get: (productId) => request("channel.catalog.products.configuration.get", `/products/${encodePath(productId)}/configuration`),
|
|
383
|
+
quote: (productId, input) => request("channel.catalog.products.configuration.quote", `/products/${encodePath(productId)}/configuration/quote`, { method: "POST", body: JSON.stringify(input) })
|
|
384
|
+
},
|
|
374
385
|
categories: {
|
|
375
386
|
list: (params = {}) => request("channel.catalog.categories.list", appendQuery("/categories", params)),
|
|
376
387
|
products: (slug) => request("channel.catalog.categories.products", `/categories/by-slug/${encodePath(slug)}/products`)
|
package/dist/dash-next.d.ts
CHANGED
package/dist/dash-next.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createNextChannelClient } from './chunk-
|
|
2
|
-
import { narrow } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { createNextChannelClient } from './chunk-GPSFEKWL.js';
|
|
2
|
+
import { narrow } from './chunk-VARU5HM6.js';
|
|
3
|
+
import './chunk-LFHMWK6A.js';
|
|
4
4
|
import './chunk-XPO7C3DW.js';
|
|
5
5
|
import 'server-only';
|
|
6
6
|
|
package/dist/dash.d.ts
CHANGED
package/dist/dash.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createDashChannelClient, narrow as narrowToDash } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { createDashChannelClient, narrow as narrowToDash } from './chunk-VARU5HM6.js';
|
|
2
|
+
import './chunk-LFHMWK6A.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
|
|
2
|
-
export {
|
|
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
|
/**
|
|
@@ -15,6 +15,17 @@ declare class ChannelConfigurationError extends Error {
|
|
|
15
15
|
/** Works across duplicate package instances and transformed test bundles. */
|
|
16
16
|
declare function isChannelConfigurationError(error: unknown): error is ChannelConfigurationError;
|
|
17
17
|
|
|
18
|
+
type ArtworkSlotsResponse = SlotsResponse;
|
|
19
|
+
type ArtworkSlot = Slot;
|
|
20
|
+
type ArtworkUploadTicket = UploadTicket;
|
|
21
|
+
type ArtworkUploadInput = BeginUploadInput & {
|
|
22
|
+
cart_token: string;
|
|
23
|
+
};
|
|
24
|
+
type ArtworkCompleteInput = CompleteUploadInput & {
|
|
25
|
+
cart_token: string;
|
|
26
|
+
};
|
|
27
|
+
type ArtworkProofDecision = DecisionInput;
|
|
28
|
+
|
|
18
29
|
declare const DEFAULT_CHANNEL_API_URL = "https://api.saasdash.app";
|
|
19
30
|
interface ChannelRetryPolicy {
|
|
20
31
|
/** Additional attempts after the first (default 1). */
|
|
@@ -58,7 +69,7 @@ interface ChannelVisitor {
|
|
|
58
69
|
userAgent?: string;
|
|
59
70
|
}
|
|
60
71
|
type ChannelRequestOutcome = "success" | "api_error" | "network_error" | "timeout" | "invalid_response" | "cancelled";
|
|
61
|
-
type ChannelOperation = "channel.ping" | "channel.geo.detect" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "channel.pages.list" | "channel.pages.get" | "channel.catalog.products.list" | "channel.catalog.products.get" | "channel.catalog.products.media" | "channel.reviews.list" | "channel.reviews.summary" | "channel.reviews.submit" | "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" | "channel.book.services.list" | "channel.book.services.get" | "channel.book.availability.get" | "channel.book.quote.get" | "channel.book.holds.create" | "channel.book.holds.checkout" | "channel.book.holds.get" | "channel.payment_links.get" | "channel.payment_links.checkout" | "channel.payment_links.redemptions.get" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "channel.menu.boards.menu" | "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" | "channel.catalog.collections.get" | "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" | "channel.dash.quote_requests.moving.capture" | "channel.dash.addresses.lookup" | "channel.dash.addresses.resolve" | "channel.dash.addresses.distance" | "channel.leads.capture";
|
|
72
|
+
type ChannelOperation = "channel.commerce.artwork.list" | "channel.commerce.artwork.download" | "channel.commerce.artwork.decide" | "channel.commerce.artwork.uploads.begin" | "channel.commerce.artwork.uploads.complete" | "channel.ping" | "channel.geo.detect" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "channel.pages.list" | "channel.pages.get" | "channel.catalog.products.list" | "channel.catalog.products.get" | "channel.catalog.products.media" | "channel.catalog.products.configuration.get" | "channel.catalog.products.configuration.quote" | "channel.reviews.list" | "channel.reviews.summary" | "channel.reviews.submit" | "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" | "channel.book.services.list" | "channel.book.services.get" | "channel.book.availability.get" | "channel.book.quote.get" | "channel.book.holds.create" | "channel.book.holds.checkout" | "channel.book.holds.get" | "channel.payment_links.get" | "channel.payment_links.checkout" | "channel.payment_links.redemptions.get" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "channel.menu.boards.menu" | "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" | "channel.catalog.collections.get" | "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" | "channel.dash.quote_requests.moving.capture" | "channel.dash.addresses.lookup" | "channel.dash.addresses.resolve" | "channel.dash.addresses.distance" | "channel.leads.capture";
|
|
62
73
|
interface ChannelRequestObservation {
|
|
63
74
|
operation: ChannelOperation;
|
|
64
75
|
method: string;
|
|
@@ -209,6 +220,17 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
|
|
|
209
220
|
}>;
|
|
210
221
|
readonly media: (slug: string) => Promise<ListResponse<ProductAsset>>;
|
|
211
222
|
};
|
|
223
|
+
readonly artwork: {
|
|
224
|
+
readonly list: (orderId: string, cartToken: string) => Promise<SlotsResponse>;
|
|
225
|
+
readonly download: (orderId: string, itemId: string, slotKey: string, assetId: string, cartToken: string) => Promise<DownloadResponse>;
|
|
226
|
+
readonly beginUpload: (orderId: string, itemId: string, slotKey: string, input: ArtworkUploadInput) => Promise<UploadTicket>;
|
|
227
|
+
readonly completeUpload: (orderId: string, itemId: string, slotKey: string, uploadId: string, input: ArtworkCompleteInput) => Promise<ArtworkMutationReceipt>;
|
|
228
|
+
readonly decide: (orderId: string, itemId: string, slotKey: string, input: ArtworkProofDecision) => Promise<ArtworkMutationReceipt>;
|
|
229
|
+
};
|
|
230
|
+
readonly configurations: {
|
|
231
|
+
readonly get: (productId: string) => Promise<PublicConfiguration>;
|
|
232
|
+
readonly quote: (productId: string, input: PublicConfigurationQuoteInput) => Promise<PublicConfigurationQuote>;
|
|
233
|
+
};
|
|
212
234
|
readonly categories: {
|
|
213
235
|
readonly list: (params?: ChannelListParams) => Promise<ListResponse<CatalogCategory>>;
|
|
214
236
|
readonly products: (slug: string) => Promise<CatalogProductsResponse>;
|
|
@@ -410,4 +432,4 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
|
|
|
410
432
|
};
|
|
411
433
|
};
|
|
412
434
|
|
|
413
|
-
export { AddCartItemInput, BlogPost, BlogPostResponse, BookingAvailabilityParams, BookingAvailabilityResponse, BookingHoldResponse, BookingQuoteParams, BookingQuoteResponse, BookingService, BookingServiceResponse, CartLookupResponse, CartResponse, CatalogBrand, CatalogCategory, CatalogCollection, CatalogProductsResponse, ChannelAPIError, type ChannelCheckoutStatusParams, ChannelConfigurationError, ChannelGeo, type ChannelInvoiceListParams, type ChannelLeadInput, type ChannelListParams, type ChannelMutationOptions, type ChannelOperation, ChannelPing, type ChannelProductListParams, type ChannelRequestObservation, type ChannelRequestObserver, type ChannelRequestOutcome, type ChannelRetryPolicy, type ChannelSiteResolveParams, type ChannelSubscriptionCancelParams, type ChannelSubscriptionListParams, type ChannelVisitor, CheckoutAddressesInput, CheckoutCancelInput, CheckoutCustomerInput, CheckoutFulfillmentInput, CheckoutOptions, CheckoutPayInput, CheckoutPayResponse, CheckoutStatusResponse, CreateBookingHoldInput, type CreateChannelClientOptions, CustomerAuthSession, CustomerResponse, CustomerSecurityActivityPage, CustomerSession, CustomerSignupResponse, DEFAULT_CHANNEL_API_URL, DashDirectoryEntry, type DashDirectoryListParams, DashDirectoryProfileResponse, DashDirectoryRegion, DashInitResponse, DashLead, DashLeadPortalRequestLinkInput, DashLeadPortalRequestLinkResponse, DashLeadPortalView, DashMovingAddress, DashMovingAddressList, DashMovingDistance, DashMovingQuoteInput, DashMovingQuoteReceipt, DashPlansResponse, DashProfileResponse, DiningMenu, GivingEntry, GivingIntentListResponse, LeadResponse, LightInitResponse, ListResponse, MenuResponse, MergeCartInput, Order, OrderSummary, PaymentCollectionAvailability, PaymentLinkCheckoutInput, PaymentLinkCheckoutResponse, PaymentLinkRedemptionStatusResponse, PaymentMethodConfirmInput, PaymentMethodMutationResponse, PaymentMethodSetupInput, PaymentMethodSetupResult, PrintIntakeInput, PrintJob, PrintOptionsSelection, PrintQuoteResponse, PrintSettingsResponse, Product, ProductAsset, PublicPage, PublicPageSummary, PublicPaymentLinkResponse, PublicSubmitReviewInput, PublicWorkspaceInit, type RequiredIdempotency, Review, ReviewSummaryResponse, SavedAddress, SavedAddressInput, SavedAddressResponse, SavedAddressUpdateInput, SavedPaymentMethod, SendCodeResponse, SiteDocument, StartGivingInput, StartGivingResponse, StartSubscriptionInput, SubscriptionAgreementResponse, SubscriptionInvoiceListResponse, SubscriptionInvoiceResponse, SubscriptionListResponse, SubscriptionPlanListResponse, SubscriptionPlanResponse, SubscriptionSourceResponse, ThemeResponse, UpdateCartItemInput, WaitlistAcknowledgement, WaitlistFormSettings, WaitlistGateStatus, WaitlistSubmission, WaitlistUnsubscription, WaitlistVerification, createChannelClient, isChannelAPIError, isChannelConfigurationError };
|
|
435
|
+
export { AddCartItemInput, type ArtworkCompleteInput, ArtworkMutationReceipt, type ArtworkProofDecision, type ArtworkSlot, type ArtworkSlotsResponse, type ArtworkUploadInput, type ArtworkUploadTicket, BlogPost, BlogPostResponse, BookingAvailabilityParams, BookingAvailabilityResponse, BookingHoldResponse, BookingQuoteParams, BookingQuoteResponse, BookingService, BookingServiceResponse, CartLookupResponse, CartResponse, CatalogBrand, CatalogCategory, CatalogCollection, CatalogProductsResponse, ChannelAPIError, type ChannelCheckoutStatusParams, ChannelConfigurationError, ChannelGeo, type ChannelInvoiceListParams, type ChannelLeadInput, type ChannelListParams, type ChannelMutationOptions, type ChannelOperation, ChannelPing, type ChannelProductListParams, type ChannelRequestObservation, type ChannelRequestObserver, type ChannelRequestOutcome, type ChannelRetryPolicy, type ChannelSiteResolveParams, type ChannelSubscriptionCancelParams, type ChannelSubscriptionListParams, type ChannelVisitor, CheckoutAddressesInput, CheckoutCancelInput, CheckoutCustomerInput, CheckoutFulfillmentInput, CheckoutOptions, CheckoutPayInput, CheckoutPayResponse, CheckoutStatusResponse, CreateBookingHoldInput, type CreateChannelClientOptions, CustomerAuthSession, CustomerResponse, CustomerSecurityActivityPage, CustomerSession, CustomerSignupResponse, DEFAULT_CHANNEL_API_URL, DashDirectoryEntry, type DashDirectoryListParams, DashDirectoryProfileResponse, DashDirectoryRegion, DashInitResponse, DashLead, DashLeadPortalRequestLinkInput, DashLeadPortalRequestLinkResponse, DashLeadPortalView, DashMovingAddress, DashMovingAddressList, DashMovingDistance, DashMovingQuoteInput, DashMovingQuoteReceipt, DashPlansResponse, DashProfileResponse, DiningMenu, DownloadResponse, GivingEntry, GivingIntentListResponse, LeadResponse, LightInitResponse, ListResponse, MenuResponse, MergeCartInput, Order, OrderSummary, PaymentCollectionAvailability, PaymentLinkCheckoutInput, PaymentLinkCheckoutResponse, PaymentLinkRedemptionStatusResponse, PaymentMethodConfirmInput, PaymentMethodMutationResponse, PaymentMethodSetupInput, PaymentMethodSetupResult, PrintIntakeInput, PrintJob, PrintOptionsSelection, PrintQuoteResponse, PrintSettingsResponse, Product, ProductAsset, PublicConfiguration, PublicConfigurationQuote, PublicConfigurationQuoteInput, PublicPage, PublicPageSummary, PublicPaymentLinkResponse, PublicSubmitReviewInput, PublicWorkspaceInit, type RequiredIdempotency, Review, ReviewSummaryResponse, SavedAddress, SavedAddressInput, SavedAddressResponse, SavedAddressUpdateInput, SavedPaymentMethod, SendCodeResponse, SiteDocument, SlotsResponse, StartGivingInput, StartGivingResponse, StartSubscriptionInput, SubscriptionAgreementResponse, SubscriptionInvoiceListResponse, SubscriptionInvoiceResponse, SubscriptionListResponse, SubscriptionPlanListResponse, SubscriptionPlanResponse, SubscriptionSourceResponse, ThemeResponse, UpdateCartItemInput, UploadTicket, WaitlistAcknowledgement, WaitlistFormSettings, WaitlistGateStatus, WaitlistSubmission, WaitlistUnsubscription, WaitlistVerification, createChannelClient, isChannelAPIError, isChannelConfigurationError };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-
|
|
1
|
+
export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-LFHMWK6A.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
|
-
import { createChannelClient, ChannelCheckoutStatusParams, ChannelMutationOptions, CreateChannelClientOptions, ChannelVisitor, DashDirectoryListParams, ChannelLeadInput, ChannelSiteResolveParams, ChannelListParams, ChannelProductListParams, 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
|
|
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-CgleEp97.js';
|
|
3
3
|
import { ChannelWebhookEventDataMap, ChannelWebhookEvent } from './webhooks.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -347,6 +347,17 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
|
|
|
347
347
|
}>;
|
|
348
348
|
readonly media: (slug: string) => Promise<ListResponse<ProductAsset>>;
|
|
349
349
|
};
|
|
350
|
+
readonly artwork: {
|
|
351
|
+
readonly list: (orderId: string, cartToken: string) => Promise<SlotsResponse>;
|
|
352
|
+
readonly download: (orderId: string, itemId: string, slotKey: string, assetId: string, cartToken: string) => Promise<DownloadResponse>;
|
|
353
|
+
readonly beginUpload: (orderId: string, itemId: string, slotKey: string, input: ArtworkUploadInput) => Promise<UploadTicket>;
|
|
354
|
+
readonly completeUpload: (orderId: string, itemId: string, slotKey: string, uploadId: string, input: ArtworkCompleteInput) => Promise<ArtworkMutationReceipt>;
|
|
355
|
+
readonly decide: (orderId: string, itemId: string, slotKey: string, input: ArtworkProofDecision) => Promise<ArtworkMutationReceipt>;
|
|
356
|
+
};
|
|
357
|
+
readonly configurations: {
|
|
358
|
+
readonly get: (productId: string) => Promise<PublicConfiguration>;
|
|
359
|
+
readonly quote: (productId: string, input: PublicConfigurationQuoteInput) => Promise<PublicConfigurationQuote>;
|
|
360
|
+
};
|
|
350
361
|
readonly categories: {
|
|
351
362
|
readonly list: (params?: ChannelListParams) => Promise<ListResponse<CatalogCategory>>;
|
|
352
363
|
readonly products: (slug: string) => Promise<CatalogProductsResponse>;
|
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-
|
|
2
|
-
import './chunk-
|
|
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';
|
|
3
3
|
import './chunk-XPO7C3DW.js';
|
package/dist/site.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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,33 @@ 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
|
|
74
|
-
*
|
|
75
|
-
*
|
|
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 the public may not see the site; a site with
|
|
80
|
+
* member sessions checks membership (site/resolve does) before showing its
|
|
81
|
+
* private page. `siteResponse` turns the decision into what a proxy does.
|
|
76
82
|
*/
|
|
77
83
|
declare function siteDecision(signals: SiteSignals, pathname: string, options?: {
|
|
78
84
|
exempt?: readonly string[];
|
|
79
85
|
}): SiteDecision;
|
|
86
|
+
/** What a proxy does with a request: serve it, redirect it, or rewrite it in place. */
|
|
87
|
+
type SiteResponse = {
|
|
88
|
+
type: "serve";
|
|
89
|
+
} | {
|
|
90
|
+
type: "redirect";
|
|
91
|
+
path: string;
|
|
92
|
+
} | {
|
|
93
|
+
type: "rewrite";
|
|
94
|
+
path: string;
|
|
95
|
+
status: number;
|
|
96
|
+
retryAfter?: number;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* One decision as a response. `serve` and `gate-page` pass through; no site answers
|
|
100
|
+
* 404 and an inactive owner 503 at `UNAVAILABLE_PATH`, a private site 403 at
|
|
101
|
+
* `PRIVATE_PATH`.
|
|
102
|
+
*/
|
|
103
|
+
declare function siteResponse(decision: SiteDecision): SiteResponse;
|
|
80
104
|
/** A site mode as an owner picks it: mode and placement in one choice. */
|
|
81
105
|
type SiteModeChoice = "off" | "waitlist-page" | "waitlist-block" | "maintenance";
|
|
82
106
|
interface SiteModeFields {
|
|
@@ -98,4 +122,4 @@ declare function toDateTimeLocal(value?: string): string;
|
|
|
98
122
|
/** A datetime-local value back to RFC 3339; undefined when empty or invalid. */
|
|
99
123
|
declare function fromDateTimeLocal(value: string): string | undefined;
|
|
100
124
|
|
|
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 };
|
|
125
|
+
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." },
|
|
@@ -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 };
|
|
@@ -1,3 +1,205 @@
|
|
|
1
|
+
interface ArtworkMutationReceipt {
|
|
2
|
+
proof_revision: number;
|
|
3
|
+
state: string;
|
|
4
|
+
version: number;
|
|
5
|
+
}
|
|
6
|
+
interface ArtworkRecord {
|
|
7
|
+
frozen: boolean;
|
|
8
|
+
proof?: File;
|
|
9
|
+
proof_revision: number;
|
|
10
|
+
slot_key: string;
|
|
11
|
+
source: File;
|
|
12
|
+
state: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
version: number;
|
|
15
|
+
}
|
|
16
|
+
interface ArtworkSlot {
|
|
17
|
+
bleed_mm?: number;
|
|
18
|
+
formats: string[];
|
|
19
|
+
key: string;
|
|
20
|
+
label: string;
|
|
21
|
+
max_mb: number;
|
|
22
|
+
min_dpi?: number;
|
|
23
|
+
proof_required?: boolean;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
safe_mm?: number;
|
|
26
|
+
trim_h_mm?: number;
|
|
27
|
+
trim_w_mm?: number;
|
|
28
|
+
}
|
|
29
|
+
interface BeginUploadInput {
|
|
30
|
+
cart_token?: string;
|
|
31
|
+
file_name: string;
|
|
32
|
+
size_bytes: number;
|
|
33
|
+
version?: number;
|
|
34
|
+
}
|
|
35
|
+
interface Choice {
|
|
36
|
+
default?: boolean;
|
|
37
|
+
description?: string;
|
|
38
|
+
key: string;
|
|
39
|
+
label: string;
|
|
40
|
+
lead_days?: number;
|
|
41
|
+
price?: PriceChange;
|
|
42
|
+
}
|
|
43
|
+
interface ChoiceRule {
|
|
44
|
+
allowed: string[];
|
|
45
|
+
in: string[];
|
|
46
|
+
message?: string;
|
|
47
|
+
then: string;
|
|
48
|
+
when: string;
|
|
49
|
+
}
|
|
50
|
+
interface CompleteUploadInput {
|
|
51
|
+
cart_token?: string;
|
|
52
|
+
}
|
|
53
|
+
interface ConfigDocument {
|
|
54
|
+
fields: ConfigField[];
|
|
55
|
+
minimum_total?: number;
|
|
56
|
+
notes?: string;
|
|
57
|
+
quantity?: QuantityPricing;
|
|
58
|
+
rules?: ChoiceRule[];
|
|
59
|
+
setup_fee?: number;
|
|
60
|
+
version: number;
|
|
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
|
+
}
|
|
87
|
+
interface ConfigQuote {
|
|
88
|
+
doc_hash: string;
|
|
89
|
+
lead_days: number;
|
|
90
|
+
lines: QuoteLine[];
|
|
91
|
+
selection: ConfigSelection;
|
|
92
|
+
subtotal: number;
|
|
93
|
+
total: number;
|
|
94
|
+
units: number;
|
|
95
|
+
warnings?: string[];
|
|
96
|
+
}
|
|
97
|
+
interface ConfigSelection {
|
|
98
|
+
choices?: Record<string, string[]>;
|
|
99
|
+
dimensions?: CustomSize;
|
|
100
|
+
quantity?: number;
|
|
101
|
+
text?: Record<string, string>;
|
|
102
|
+
}
|
|
103
|
+
interface ConfigSelectionRequest {
|
|
104
|
+
choices?: Record<string, string[]>;
|
|
105
|
+
dimensions?: CustomSizeRequest;
|
|
106
|
+
quantity?: number;
|
|
107
|
+
text?: Record<string, string>;
|
|
108
|
+
}
|
|
109
|
+
interface CustomSize {
|
|
110
|
+
height_mm: number;
|
|
111
|
+
width_mm: number;
|
|
112
|
+
}
|
|
113
|
+
interface CustomSizeRequest {
|
|
114
|
+
height_mm?: number;
|
|
115
|
+
width_mm?: number;
|
|
116
|
+
}
|
|
117
|
+
interface DecisionInput {
|
|
118
|
+
approve?: boolean;
|
|
119
|
+
cart_token: string;
|
|
120
|
+
version: number;
|
|
121
|
+
}
|
|
122
|
+
interface DownloadResponse {
|
|
123
|
+
expires_in: number;
|
|
124
|
+
url: string;
|
|
125
|
+
}
|
|
126
|
+
interface File {
|
|
127
|
+
asset_id: string;
|
|
128
|
+
mime_type: string;
|
|
129
|
+
name: string;
|
|
130
|
+
sha256: string;
|
|
131
|
+
size_bytes: number;
|
|
132
|
+
}
|
|
133
|
+
interface LineConfig {
|
|
134
|
+
hash: string;
|
|
135
|
+
lead_days?: number;
|
|
136
|
+
revision_id: string;
|
|
137
|
+
selection?: unknown;
|
|
138
|
+
snapshot?: unknown;
|
|
139
|
+
}
|
|
140
|
+
interface PriceBreak {
|
|
141
|
+
cells?: Record<string, number>;
|
|
142
|
+
min_quantity: number;
|
|
143
|
+
price?: number;
|
|
144
|
+
}
|
|
145
|
+
interface PriceChange {
|
|
146
|
+
amount: number;
|
|
147
|
+
kind: string;
|
|
148
|
+
pack_size?: number;
|
|
149
|
+
}
|
|
150
|
+
interface PublicConfiguration {
|
|
151
|
+
currency: string;
|
|
152
|
+
doc: ConfigDocument;
|
|
153
|
+
product_id: string;
|
|
154
|
+
revision: number;
|
|
155
|
+
revision_id: string;
|
|
156
|
+
}
|
|
157
|
+
interface PublicConfigurationQuote {
|
|
158
|
+
currency: string;
|
|
159
|
+
quote: ConfigQuote;
|
|
160
|
+
revision_id: string;
|
|
161
|
+
}
|
|
162
|
+
interface PublicConfigurationQuoteInput {
|
|
163
|
+
revision_id?: string;
|
|
164
|
+
selection?: ConfigSelectionRequest;
|
|
165
|
+
variant_id?: string;
|
|
166
|
+
}
|
|
167
|
+
interface QuantityPricing {
|
|
168
|
+
axes?: string[];
|
|
169
|
+
breaks?: PriceBreak[];
|
|
170
|
+
max?: number;
|
|
171
|
+
min?: number;
|
|
172
|
+
mode: string;
|
|
173
|
+
presets?: number[];
|
|
174
|
+
price_mode?: string;
|
|
175
|
+
step?: number;
|
|
176
|
+
unit_label?: string;
|
|
177
|
+
}
|
|
178
|
+
interface QuoteLine {
|
|
179
|
+
amount: number;
|
|
180
|
+
key?: string;
|
|
181
|
+
kind: string;
|
|
182
|
+
label: string;
|
|
183
|
+
}
|
|
184
|
+
interface Slot {
|
|
185
|
+
line_number: number;
|
|
186
|
+
order_item_id: string;
|
|
187
|
+
quantity: number;
|
|
188
|
+
record?: ArtworkRecord;
|
|
189
|
+
spec: ArtworkSlot;
|
|
190
|
+
summary?: string;
|
|
191
|
+
title: string;
|
|
192
|
+
version: number;
|
|
193
|
+
}
|
|
194
|
+
interface SlotsResponse {
|
|
195
|
+
items: Slot[];
|
|
196
|
+
}
|
|
197
|
+
interface UploadTicket {
|
|
198
|
+
expires_at: string;
|
|
199
|
+
upload_id: string;
|
|
200
|
+
upload_url: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
1
203
|
interface ListResponse<T> {
|
|
2
204
|
items: T[];
|
|
3
205
|
next_cursor?: string;
|
|
@@ -430,6 +632,7 @@ interface PublicPage extends PublicPageSummary {
|
|
|
430
632
|
default_shell_template_id?: string;
|
|
431
633
|
}
|
|
432
634
|
interface Product {
|
|
635
|
+
kind?: string;
|
|
433
636
|
id: string;
|
|
434
637
|
workspace_id: string;
|
|
435
638
|
title: string;
|
|
@@ -515,6 +718,7 @@ interface CatalogBrand {
|
|
|
515
718
|
updated_at: string;
|
|
516
719
|
}
|
|
517
720
|
interface CatalogProduct {
|
|
721
|
+
kind?: string;
|
|
518
722
|
id: string;
|
|
519
723
|
slug: string;
|
|
520
724
|
title: string;
|
|
@@ -1259,6 +1463,9 @@ interface Order {
|
|
|
1259
1463
|
[key: string]: unknown;
|
|
1260
1464
|
}
|
|
1261
1465
|
interface OrderItem {
|
|
1466
|
+
sku?: string;
|
|
1467
|
+
summary?: string;
|
|
1468
|
+
configuration?: LineConfig;
|
|
1262
1469
|
id: string;
|
|
1263
1470
|
order_id: string;
|
|
1264
1471
|
product_id?: string;
|
|
@@ -1281,16 +1488,22 @@ interface CartResponse {
|
|
|
1281
1488
|
interface CartLookupResponse {
|
|
1282
1489
|
order?: Order | null;
|
|
1283
1490
|
}
|
|
1491
|
+
interface ProductLineConfiguration {
|
|
1492
|
+
revision_id?: string;
|
|
1493
|
+
selection: ConfigSelectionRequest;
|
|
1494
|
+
}
|
|
1284
1495
|
interface AddCartItemInput {
|
|
1285
1496
|
cart_token?: string;
|
|
1286
1497
|
currency?: string;
|
|
1287
1498
|
product_id: string;
|
|
1288
1499
|
variant_id?: string;
|
|
1289
1500
|
quantity: number;
|
|
1501
|
+
configuration?: ProductLineConfiguration;
|
|
1290
1502
|
}
|
|
1291
1503
|
interface UpdateCartItemInput {
|
|
1292
1504
|
cart_token: string;
|
|
1293
1505
|
quantity: number;
|
|
1506
|
+
configuration?: ProductLineConfiguration;
|
|
1294
1507
|
}
|
|
1295
1508
|
interface MergeCartInput {
|
|
1296
1509
|
source_cart_token: string;
|
|
@@ -1539,4 +1752,4 @@ interface BookingQuoteParams {
|
|
|
1539
1752
|
endsAt?: string;
|
|
1540
1753
|
}
|
|
1541
1754
|
|
|
1542
|
-
export type {
|
|
1755
|
+
export type { CatalogBrand as $, AddCartItemInput as A, DashMovingAddressList as B, CartResponse as C, DashProfileResponse as D, DashMovingAddress as E, DashMovingDistance as F, PublicWorkspaceInit as G, LightInitResponse as H, PublicPageSummary as I, PublicPage as J, Product as K, ListResponse as L, ProductAsset as M, SlotsResponse as N, Order as O, PaymentCollectionAvailability as P, DownloadResponse as Q, ArtworkMutationReceipt as R, SiteDocument as S, PublicConfiguration as T, UploadTicket as U, PublicConfigurationQuoteInput as V, WaitlistVerification as W, PublicConfigurationQuote as X, CatalogCategory as Y, CatalogProductsResponse as Z, CatalogCollection as _, CheckoutOptions as a, BookingCustomerInput as a$, CartLookupResponse as a0, UpdateCartItemInput as a1, MergeCartInput as a2, Review as a3, ReviewSummaryResponse as a4, PublicSubmitReviewInput as a5, ThemeResponse as a6, MenuResponse as a7, BlogPost as a8, BlogPostResponse as a9, CustomerResponse as aA, CustomerAuthSession as aB, CustomerSecurityActivityPage as aC, OrderSummary as aD, SavedAddress as aE, SavedAddressResponse as aF, SavedAddressInput as aG, SavedAddressUpdateInput as aH, SavedPaymentMethod as aI, PaymentMethodSetupInput as aJ, PaymentMethodSetupResult as aK, PaymentMethodConfirmInput as aL, PaymentMethodMutationResponse as aM, StartSubscriptionInput as aN, SubscriptionAgreementResponse as aO, SubscriptionListResponse as aP, SubscriptionSourceResponse as aQ, SubscriptionInvoiceListResponse as aR, SubscriptionInvoiceResponse as aS, GivingIntentListResponse as aT, LeadResponse as aU, BeginUploadInput as aV, CompleteUploadInput as aW, DecisionInput as aX, Slot as aY, BookingAvailability as aZ, BookingCancellationPolicy as a_, GivingEntry as aa, StartGivingInput as ab, StartGivingResponse as ac, SubscriptionPlanListResponse as ad, SubscriptionPlanResponse as ae, BookingService as af, BookingServiceResponse as ag, BookingAvailabilityParams as ah, BookingAvailabilityResponse as ai, BookingQuoteParams as aj, BookingQuoteResponse as ak, CreateBookingHoldInput as al, BookingHoldResponse as am, PublicPaymentLinkResponse as an, PaymentLinkCheckoutInput as ao, PaymentLinkCheckoutResponse as ap, PaymentLinkRedemptionStatusResponse as aq, PrintSettingsResponse as ar, PrintOptionsSelection as as, PrintQuoteResponse as at, PrintIntakeInput as au, PrintJob as av, DiningMenu as aw, CustomerSignupResponse as ax, SendCodeResponse as ay, CustomerSession as az, CheckoutStatusResponse as b, SubscriptionInvoice as b$, BookingFreeSpan as b0, BookingHold as b1, BookingIntakeQuestion as b2, BookingPriceQuote as b3, BookingServicePricing as b4, BookingTimeRange as b5, CatalogProduct as b6, CheckoutAddress as b7, CheckoutStatus as b8, ConfigDocument as b9, DiningOfferBadge as bA, GivingIntent as bB, Menu as bC, MenuItem as bD, OrderItem as bE, PaymentLinkRedemptionStatus as bF, PaymentMethodOption as bG, PaymentReadiness as bH, PrintBranding as bI, PrintIntakeLimits as bJ, PrintJobFile as bK, PrintPaperSize as bL, PrintPerPagePricing as bM, PrintPriceBreakdown as bN, PrintPriceLine as bO, PrintPricing as bP, PrintPricingOption as bQ, ProductLineConfiguration as bR, PublicGate as bS, PublicPaymentLink as bT, PublicSiteSignals as bU, ShippingMethodOption as bV, SiteGatedDocument as bW, SiteRef as bX, SiteResolvedDocument as bY, SiteSubject as bZ, SubscriptionAgreement as b_, ConfigQuote as ba, ConfigSelectionRequest as bb, Customer as bc, CustomerSecurityActivity as bd, DashBrandingInfo as be, DashDirectoryProfile as bf, DashLeadPortalMatch as bg, DashLeadPortalMovingSummary as bh, DashLeadPortalRequest as bi, DashLeadPortalRequestStatus as bj, DashLocaleInfo as bk, DashPlan as bl, DashPlanPricing as bm, DashPlanRegion as bn, DashPublicPage as bo, DashPublicProfileInfo as bp, DashTenantInfo as bq, DiningAvailability as br, DiningAvailabilityRule as bs, DiningComboChoice as bt, DiningComboGroup as bu, DiningItemSize as bv, DiningMenuItem as bw, DiningModifier as bx, DiningModifierGroup as by, DiningOffer as bz, CheckoutCustomerInput as c, SubscriptionPlanOffer as c0, SubscriptionSourceDisplay as c1, WaitlistAttribution as c2, WorkspaceInfo as c3, CheckoutAddressesInput as d, CheckoutFulfillmentInput as e, CheckoutPayInput as f, CheckoutPayResponse as g, CheckoutCancelInput as h, ChannelPing as i, ChannelGeo as j, WaitlistUnsubscription as k, DashInitResponse as l, WaitlistGateStatus as m, WaitlistFormSettings as n, WaitlistSubmission as o, WaitlistAcknowledgement as p, DashPlansResponse as q, DashDirectoryRegion as r, DashDirectoryEntry as s, DashDirectoryProfileResponse as t, DashLead as u, DashLeadPortalRequestLinkInput as v, DashLeadPortalRequestLinkResponse as w, DashLeadPortalView as x, DashMovingQuoteInput as y, DashMovingQuoteReceipt as z };
|