@c1m-public/channel-client 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { createChannelClient } from './chunk-C44TGKRK.js';
1
+ import { createChannelClient } from './chunk-S74HRBIF.js';
2
2
  import 'server-only';
3
3
 
4
4
  function narrow(client) {
@@ -1,4 +1,4 @@
1
- import { isChannelAPIError, createChannelClient } from './chunk-C44TGKRK.js';
1
+ import { isChannelAPIError, createChannelClient } from './chunk-S74HRBIF.js';
2
2
  import { parseChannelWebhookEvent, isChannelWebhookVerificationError, isChannelWebhookEventType, ChannelConfigurationError } from './chunk-RJQ4YEZV.js';
3
3
  import 'server-only';
4
4
 
@@ -52,7 +52,7 @@ function isRetryableRequest(method, headers, retry) {
52
52
  if (method === "GET") return true;
53
53
  return retry.idempotentWrites === true && headers.has("Idempotency-Key");
54
54
  }
55
- async function performRequest(transport, url, init, observe) {
55
+ async function performRequest(transport, url, init, observe, decode) {
56
56
  const method = (init.method ?? "GET").toUpperCase();
57
57
  const headers = new Headers(init.headers);
58
58
  const startedAt = Date.now();
@@ -113,7 +113,8 @@ async function performRequest(transport, url, init, observe) {
113
113
  payload = void 0;
114
114
  } else {
115
115
  const text = await response.text();
116
- payload = text ? JSON.parse(text) : void 0;
116
+ const parsed = text ? JSON.parse(text) : void 0;
117
+ payload = decode ? decode(parsed) : parsed;
117
118
  }
118
119
  } catch {
119
120
  return fail({ outcome: "invalid_response", status, code: "", message: "", requestId });
package/dist/dash-next.js CHANGED
@@ -1,6 +1,6 @@
1
- import { createNextChannelClient } from './chunk-BSTXJIVL.js';
2
- import { narrow } from './chunk-FRUWMKQP.js';
3
- import './chunk-C44TGKRK.js';
1
+ import { createNextChannelClient } from './chunk-L6GZU55H.js';
2
+ import { narrow } from './chunk-KXPPMNNQ.js';
3
+ import './chunk-S74HRBIF.js';
4
4
  import './chunk-RJQ4YEZV.js';
5
5
  import 'server-only';
6
6
 
package/dist/dash.js CHANGED
@@ -1,3 +1,3 @@
1
- export { createDashChannelClient, narrow as narrowToDash } from './chunk-FRUWMKQP.js';
2
- import './chunk-C44TGKRK.js';
1
+ export { createDashChannelClient, narrow as narrowToDash } from './chunk-KXPPMNNQ.js';
2
+ import './chunk-S74HRBIF.js';
3
3
  import './chunk-RJQ4YEZV.js';
package/dist/index.d.ts CHANGED
@@ -269,7 +269,7 @@ interface DashLead {
269
269
  }
270
270
  interface PublicPageSummary {
271
271
  id: string;
272
- saas_app: string;
272
+ dash_id: string;
273
273
  workspace_id: string;
274
274
  source: string;
275
275
  route_kind: string;
@@ -444,7 +444,7 @@ interface LeadResponse {
444
444
  interface SiteSubject {
445
445
  kind: "workspace";
446
446
  id: string;
447
- saas_app?: string;
447
+ dash_id?: string;
448
448
  display_name?: string;
449
449
  }
450
450
  interface SiteResolvedDocument {
@@ -1005,7 +1005,7 @@ interface DiningMenuItem {
1005
1005
  combo_groups?: DiningComboGroup[];
1006
1006
  }
1007
1007
  interface DiningMenu {
1008
- saas_app: string;
1008
+ dash_id: string;
1009
1009
  workspace_id: string;
1010
1010
  board: {
1011
1011
  id: string;
@@ -1256,7 +1256,7 @@ interface OrderSummary {
1256
1256
  interface ChannelPing {
1257
1257
  channel_id: string;
1258
1258
  workspace_id: string;
1259
- saas_app: string;
1259
+ dash_id: string;
1260
1260
  scope: "workspace" | "dash";
1261
1261
  api_version: string;
1262
1262
  attestation?: string;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-C44TGKRK.js';
1
+ export { ChannelAPIError, DEFAULT_CHANNEL_API_URL, createChannelClient, isChannelAPIError } from './chunk-S74HRBIF.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-RJQ4YEZV.js';
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-BSTXJIVL.js';
2
- import './chunk-C44TGKRK.js';
1
+ export { CHANNEL_CATALOG_CACHE_TAG, CHANNEL_SITE_CACHE_TAG, cartCookie, createCart, createChannelWebhookRoute, createCustomerSession, createNextChannelClient, defaultChannelCacheTags, safePublishedPath, sessionCookie } from './chunk-L6GZU55H.js';
2
+ import './chunk-S74HRBIF.js';
3
3
  import './chunk-RJQ4YEZV.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c1m-public/channel-client",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Typed server-side client for the MML headless Channel API",