@c1m-public/channel-client 0.25.0 → 0.28.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/dist/{chunk-BANE7WSW.js → chunk-CPQT34K2.js} +5 -3
- package/dist/{chunk-O4N7PQJF.js → chunk-KCYSLD37.js} +2 -1
- package/dist/{chunk-UX7PRF5Z.js → chunk-LBOYLZ4J.js} +37 -3
- package/dist/{chunk-P3HX34X7.js → chunk-XPO7C3DW.js} +4 -1
- package/dist/dash-next.js +4 -4
- package/dist/dash.d.ts +3 -2
- package/dist/dash.js +3 -3
- package/dist/index.d.ts +71 -23
- package/dist/index.js +2 -2
- package/dist/next.d.ts +16 -2
- package/dist/next.js +3 -3
- package/dist/webhooks.d.ts +14 -2
- package/dist/webhooks.js +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isChannelAPIError, createChannelClient } from './chunk-
|
|
2
|
-
import { parseChannelWebhookEvent, isChannelWebhookVerificationError, isChannelWebhookEventType, ChannelConfigurationError } from './chunk-
|
|
1
|
+
import { isChannelAPIError, createChannelClient } from './chunk-LBOYLZ4J.js';
|
|
2
|
+
import { parseChannelWebhookEvent, isChannelWebhookVerificationError, isChannelWebhookEventType, ChannelConfigurationError } from './chunk-XPO7C3DW.js';
|
|
3
3
|
import 'server-only';
|
|
4
4
|
|
|
5
5
|
var MAX_AGE_SECONDS = 60 * 60 * 24 * 30;
|
|
@@ -286,7 +286,9 @@ function createCart(options) {
|
|
|
286
286
|
* must be on the channel's registered site_url — the server refuses
|
|
287
287
|
* anything else, because an unchecked return URL is an open redirect.
|
|
288
288
|
*/
|
|
289
|
-
pay: (orderId, input, attempt) => resolve().checkout.pay(orderId, input, attempt)
|
|
289
|
+
pay: (orderId, input, attempt) => resolve().checkout.pay(orderId, input, attempt),
|
|
290
|
+
/** Expire the hosted provider session before returning the cart to editing. */
|
|
291
|
+
cancel: (orderId, input, attempt) => resolve().checkout.cancel(orderId, input, attempt)
|
|
290
292
|
}
|
|
291
293
|
};
|
|
292
294
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createChannelClient } from './chunk-
|
|
1
|
+
import { createChannelClient } from './chunk-LBOYLZ4J.js';
|
|
2
2
|
import 'server-only';
|
|
3
3
|
|
|
4
4
|
function narrow(client) {
|
|
@@ -6,6 +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
10
|
assetUrl: client.assetUrl,
|
|
10
11
|
withVisitor: (visitor) => narrow(client.withVisitor(visitor))
|
|
11
12
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChannelConfigurationError } from './chunk-
|
|
1
|
+
import { ChannelConfigurationError } from './chunk-XPO7C3DW.js';
|
|
2
2
|
import 'server-only';
|
|
3
3
|
|
|
4
4
|
// ../resilience/src/index.ts
|
|
@@ -243,6 +243,21 @@ function createChannelClient(options) {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
+
async function linkRequest(path, body) {
|
|
247
|
+
try {
|
|
248
|
+
const result = await performRequest(transport, `${baseUrl}/api/v1/public/audience${path}`, {
|
|
249
|
+
method: "POST",
|
|
250
|
+
headers: { "Content-Type": "application/json" },
|
|
251
|
+
body: JSON.stringify(body),
|
|
252
|
+
cache: "no-store"
|
|
253
|
+
});
|
|
254
|
+
return result.payload;
|
|
255
|
+
} catch (error) {
|
|
256
|
+
if (!isTransportError(error)) throw error;
|
|
257
|
+
const { status, code, message, requestId } = error.failure;
|
|
258
|
+
throw new ChannelAPIError(message || "Audience link request failed", status, code || "audience_link_failed", requestId);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
246
261
|
function mutationHeaders(mutation) {
|
|
247
262
|
return mutation?.idempotencyKey ? { "Idempotency-Key": mutation.idempotencyKey } : void 0;
|
|
248
263
|
}
|
|
@@ -274,10 +289,24 @@ function createChannelClient(options) {
|
|
|
274
289
|
{ cache: "no-store" }
|
|
275
290
|
)
|
|
276
291
|
},
|
|
292
|
+
/** Confirmation and unsubscribe links from waitlist emails. */
|
|
293
|
+
audience: {
|
|
294
|
+
verify: (token2) => linkRequest("/verify", { token: required(token2, "token") }),
|
|
295
|
+
unsubscribe: (key) => linkRequest("/unsubscribe", { key: required(key, "key") })
|
|
296
|
+
},
|
|
277
297
|
/** Tenant-level data exposed only to a dash-scoped channel token. */
|
|
278
298
|
dash: {
|
|
279
299
|
profile: () => request("channel.dash.profile", "/dash/profile"),
|
|
280
300
|
init: () => request("channel.dash.init", "/dash/init"),
|
|
301
|
+
waitlist: {
|
|
302
|
+
status: () => request("channel.dash.waitlist.status", "/dash/waitlist", { cache: "no-store" }),
|
|
303
|
+
form: () => request("channel.dash.waitlist.form", "/dash/waitlist/form", { cache: "no-store" }),
|
|
304
|
+
submit: (input, mutation) => request("channel.dash.waitlist.submit", "/dash/waitlist/entries", {
|
|
305
|
+
method: "POST",
|
|
306
|
+
headers: mutationHeaders(mutation),
|
|
307
|
+
body: JSON.stringify(input)
|
|
308
|
+
})
|
|
309
|
+
},
|
|
281
310
|
plans: () => request("channel.dash.plans", "/dash/plans"),
|
|
282
311
|
directory: {
|
|
283
312
|
regions: () => request("channel.dash.directory.regions", "/dash/directory/regions"),
|
|
@@ -394,6 +423,11 @@ function createChannelClient(options) {
|
|
|
394
423
|
method: "POST",
|
|
395
424
|
headers: mutationHeaders(mutation),
|
|
396
425
|
body: JSON.stringify(input)
|
|
426
|
+
}),
|
|
427
|
+
cancel: (orderId, input, mutation) => request("channel.checkout.cancel", `/checkout/${encodePath(orderId)}/cancel`, {
|
|
428
|
+
method: "POST",
|
|
429
|
+
headers: mutationHeaders(mutation),
|
|
430
|
+
body: JSON.stringify(input)
|
|
397
431
|
})
|
|
398
432
|
},
|
|
399
433
|
reviews: {
|
|
@@ -533,10 +567,10 @@ function createChannelClient(options) {
|
|
|
533
567
|
method: "DELETE",
|
|
534
568
|
headers: mutationHeaders(mutation)
|
|
535
569
|
}, customerSession),
|
|
536
|
-
setDefault: (addressId,
|
|
570
|
+
setDefault: (addressId, mutation) => request("channel.account.addresses.set_default", `/account/addresses/${encodePath(addressId)}/default`, {
|
|
537
571
|
method: "POST",
|
|
538
572
|
headers: mutationHeaders(mutation),
|
|
539
|
-
body: JSON.stringify({ kind })
|
|
573
|
+
body: JSON.stringify({ kind: "shipping" })
|
|
540
574
|
}, customerSession)
|
|
541
575
|
},
|
|
542
576
|
paymentMethods: {
|
|
@@ -10,7 +10,7 @@ function isChannelConfigurationError(error) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// src/generated/webhook-events.ts
|
|
13
|
-
var GENERATED_CHANNEL_WEBHOOK_EVENT_TYPES = ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
|
|
13
|
+
var GENERATED_CHANNEL_WEBHOOK_EVENT_TYPES = ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "fulfillment.shipped", "fulfillment.delivered", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
|
|
14
14
|
|
|
15
15
|
// src/webhooks.ts
|
|
16
16
|
var CHANNEL_WEBHOOK_EVENT_TYPES = GENERATED_CHANNEL_WEBHOOK_EVENT_TYPES;
|
|
@@ -152,6 +152,9 @@ function isKnownEventData(type, value) {
|
|
|
152
152
|
case "order.cancelled":
|
|
153
153
|
case "order.refunded":
|
|
154
154
|
return hasStrings(value, ["order_id", "order_number", "status", "payment_status", "currency", "created_at"]) && typeof value.total_cents === "number";
|
|
155
|
+
case "fulfillment.shipped":
|
|
156
|
+
case "fulfillment.delivered":
|
|
157
|
+
return hasStrings(value, ["fulfillment_id", "order_id", "status"]) && (value.tracking_number === void 0 || typeof value.tracking_number === "string") && (value.tracking_url === void 0 || typeof value.tracking_url === "string") && (value.carrier === void 0 || typeof value.carrier === "string") && (value.shipped_at === void 0 || typeof value.shipped_at === "string") && (value.delivered_at === void 0 || typeof value.delivered_at === "string");
|
|
155
158
|
case "lead.created":
|
|
156
159
|
return hasStrings(value, ["lead_id", "source", "created_at"]);
|
|
157
160
|
case "review.submitted":
|
package/dist/dash-next.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createNextChannelClient } from './chunk-
|
|
2
|
-
import { narrow } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { createNextChannelClient } from './chunk-CPQT34K2.js';
|
|
2
|
+
import { narrow } from './chunk-KCYSLD37.js';
|
|
3
|
+
import './chunk-LBOYLZ4J.js';
|
|
4
|
+
import './chunk-XPO7C3DW.js';
|
|
5
5
|
import 'server-only';
|
|
6
6
|
|
|
7
7
|
function createNextDashChannelClient(options) {
|
package/dist/dash.d.ts
CHANGED
|
@@ -12,9 +12,10 @@ import './webhooks.js';
|
|
|
12
12
|
*
|
|
13
13
|
* `ping` and `geo` are deliberately included: both are scope-agnostic on the
|
|
14
14
|
* door (the credential self-check must answer for either scope, and geo lets
|
|
15
|
-
* a dash site localise pricing).
|
|
15
|
+
* a dash site localise pricing). `audience` is the scope-free email-link
|
|
16
|
+
* surface every waitlist site needs.
|
|
16
17
|
*/
|
|
17
|
-
type DashChannelClient = Pick<ReturnType<typeof createChannelClient>, "ping" | "geo" | "dash" | "assetUrl"> & {
|
|
18
|
+
type DashChannelClient = Pick<ReturnType<typeof createChannelClient>, "ping" | "geo" | "dash" | "audience" | "assetUrl"> & {
|
|
18
19
|
/** Request-scoped clone carrying signed visitor metadata (see ChannelVisitor). */
|
|
19
20
|
withVisitor(visitor: ChannelVisitor): DashChannelClient;
|
|
20
21
|
};
|
package/dist/dash.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createDashChannelClient, narrow as narrowToDash } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { createDashChannelClient, narrow as narrowToDash } from './chunk-KCYSLD37.js';
|
|
2
|
+
import './chunk-LBOYLZ4J.js';
|
|
3
|
+
import './chunk-XPO7C3DW.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookEvent, ChannelWebhookEventDataMap, ChannelWebhookEventType, ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, LeadCreatedEventData, MenuUpdatedEventData, OrderEventData, PagePublishedEventData, ParseChannelWebhookEventOptions, ParsedChannelWebhookEvent, ProductEventData, ReviewPublishedEventData, ReviewSubmittedEventData, UnknownChannelWebhookEvent, VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './webhooks.js';
|
|
1
|
+
export { AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookEvent, ChannelWebhookEventDataMap, ChannelWebhookEventType, ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, FulfillmentEventData, LeadCreatedEventData, MenuUpdatedEventData, OrderEventData, PagePublishedEventData, ParseChannelWebhookEventOptions, ParsedChannelWebhookEvent, ProductEventData, ReviewPublishedEventData, ReviewSubmittedEventData, UnknownChannelWebhookEvent, VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './webhooks.js';
|
|
2
2
|
|
|
3
3
|
interface ListResponse<T> {
|
|
4
4
|
items: T[];
|
|
@@ -12,18 +12,57 @@ interface WorkspaceInfo {
|
|
|
12
12
|
is_active: boolean;
|
|
13
13
|
status?: string;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The server-decided public gate. Absent means visitors see the normal site.
|
|
17
|
+
* `page` placement redirects every non-exempt path to `path`; `block` keeps
|
|
18
|
+
* the site and lets a page embed the signup form. Never participant data.
|
|
19
|
+
*/
|
|
20
|
+
interface PublicGate {
|
|
21
|
+
kind: "waitlist";
|
|
22
|
+
placement: "page" | "block";
|
|
23
|
+
path: string;
|
|
24
|
+
}
|
|
25
|
+
interface WaitlistGateStatus {
|
|
26
|
+
gate?: PublicGate;
|
|
27
|
+
}
|
|
28
|
+
interface WaitlistFormSettings {
|
|
29
|
+
gate?: PublicGate;
|
|
30
|
+
collect_marketing_consent: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** First-touch context captured by the site; every field is a bounded hint. */
|
|
33
|
+
interface WaitlistAttribution {
|
|
34
|
+
utm_source?: string;
|
|
35
|
+
utm_medium?: string;
|
|
36
|
+
utm_campaign?: string;
|
|
37
|
+
utm_term?: string;
|
|
38
|
+
utm_content?: string;
|
|
39
|
+
referrer_host?: string;
|
|
40
|
+
landing_path?: string;
|
|
41
|
+
country?: string;
|
|
42
|
+
locale?: string;
|
|
43
|
+
}
|
|
44
|
+
interface WaitlistSubmission {
|
|
45
|
+
email: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
source?: "waitlist_page" | "waitlist_block";
|
|
48
|
+
marketing_opt_in?: boolean;
|
|
49
|
+
attribution?: WaitlistAttribution;
|
|
50
|
+
}
|
|
51
|
+
interface WaitlistAcknowledgement {
|
|
52
|
+
accepted: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface WaitlistVerification {
|
|
55
|
+
verified: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface WaitlistUnsubscription {
|
|
58
|
+
unsubscribed: boolean;
|
|
20
59
|
}
|
|
21
60
|
interface PublicWorkspaceInit {
|
|
22
61
|
workspace: WorkspaceInfo;
|
|
23
62
|
branding?: Record<string, unknown>;
|
|
24
63
|
preferences?: Record<string, unknown>;
|
|
25
64
|
profile?: Record<string, unknown>;
|
|
26
|
-
|
|
65
|
+
gate?: PublicGate;
|
|
27
66
|
features?: Array<{
|
|
28
67
|
key: string;
|
|
29
68
|
name: string;
|
|
@@ -56,7 +95,7 @@ interface SiteRef {
|
|
|
56
95
|
* (`menus.get`) and theme (`theme.get`) stay separate, parallel reads.
|
|
57
96
|
*/
|
|
58
97
|
interface LightInitResponse {
|
|
59
|
-
|
|
98
|
+
gate?: PublicGate;
|
|
60
99
|
workspace_id: string;
|
|
61
100
|
workspace_name: string;
|
|
62
101
|
workspace_slug?: string;
|
|
@@ -113,7 +152,7 @@ interface DashLocaleInfo {
|
|
|
113
152
|
* `dash.profile()` remains for the full profile page (gallery, about template).
|
|
114
153
|
*/
|
|
115
154
|
interface DashInitResponse {
|
|
116
|
-
|
|
155
|
+
gate?: PublicGate;
|
|
117
156
|
tenant: DashTenantInfo;
|
|
118
157
|
public_profile: DashPublicProfileInfo;
|
|
119
158
|
branding?: DashBrandingInfo;
|
|
@@ -574,7 +613,6 @@ interface GivingIntentListResponse {
|
|
|
574
613
|
}
|
|
575
614
|
interface SavedAddress {
|
|
576
615
|
id: string;
|
|
577
|
-
end_user_id: string;
|
|
578
616
|
label: string;
|
|
579
617
|
name: string;
|
|
580
618
|
phone: string;
|
|
@@ -584,36 +622,29 @@ interface SavedAddress {
|
|
|
584
622
|
region: string;
|
|
585
623
|
postal_code: string;
|
|
586
624
|
country_code: string;
|
|
587
|
-
|
|
588
|
-
is_default_billing: boolean;
|
|
625
|
+
is_default: boolean;
|
|
589
626
|
created_at: string;
|
|
590
627
|
updated_at: string;
|
|
591
628
|
}
|
|
592
629
|
interface SavedAddressInput {
|
|
630
|
+
name: string;
|
|
593
631
|
line1: string;
|
|
594
632
|
city: string;
|
|
595
633
|
country_code: string;
|
|
596
634
|
label?: string;
|
|
597
|
-
name?: string;
|
|
598
635
|
phone?: string;
|
|
599
636
|
line2?: string;
|
|
600
637
|
region?: string;
|
|
601
638
|
postal_code?: string;
|
|
602
|
-
|
|
603
|
-
is_default_billing?: boolean;
|
|
639
|
+
is_default?: boolean;
|
|
604
640
|
}
|
|
605
641
|
type SavedAddressUpdateInput = SavedAddressInput;
|
|
606
|
-
type SavedAddressDefaultKind = "shipping" | "billing";
|
|
607
642
|
interface SavedAddressResponse {
|
|
608
643
|
address: SavedAddress;
|
|
609
644
|
}
|
|
610
645
|
interface SavedPaymentMethod {
|
|
611
646
|
id: string;
|
|
612
|
-
workspace_id: string;
|
|
613
|
-
end_user_ref?: string;
|
|
614
647
|
provider: string;
|
|
615
|
-
provider_customer_id?: string;
|
|
616
|
-
provider_payment_method_id: string;
|
|
617
648
|
status: string;
|
|
618
649
|
is_default: boolean;
|
|
619
650
|
display_brand?: string;
|
|
@@ -625,6 +656,8 @@ interface SavedPaymentMethod {
|
|
|
625
656
|
}
|
|
626
657
|
interface PaymentMethodSetupInput {
|
|
627
658
|
provider: string;
|
|
659
|
+
consent: boolean;
|
|
660
|
+
consent_version: "saved_payment_method_v1";
|
|
628
661
|
}
|
|
629
662
|
interface PaymentMethodSetupResult {
|
|
630
663
|
type: string;
|
|
@@ -1204,6 +1237,9 @@ interface CheckoutPayInput {
|
|
|
1204
1237
|
cart_token: string;
|
|
1205
1238
|
return_url?: string;
|
|
1206
1239
|
}
|
|
1240
|
+
interface CheckoutCancelInput {
|
|
1241
|
+
cart_token: string;
|
|
1242
|
+
}
|
|
1207
1243
|
interface PaymentMethodOption {
|
|
1208
1244
|
provider: string;
|
|
1209
1245
|
name: string;
|
|
@@ -1229,6 +1265,7 @@ interface ShippingMethodOption {
|
|
|
1229
1265
|
interface CheckoutOptions {
|
|
1230
1266
|
checkout_variant: string;
|
|
1231
1267
|
order: Order;
|
|
1268
|
+
checkout_active?: boolean;
|
|
1232
1269
|
shipping_methods?: ShippingMethodOption[];
|
|
1233
1270
|
payment_methods?: PaymentMethodOption[];
|
|
1234
1271
|
payment_ready?: boolean;
|
|
@@ -1350,7 +1387,7 @@ interface ChannelVisitor {
|
|
|
1350
1387
|
userAgent?: string;
|
|
1351
1388
|
}
|
|
1352
1389
|
type ChannelRequestOutcome = "success" | "api_error" | "network_error" | "timeout" | "invalid_response" | "cancelled";
|
|
1353
|
-
type ChannelOperation = "channel.ping" | "channel.geo.detect" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "content.pages.public.list.channel" | "content.pages.public.get.channel" | "shop.public.products.list.channel" | "shop.public.products.get.channel" | "shop.public.products.media.channel" | "reviews.public.list.channel" | "reviews.public.summary.channel" | "reviews.public.submit.channel" | "channel.theme.get" | "channel.menus.get" | "channel.blog.get" | "channel.blog.list" | "channel.payments.availability" | "channel.giving.entries.list" | "channel.giving.entries.get" | "channel.giving.start" | "channel.subscriptions.plans.list" | "channel.subscriptions.plans.get" | "channel.subscriptions.start" | "monetization.payment_links.public_get.channel" | "monetization.payment_links.public_checkout.channel" | "monetization.payment_links.public_redemption_get.channel" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "menu.public.board_menu.channel" | "channel.auth.check" | "channel.auth.signup" | "channel.auth.send_code" | "channel.auth.verify_code" | "channel.auth.refresh" | "channel.auth.me" | "channel.auth.me.update" | "channel.auth.logout" | "channel.auth.sessions.list" | "channel.auth.sessions.revoke" | "channel.auth.sessions.revoke_others" | "channel.auth.sessions.revoke_all" | "channel.auth.security_activity.list" | "channel.account.addresses.list" | "channel.account.addresses.create" | "channel.account.addresses.get" | "channel.account.addresses.update" | "channel.account.addresses.delete" | "channel.account.addresses.set_default" | "channel.account.giving.list" | "channel.account.orders.list" | "channel.account.orders.summary" | "channel.account.orders.get" | "channel.account.payment_methods.list" | "channel.account.payment_methods.setup" | "channel.account.payment_methods.confirm" | "channel.account.payment_methods.default" | "channel.account.payment_methods.delete" | "channel.account.subscriptions.list" | "channel.account.subscriptions.get" | "channel.account.subscriptions.source" | "channel.account.subscriptions.cancel" | "channel.account.subscriptions.pause" | "channel.account.subscriptions.resume" | "channel.account.subscriptions.invoices.list" | "channel.account.subscriptions.invoices.get" | "channel.account.subscriptions.invoices.pay_now" | "channel.catalog.brands.list" | "channel.catalog.categories.list" | "channel.catalog.categories.products" | "channel.catalog.collections.list" | "channel.catalog.collections.products" | "shop.public.collections.get.channel" | "channel.cart.get" | "channel.cart.items.add" | "channel.cart.items.update" | "channel.cart.items.remove" | "channel.cart.clear" | "channel.cart.merge" | "channel.checkout.options" | "channel.checkout.status" | "channel.checkout.customer.set" | "channel.checkout.addresses.set" | "channel.checkout.fulfillment.set" | "channel.checkout.pay" | "channel.dash.profile" | "channel.dash.init" | "channel.dash.plans" | "channel.dash.directory.regions" | "channel.dash.directory.browse" | "channel.dash.directory.get" | "channel.dash.leads.capture" | "channel.dash.lead_portal.my_quotes" | "channel.dash.lead_portal.request_link" | "growth.public_workspace.leads.capture.channel";
|
|
1390
|
+
type ChannelOperation = "channel.ping" | "channel.geo.detect" | "channel.site.resolve" | "channel.init.get" | "channel.init.light" | "content.pages.public.list.channel" | "content.pages.public.get.channel" | "shop.public.products.list.channel" | "shop.public.products.get.channel" | "shop.public.products.media.channel" | "reviews.public.list.channel" | "reviews.public.summary.channel" | "reviews.public.submit.channel" | "channel.theme.get" | "channel.menus.get" | "channel.blog.get" | "channel.blog.list" | "channel.payments.availability" | "channel.giving.entries.list" | "channel.giving.entries.get" | "channel.giving.start" | "channel.subscriptions.plans.list" | "channel.subscriptions.plans.get" | "channel.subscriptions.start" | "monetization.payment_links.public_get.channel" | "monetization.payment_links.public_checkout.channel" | "monetization.payment_links.public_redemption_get.channel" | "channel.print.settings" | "channel.print.quote" | "channel.print.intake" | "menu.public.board_menu.channel" | "channel.auth.check" | "channel.auth.signup" | "channel.auth.send_code" | "channel.auth.verify_code" | "channel.auth.refresh" | "channel.auth.me" | "channel.auth.me.update" | "channel.auth.logout" | "channel.auth.sessions.list" | "channel.auth.sessions.revoke" | "channel.auth.sessions.revoke_others" | "channel.auth.sessions.revoke_all" | "channel.auth.security_activity.list" | "channel.account.addresses.list" | "channel.account.addresses.create" | "channel.account.addresses.get" | "channel.account.addresses.update" | "channel.account.addresses.delete" | "channel.account.addresses.set_default" | "channel.account.giving.list" | "channel.account.orders.list" | "channel.account.orders.summary" | "channel.account.orders.get" | "channel.account.payment_methods.list" | "channel.account.payment_methods.setup" | "channel.account.payment_methods.confirm" | "channel.account.payment_methods.default" | "channel.account.payment_methods.delete" | "channel.account.subscriptions.list" | "channel.account.subscriptions.get" | "channel.account.subscriptions.source" | "channel.account.subscriptions.cancel" | "channel.account.subscriptions.pause" | "channel.account.subscriptions.resume" | "channel.account.subscriptions.invoices.list" | "channel.account.subscriptions.invoices.get" | "channel.account.subscriptions.invoices.pay_now" | "channel.catalog.brands.list" | "channel.catalog.categories.list" | "channel.catalog.categories.products" | "channel.catalog.collections.list" | "channel.catalog.collections.products" | "shop.public.collections.get.channel" | "channel.cart.get" | "channel.cart.items.add" | "channel.cart.items.update" | "channel.cart.items.remove" | "channel.cart.clear" | "channel.cart.merge" | "channel.checkout.options" | "channel.checkout.status" | "channel.checkout.customer.set" | "channel.checkout.addresses.set" | "channel.checkout.fulfillment.set" | "channel.checkout.pay" | "channel.checkout.cancel" | "channel.dash.profile" | "channel.dash.init" | "channel.dash.waitlist.status" | "channel.dash.waitlist.form" | "channel.dash.waitlist.submit" | "channel.dash.plans" | "channel.dash.directory.regions" | "channel.dash.directory.browse" | "channel.dash.directory.get" | "channel.dash.leads.capture" | "channel.dash.lead_portal.my_quotes" | "channel.dash.lead_portal.request_link" | "growth.public_workspace.leads.capture.channel";
|
|
1354
1391
|
interface ChannelRequestObservation {
|
|
1355
1392
|
operation: ChannelOperation;
|
|
1356
1393
|
method: string;
|
|
@@ -1438,10 +1475,20 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
|
|
|
1438
1475
|
*/
|
|
1439
1476
|
readonly availability: () => Promise<PaymentCollectionAvailability>;
|
|
1440
1477
|
};
|
|
1478
|
+
/** Confirmation and unsubscribe links from waitlist emails. */
|
|
1479
|
+
readonly audience: {
|
|
1480
|
+
readonly verify: (token: string) => Promise<WaitlistVerification>;
|
|
1481
|
+
readonly unsubscribe: (key: string) => Promise<WaitlistUnsubscription>;
|
|
1482
|
+
};
|
|
1441
1483
|
/** Tenant-level data exposed only to a dash-scoped channel token. */
|
|
1442
1484
|
readonly dash: {
|
|
1443
1485
|
readonly profile: () => Promise<DashProfileResponse>;
|
|
1444
1486
|
readonly init: () => Promise<DashInitResponse>;
|
|
1487
|
+
readonly waitlist: {
|
|
1488
|
+
readonly status: () => Promise<WaitlistGateStatus>;
|
|
1489
|
+
readonly form: () => Promise<WaitlistFormSettings>;
|
|
1490
|
+
readonly submit: (input: WaitlistSubmission, mutation?: ChannelMutationOptions) => Promise<WaitlistAcknowledgement>;
|
|
1491
|
+
};
|
|
1445
1492
|
readonly plans: () => Promise<DashPlansResponse>;
|
|
1446
1493
|
readonly directory: {
|
|
1447
1494
|
readonly regions: () => Promise<ListResponse<DashDirectoryRegion>>;
|
|
@@ -1508,6 +1555,7 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
|
|
|
1508
1555
|
readonly setAddresses: (orderId: string, input: CheckoutAddressesInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
|
|
1509
1556
|
readonly setFulfillment: (orderId: string, input: CheckoutFulfillmentInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
|
|
1510
1557
|
readonly pay: (orderId: string, input: CheckoutPayInput, mutation?: ChannelMutationOptions) => Promise<CheckoutPayResponse>;
|
|
1558
|
+
readonly cancel: (orderId: string, input: CheckoutCancelInput, mutation?: ChannelMutationOptions) => Promise<void>;
|
|
1511
1559
|
};
|
|
1512
1560
|
readonly reviews: {
|
|
1513
1561
|
readonly list: (params?: ChannelListParams) => Promise<ListResponse<Review>>;
|
|
@@ -1631,7 +1679,7 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
|
|
|
1631
1679
|
readonly delete: (addressId: string, mutation?: ChannelMutationOptions) => Promise<{
|
|
1632
1680
|
status?: string;
|
|
1633
1681
|
}>;
|
|
1634
|
-
readonly setDefault: (addressId: string,
|
|
1682
|
+
readonly setDefault: (addressId: string, mutation?: ChannelMutationOptions) => Promise<SavedAddressResponse>;
|
|
1635
1683
|
};
|
|
1636
1684
|
readonly paymentMethods: {
|
|
1637
1685
|
readonly list: () => Promise<ListResponse<SavedPaymentMethod>>;
|
|
@@ -1666,4 +1714,4 @@ declare function createChannelClient(options: CreateChannelClientOptions): {
|
|
|
1666
1714
|
};
|
|
1667
1715
|
};
|
|
1668
1716
|
|
|
1669
|
-
export { type AddCartItemInput, type BlogPost, type BlogPostResponse, type CartResponse, type CatalogBrand, type CatalogCategory, type CatalogCollection, type CatalogProduct, type CatalogProductsResponse, ChannelAPIError, type ChannelCheckoutStatusParams, ChannelConfigurationError, type ChannelGeo, type ChannelInvoiceListParams, type ChannelLeadInput, type ChannelListParams, type ChannelMutationOptions, type ChannelOperation, type ChannelPing, type ChannelProductListParams, type ChannelRequestObservation, type ChannelRequestObserver, type ChannelRequestOutcome, type ChannelRetryPolicy, type ChannelSiteResolveParams, type ChannelSubscriptionCancelParams, type ChannelSubscriptionListParams, type ChannelVisitor, type CheckoutAddress, type CheckoutAddressesInput, type CheckoutCustomerInput, type CheckoutFulfillmentInput, type CheckoutOptions, type CheckoutPayInput, type CheckoutPayResponse, type CheckoutStatus, type CheckoutStatusResponse, type CreateChannelClientOptions, type Customer, type CustomerAuthSession, type CustomerResponse, type CustomerSecurityActivity, type CustomerSecurityActivityPage, type CustomerSession, type CustomerSignupResponse, DEFAULT_CHANNEL_API_URL, type DashBrandingInfo, type DashDirectoryEntry, type DashDirectoryListParams, type DashDirectoryProfile, type DashDirectoryProfileResponse, type DashDirectoryRegion, type DashInitResponse, type DashLead, type DashLeadPortalMatch, type DashLeadPortalMovingSummary, type DashLeadPortalRequest, type DashLeadPortalRequestLinkInput, type DashLeadPortalRequestLinkResponse, type DashLeadPortalRequestStatus, type DashLeadPortalView, type DashLocaleInfo, type DashPlan, type DashPlanPricing, type DashPlanRegion, type DashPlansResponse, type DashProfileResponse, type DashPublicPage, type DashPublicProfileInfo, type DashTenantInfo, type DiningAvailability, type DiningAvailabilityRule, type DiningComboChoice, type DiningComboGroup, type DiningItemSize, type DiningMenu, type DiningMenuItem, type DiningModifier, type DiningModifierGroup, type DiningOffer, type DiningOfferBadge, type GivingEntry, type GivingIntent, type GivingIntentListResponse, type LeadResponse, type LightInitResponse, type ListResponse, type Menu, type MenuItem, type MenuResponse, type MergeCartInput, type Order, type OrderItem, type OrderSummary, type PaymentCollectionAvailability, type PaymentLinkCheckoutInput, type PaymentLinkCheckoutResponse, type PaymentLinkRedemptionStatus, type PaymentLinkRedemptionStatusResponse, type PaymentMethodConfirmInput, type PaymentMethodMutationResponse, type PaymentMethodOption, type PaymentMethodSetupInput, type PaymentMethodSetupResult, type PaymentReadiness, type PrintBranding, type PrintIntakeInput, type PrintIntakeLimits, type PrintJob, type PrintJobFile, type PrintOptionsSelection, type PrintPaperSize, type PrintPerPagePricing, type PrintPriceBreakdown, type PrintPriceLine, type PrintPricing, type PrintPricingOption, type PrintQuoteResponse, type PrintSettingsResponse, type Product, type ProductAsset, type PublicPage, type PublicPageSummary, type PublicPaymentLink, type PublicPaymentLinkResponse, type PublicSubmitReviewInput, type PublicWorkspaceInit, type Review, type ReviewSummaryResponse, type SavedAddress, type
|
|
1717
|
+
export { type AddCartItemInput, type BlogPost, type BlogPostResponse, type CartResponse, type CatalogBrand, type CatalogCategory, type CatalogCollection, type CatalogProduct, type CatalogProductsResponse, ChannelAPIError, type ChannelCheckoutStatusParams, ChannelConfigurationError, type ChannelGeo, type ChannelInvoiceListParams, type ChannelLeadInput, type ChannelListParams, type ChannelMutationOptions, type ChannelOperation, type ChannelPing, type ChannelProductListParams, type ChannelRequestObservation, type ChannelRequestObserver, type ChannelRequestOutcome, type ChannelRetryPolicy, type ChannelSiteResolveParams, type ChannelSubscriptionCancelParams, type ChannelSubscriptionListParams, type ChannelVisitor, type CheckoutAddress, type CheckoutAddressesInput, type CheckoutCancelInput, type CheckoutCustomerInput, type CheckoutFulfillmentInput, type CheckoutOptions, type CheckoutPayInput, type CheckoutPayResponse, type CheckoutStatus, type CheckoutStatusResponse, type CreateChannelClientOptions, type Customer, type CustomerAuthSession, type CustomerResponse, type CustomerSecurityActivity, type CustomerSecurityActivityPage, type CustomerSession, type CustomerSignupResponse, DEFAULT_CHANNEL_API_URL, type DashBrandingInfo, type DashDirectoryEntry, type DashDirectoryListParams, type DashDirectoryProfile, type DashDirectoryProfileResponse, type DashDirectoryRegion, type DashInitResponse, type DashLead, type DashLeadPortalMatch, type DashLeadPortalMovingSummary, type DashLeadPortalRequest, type DashLeadPortalRequestLinkInput, type DashLeadPortalRequestLinkResponse, type DashLeadPortalRequestStatus, type DashLeadPortalView, type DashLocaleInfo, type DashPlan, type DashPlanPricing, type DashPlanRegion, type DashPlansResponse, type DashProfileResponse, type DashPublicPage, type DashPublicProfileInfo, type DashTenantInfo, type DiningAvailability, type DiningAvailabilityRule, type DiningComboChoice, type DiningComboGroup, type DiningItemSize, type DiningMenu, type DiningMenuItem, type DiningModifier, type DiningModifierGroup, type DiningOffer, type DiningOfferBadge, type GivingEntry, type GivingIntent, type GivingIntentListResponse, type LeadResponse, type LightInitResponse, type ListResponse, type Menu, type MenuItem, type MenuResponse, type MergeCartInput, type Order, type OrderItem, type OrderSummary, type PaymentCollectionAvailability, type PaymentLinkCheckoutInput, type PaymentLinkCheckoutResponse, type PaymentLinkRedemptionStatus, type PaymentLinkRedemptionStatusResponse, type PaymentMethodConfirmInput, type PaymentMethodMutationResponse, type PaymentMethodOption, type PaymentMethodSetupInput, type PaymentMethodSetupResult, type PaymentReadiness, type PrintBranding, type PrintIntakeInput, type PrintIntakeLimits, type PrintJob, type PrintJobFile, type PrintOptionsSelection, type PrintPaperSize, type PrintPerPagePricing, type PrintPriceBreakdown, type PrintPriceLine, type PrintPricing, type PrintPricingOption, type PrintQuoteResponse, type PrintSettingsResponse, type Product, type ProductAsset, type PublicGate, type PublicPage, type PublicPageSummary, type PublicPaymentLink, type PublicPaymentLinkResponse, type PublicSubmitReviewInput, type PublicWorkspaceInit, type Review, type ReviewSummaryResponse, type SavedAddress, type SavedAddressInput, type SavedAddressResponse, type SavedAddressUpdateInput, type SavedPaymentMethod, type SendCodeResponse, type ShippingMethodOption, type SiteDocument, type SiteGatedDocument, type SiteRef, type SiteResolvedDocument, type SiteSubject, type StartGivingInput, type StartGivingResponse, type StartSubscriptionInput, type SubscriptionAgreement, type SubscriptionAgreementResponse, type SubscriptionInvoice, type SubscriptionInvoiceListResponse, type SubscriptionInvoiceResponse, type SubscriptionListResponse, type SubscriptionPlanListResponse, type SubscriptionPlanOffer, type SubscriptionPlanResponse, type SubscriptionSourceDisplay, type SubscriptionSourceResponse, type ThemeResponse, type UpdateCartItemInput, type WaitlistAcknowledgement, type WaitlistAttribution, type WaitlistFormSettings, type WaitlistGateStatus, type WaitlistSubmission, type WaitlistUnsubscription, type WaitlistVerification, type WorkspaceInfo, createChannelClient, isChannelAPIError, isChannelConfigurationError };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-
|
|
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-
|
|
1
|
+
export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-LBOYLZ4J.js';
|
|
2
|
+
export { CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelConfigurationError, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, isChannelConfigurationError, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './chunk-XPO7C3DW.js';
|
package/dist/next.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createChannelClient, Order, AddCartItemInput, CartResponse, CheckoutOptions, ChannelCheckoutStatusParams, CheckoutStatusResponse, CheckoutCustomerInput, CheckoutAddressesInput, CheckoutFulfillmentInput, CheckoutPayInput, ChannelMutationOptions, CheckoutPayResponse, CreateChannelClientOptions, ChannelPing, ChannelVisitor, ChannelGeo, PaymentCollectionAvailability, DashProfileResponse, DashInitResponse, DashPlansResponse, ListResponse, DashDirectoryRegion, DashDirectoryListParams, DashDirectoryEntry, DashDirectoryProfileResponse, ChannelLeadInput, DashLead, DashLeadPortalRequestLinkInput, DashLeadPortalRequestLinkResponse, DashLeadPortalView, ChannelSiteResolveParams, SiteDocument, PublicWorkspaceInit, LightInitResponse, ChannelListParams, PublicPageSummary, PublicPage, ChannelProductListParams, Product, ProductAsset, CatalogCategory, CatalogProductsResponse, CatalogCollection, CatalogBrand, UpdateCartItemInput, MergeCartInput, Review, ReviewSummaryResponse, PublicSubmitReviewInput, ThemeResponse, MenuResponse, BlogPost, BlogPostResponse, GivingEntry, StartGivingInput, StartGivingResponse, SubscriptionPlanListResponse, SubscriptionPlanResponse, PublicPaymentLinkResponse, PaymentLinkCheckoutInput, PaymentLinkCheckoutResponse, PaymentLinkRedemptionStatusResponse, PrintSettingsResponse, PrintOptionsSelection, PrintQuoteResponse, PrintIntakeInput, PrintJob, DiningMenu, CustomerSignupResponse, SendCodeResponse, CustomerSession, CustomerResponse, CustomerAuthSession, CustomerSecurityActivityPage, OrderSummary, SavedAddress, SavedAddressResponse, SavedAddressInput, SavedAddressUpdateInput,
|
|
1
|
+
import { createChannelClient, Order, AddCartItemInput, CartResponse, CheckoutOptions, ChannelCheckoutStatusParams, CheckoutStatusResponse, CheckoutCustomerInput, CheckoutAddressesInput, CheckoutFulfillmentInput, CheckoutPayInput, ChannelMutationOptions, CheckoutPayResponse, CheckoutCancelInput, CreateChannelClientOptions, ChannelPing, ChannelVisitor, ChannelGeo, PaymentCollectionAvailability, WaitlistVerification, WaitlistUnsubscription, DashProfileResponse, DashInitResponse, WaitlistGateStatus, WaitlistFormSettings, WaitlistSubmission, WaitlistAcknowledgement, DashPlansResponse, ListResponse, DashDirectoryRegion, DashDirectoryListParams, DashDirectoryEntry, DashDirectoryProfileResponse, ChannelLeadInput, DashLead, DashLeadPortalRequestLinkInput, DashLeadPortalRequestLinkResponse, DashLeadPortalView, ChannelSiteResolveParams, SiteDocument, PublicWorkspaceInit, LightInitResponse, ChannelListParams, PublicPageSummary, PublicPage, ChannelProductListParams, Product, ProductAsset, CatalogCategory, CatalogProductsResponse, CatalogCollection, CatalogBrand, UpdateCartItemInput, MergeCartInput, Review, ReviewSummaryResponse, PublicSubmitReviewInput, ThemeResponse, MenuResponse, BlogPost, BlogPostResponse, GivingEntry, StartGivingInput, StartGivingResponse, SubscriptionPlanListResponse, SubscriptionPlanResponse, PublicPaymentLinkResponse, PaymentLinkCheckoutInput, PaymentLinkCheckoutResponse, PaymentLinkRedemptionStatusResponse, PrintSettingsResponse, PrintOptionsSelection, PrintQuoteResponse, PrintIntakeInput, PrintJob, DiningMenu, CustomerSignupResponse, SendCodeResponse, CustomerSession, CustomerResponse, CustomerAuthSession, CustomerSecurityActivityPage, OrderSummary, SavedAddress, SavedAddressResponse, SavedAddressInput, SavedAddressUpdateInput, SavedPaymentMethod, PaymentMethodSetupInput, PaymentMethodSetupResult, PaymentMethodConfirmInput, PaymentMethodMutationResponse, StartSubscriptionInput, SubscriptionAgreementResponse, ChannelSubscriptionListParams, SubscriptionListResponse, SubscriptionSourceResponse, ChannelSubscriptionCancelParams, ChannelInvoiceListParams, SubscriptionInvoiceListResponse, SubscriptionInvoiceResponse, GivingIntentListResponse, LeadResponse } from './index.js';
|
|
2
2
|
import { ChannelWebhookEventDataMap, ChannelWebhookEvent } from './webhooks.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -243,6 +243,10 @@ declare function createCart(options: CreateCartOptions): {
|
|
|
243
243
|
}, attempt: ChannelMutationOptions & {
|
|
244
244
|
idempotencyKey: string;
|
|
245
245
|
}) => Promise<CheckoutPayResponse>;
|
|
246
|
+
/** Expire the hosted provider session before returning the cart to editing. */
|
|
247
|
+
readonly cancel: (orderId: string, input: CheckoutCancelInput, attempt: ChannelMutationOptions & {
|
|
248
|
+
idempotencyKey: string;
|
|
249
|
+
}) => Promise<void>;
|
|
246
250
|
};
|
|
247
251
|
};
|
|
248
252
|
type CartKit = ReturnType<typeof createCart>;
|
|
@@ -285,9 +289,18 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
|
|
|
285
289
|
readonly payments: {
|
|
286
290
|
readonly availability: () => Promise<PaymentCollectionAvailability>;
|
|
287
291
|
};
|
|
292
|
+
readonly audience: {
|
|
293
|
+
readonly verify: (token: string) => Promise<WaitlistVerification>;
|
|
294
|
+
readonly unsubscribe: (key: string) => Promise<WaitlistUnsubscription>;
|
|
295
|
+
};
|
|
288
296
|
readonly dash: {
|
|
289
297
|
readonly profile: () => Promise<DashProfileResponse>;
|
|
290
298
|
readonly init: () => Promise<DashInitResponse>;
|
|
299
|
+
readonly waitlist: {
|
|
300
|
+
readonly status: () => Promise<WaitlistGateStatus>;
|
|
301
|
+
readonly form: () => Promise<WaitlistFormSettings>;
|
|
302
|
+
readonly submit: (input: WaitlistSubmission, mutation?: ChannelMutationOptions) => Promise<WaitlistAcknowledgement>;
|
|
303
|
+
};
|
|
291
304
|
readonly plans: () => Promise<DashPlansResponse>;
|
|
292
305
|
readonly directory: {
|
|
293
306
|
readonly regions: () => Promise<ListResponse<DashDirectoryRegion>>;
|
|
@@ -354,6 +367,7 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
|
|
|
354
367
|
readonly setAddresses: (orderId: string, input: CheckoutAddressesInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
|
|
355
368
|
readonly setFulfillment: (orderId: string, input: CheckoutFulfillmentInput, mutation?: ChannelMutationOptions) => Promise<CartResponse>;
|
|
356
369
|
readonly pay: (orderId: string, input: CheckoutPayInput, mutation?: ChannelMutationOptions) => Promise<CheckoutPayResponse>;
|
|
370
|
+
readonly cancel: (orderId: string, input: CheckoutCancelInput, mutation?: ChannelMutationOptions) => Promise<void>;
|
|
357
371
|
};
|
|
358
372
|
readonly reviews: {
|
|
359
373
|
readonly list: (params?: ChannelListParams) => Promise<ListResponse<Review>>;
|
|
@@ -466,7 +480,7 @@ declare function createNextChannelClient(options: CreateNextChannelClientOptions
|
|
|
466
480
|
readonly delete: (addressId: string, mutation?: ChannelMutationOptions) => Promise<{
|
|
467
481
|
status?: string;
|
|
468
482
|
}>;
|
|
469
|
-
readonly setDefault: (addressId: string,
|
|
483
|
+
readonly setDefault: (addressId: string, mutation?: ChannelMutationOptions) => Promise<SavedAddressResponse>;
|
|
470
484
|
};
|
|
471
485
|
readonly paymentMethods: {
|
|
472
486
|
readonly list: () => Promise<ListResponse<SavedPaymentMethod>>;
|
package/dist/next.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { CHANNEL_CATALOG_CACHE_TAG, CHANNEL_SITE_CACHE_TAG, cartCookie, createCart, createChannelWebhookRoute, createCustomerSession, createNextChannelClient, defaultChannelCacheTags, safePublishedPath, sessionCookie } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { CHANNEL_CATALOG_CACHE_TAG, CHANNEL_SITE_CACHE_TAG, cartCookie, createCart, createChannelWebhookRoute, createCustomerSession, createNextChannelClient, defaultChannelCacheTags, safePublishedPath, sessionCookie } from './chunk-CPQT34K2.js';
|
|
2
|
+
import './chunk-LBOYLZ4J.js';
|
|
3
|
+
import './chunk-XPO7C3DW.js';
|
package/dist/webhooks.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* PII-free fields; fetch the detail back through the channel client. Data POSTed
|
|
10
10
|
* to your server can never be reached by a GDPR erasure on ours.
|
|
11
11
|
*/
|
|
12
|
-
declare const CHANNEL_WEBHOOK_EVENT_TYPES: readonly ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
|
|
12
|
+
declare const CHANNEL_WEBHOOK_EVENT_TYPES: readonly ["order.created", "order.paid", "order.updated", "order.cancelled", "order.refunded", "fulfillment.shipped", "fulfillment.delivered", "lead.created", "review.submitted", "review.published", "page.published", "page.updated", "page.deleted", "menu.updated", "product.created", "product.updated", "product.deleted"];
|
|
13
13
|
type ChannelWebhookEventType = (typeof CHANNEL_WEBHOOK_EVENT_TYPES)[number];
|
|
14
14
|
interface OrderEventData {
|
|
15
15
|
order_id: string;
|
|
@@ -20,6 +20,16 @@ interface OrderEventData {
|
|
|
20
20
|
total_cents: number;
|
|
21
21
|
created_at: string;
|
|
22
22
|
}
|
|
23
|
+
interface FulfillmentEventData {
|
|
24
|
+
fulfillment_id: string;
|
|
25
|
+
order_id: string;
|
|
26
|
+
status: string;
|
|
27
|
+
tracking_number?: string;
|
|
28
|
+
tracking_url?: string;
|
|
29
|
+
carrier?: string;
|
|
30
|
+
shipped_at?: string;
|
|
31
|
+
delivered_at?: string;
|
|
32
|
+
}
|
|
23
33
|
interface LeadCreatedEventData {
|
|
24
34
|
lead_id: string;
|
|
25
35
|
source: string;
|
|
@@ -72,6 +82,8 @@ interface ChannelWebhookEventDataMap {
|
|
|
72
82
|
"order.updated": OrderEventData;
|
|
73
83
|
"order.cancelled": OrderEventData;
|
|
74
84
|
"order.refunded": OrderEventData;
|
|
85
|
+
"fulfillment.shipped": FulfillmentEventData;
|
|
86
|
+
"fulfillment.delivered": FulfillmentEventData;
|
|
75
87
|
"lead.created": LeadCreatedEventData;
|
|
76
88
|
"review.submitted": ReviewSubmittedEventData;
|
|
77
89
|
"review.published": ReviewPublishedEventData;
|
|
@@ -181,4 +193,4 @@ interface ParseChannelWebhookEventOptions {
|
|
|
181
193
|
*/
|
|
182
194
|
declare function parseChannelWebhookEvent(request: Request, options: ParseChannelWebhookEventOptions): Promise<ParsedChannelWebhookEvent>;
|
|
183
195
|
|
|
184
|
-
export { type AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, type ChannelWebhookEvent, type ChannelWebhookEventDataMap, type ChannelWebhookEventType, type ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, type LeadCreatedEventData, type MenuUpdatedEventData, type OrderEventData, type PagePublishedEventData, type ParseChannelWebhookEventOptions, type ParsedChannelWebhookEvent, type ProductEventData, type ReviewPublishedEventData, type ReviewSubmittedEventData, type UnknownChannelWebhookEvent, type VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature };
|
|
196
|
+
export { type AnyChannelWebhookEvent, CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, type ChannelWebhookEvent, type ChannelWebhookEventDataMap, type ChannelWebhookEventType, type ChannelWebhookVerificationCode, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, type FulfillmentEventData, type LeadCreatedEventData, type MenuUpdatedEventData, type OrderEventData, type PagePublishedEventData, type ParseChannelWebhookEventOptions, type ParsedChannelWebhookEvent, type ProductEventData, type ReviewPublishedEventData, type ReviewSubmittedEventData, type UnknownChannelWebhookEvent, type VerifyChannelWebhookSignatureOptions, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature };
|
package/dist/webhooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './chunk-
|
|
1
|
+
export { CHANNEL_WEBHOOK_EVENT_ID_HEADER, CHANNEL_WEBHOOK_EVENT_TYPES, CHANNEL_WEBHOOK_SIGNATURE_HEADER, CHANNEL_WEBHOOK_TIMESTAMP_HEADER, ChannelWebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, isChannelWebhookEventType, isChannelWebhookVerificationError, isKnownChannelWebhookEvent, parseChannelWebhookEvent, verifyChannelWebhookSignature } from './chunk-XPO7C3DW.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c1m-public/channel-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Typed server-side client for the MML headless Channel API",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"typescript": "5.9.3",
|
|
72
72
|
"vitest": "^4.1.4",
|
|
73
73
|
"zod": "^4.3.6",
|
|
74
|
-
"@c1m-public/
|
|
75
|
-
"@c1m-public/
|
|
74
|
+
"@c1m-public/resilience": "0.1.0",
|
|
75
|
+
"@c1m-public/transport": "0.0.0"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|