@slotchain/sdk 1.5.0 → 1.6.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.
@@ -172,7 +172,23 @@ export class TenantClient {
172
172
  `/api/v1/tenants/${slug}`,
173
173
  { params: { includeServices } }
174
174
  );
175
- return response.data;
175
+
176
+ // Strip soft-deleted and withdrawn items so consumers never have to
177
+ // guard against them — a deleted service or withdrawn role should be
178
+ // invisible to anything built on the SDK.
179
+ const data = response.data;
180
+ if (data?.data?.services) {
181
+ data.data.services = data.data.services
182
+ .filter((s) => !s.deleted_at)
183
+ .map((s) => ({
184
+ ...s,
185
+ serviceItems: (s.serviceItems ?? []).filter(
186
+ (item) => !item.deleted_at && !item.withdrawn_at,
187
+ ),
188
+ }));
189
+ }
190
+
191
+ return data;
176
192
  }
177
193
  }
178
194
 
package/src/index.ts CHANGED
@@ -58,6 +58,7 @@ export type {
58
58
  UploadArtifactOptions,
59
59
  SlotNotice,
60
60
  NoticeMomentType,
61
+ NoticeCta,
61
62
  ListNoticesOptions,
62
63
  } from './types/api';
63
64
 
package/src/types/api.ts CHANGED
@@ -68,6 +68,10 @@ export interface ServiceItem {
68
68
  sort_order?: number;
69
69
  created_at: string;
70
70
  updated_at: string;
71
+ /** Set when the item has been soft-deleted. Filtered out by the SDK. */
72
+ deleted_at?: string | null;
73
+ /** Set when the item was withdrawn by the publisher (syndication). Filtered out by the SDK. */
74
+ withdrawn_at?: string | null;
71
75
  }
72
76
 
73
77
  /**
@@ -170,6 +174,8 @@ export interface Service {
170
174
  price?: number;
171
175
  created_at: string;
172
176
  updated_at: string;
177
+ /** Set when the service has been soft-deleted. Filtered out by the SDK. */
178
+ deleted_at?: string | null;
173
179
  }
174
180
 
175
181
  /**
@@ -498,6 +504,18 @@ export type NoticeMomentType =
498
504
  | 'closure_notice'
499
505
  | 'venue_change';
500
506
 
507
+ /**
508
+ * Optional call-to-action button attached to a notice.
509
+ * `url` is either an absolute http(s) URL or a site-relative path ('/contact-us').
510
+ * Only returned when both halves are present — a partial CTA is dropped server-side.
511
+ */
512
+ export interface NoticeCta {
513
+ label: string;
514
+ url: string;
515
+ /** Open the link in a new tab. Defaults to true for notices created without the flag. */
516
+ newTab: boolean;
517
+ }
518
+
501
519
  export interface SlotNotice {
502
520
  id: string;
503
521
  slotId: string;
@@ -521,6 +539,8 @@ export interface SlotNotice {
521
539
  imageUrl?: string | null;
522
540
  /** Staff-picked display treatment — 'banner' (compact, stacks) or 'modal' (full-screen, one at a time) */
523
541
  presentation: 'banner' | 'modal';
542
+ /** Call-to-action button, or null when the notice has none */
543
+ cta?: NoticeCta | null;
524
544
  };
525
545
  affectedBookingIds: string[];
526
546
  }