@slotchain/sdk 1.4.0 → 1.5.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/index.cjs.js CHANGED
@@ -1594,6 +1594,40 @@ var DocumentClient = class {
1594
1594
  }
1595
1595
  };
1596
1596
 
1597
+ // src/clients/notices-client.ts
1598
+ var NoticesClient = class {
1599
+ constructor(client) {
1600
+ this.base = "/api/v1/notices";
1601
+ this.client = client;
1602
+ }
1603
+ /**
1604
+ * List active notices for a tenant.
1605
+ * Returns only notices where visible_until > activeAt (default: now).
1606
+ */
1607
+ async list(options) {
1608
+ const response = await this.client.get(this.base, {
1609
+ params: {
1610
+ tenant_id: options.tenantId,
1611
+ active_at: options.activeAt,
1612
+ slot_id: options.slotId,
1613
+ types: options.types?.join(",")
1614
+ }
1615
+ });
1616
+ return response.data;
1617
+ }
1618
+ /**
1619
+ * Get a single notice by its slot_moment id.
1620
+ */
1621
+ async getById(id, tenantId) {
1622
+ const response = await this.client.get(`${this.base}/${id}`, {
1623
+ params: { tenant_id: tenantId }
1624
+ });
1625
+ const { data } = response.data;
1626
+ if (!data) throw new Error(`Notice ${id} not found`);
1627
+ return data;
1628
+ }
1629
+ };
1630
+
1597
1631
  // src/errors.ts
1598
1632
  var SlotlyApiError = class _SlotlyApiError extends Error {
1599
1633
  constructor(code, message, statusCode, details) {
@@ -1927,7 +1961,8 @@ var useSlotly = (options) => {
1927
1961
  notification: new NotificationClient(client),
1928
1962
  dataQuality: new DataQualityClient(client),
1929
1963
  organization: new OrganizationClient(client),
1930
- document: new DocumentClient(client)
1964
+ document: new DocumentClient(client),
1965
+ notices: new NoticesClient(client)
1931
1966
  };
1932
1967
  };
1933
1968
  var index_default = useSlotly;