@relai-team/access-sdk 0.15.0 → 0.16.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.d.cts CHANGED
@@ -225,8 +225,43 @@ interface ExchangeZone {
225
225
  placement: "inside" | "outside" | "both" | "na";
226
226
  /** IANA timezone of the location, for presenting local times. */
227
227
  timezone: string;
228
+ /**
229
+ * True when this Exchange Zone has no operating hours and is always open.
230
+ * Every Exchange Zone is 24/7 unless its host sets hours, so this is usually
231
+ * true and `operating_hours` is usually null.
232
+ */
233
+ open_24_7: boolean;
234
+ /** The weekly schedule, or null when `open_24_7`. An absent or null day is closed. */
235
+ operating_hours: OperatingHours | null;
236
+ /**
237
+ * Computed server-side in THIS Exchange Zone's timezone, daylight saving
238
+ * included. Trust it rather than comparing `operating_hours` against the
239
+ * device clock: the device is in the user's timezone, which is not
240
+ * necessarily the Exchange Zone's, and the arithmetic across a DST boundary
241
+ * is where hand-rolled versions go wrong.
242
+ */
243
+ is_open_now: boolean;
244
+ /** When it next opens. Null when open now, and null when it never opens. */
245
+ next_open_at: string | null;
228
246
  is_simulated: boolean;
229
247
  }
248
+ /** A day's window in the Exchange Zone's local time. Null means closed. */
249
+ interface DayWindow {
250
+ /** `HH:MM`, 24-hour, local to the Exchange Zone. */
251
+ open: string;
252
+ /** `HH:MM`. At or before `open` means the window runs through midnight. */
253
+ close: string;
254
+ }
255
+ /** A week of operating hours. A day that is absent or null is closed. */
256
+ interface OperatingHours {
257
+ sun?: DayWindow | null;
258
+ mon?: DayWindow | null;
259
+ tue?: DayWindow | null;
260
+ wed?: DayWindow | null;
261
+ thu?: DayWindow | null;
262
+ fri?: DayWindow | null;
263
+ sat?: DayWindow | null;
264
+ }
230
265
  /**
231
266
  * One page of Exchange Zones, and the cursor to continue.
232
267
  *
@@ -1478,4 +1513,4 @@ declare class RelaiTransportError extends RelaiError {
1478
1513
  constructor(message: string);
1479
1514
  }
1480
1515
 
1481
- export { type AccessLinkTarget, AccessLinksModule, type AnyWebhookEvent, type ApiEnvironment, type ApiErrorBody, AppModule, type AppSelf, AuthModule, type BleDeviceLike, type BleManagerLike, BleTransport, type BleTransportOptions, type CommandAck, type DeliverOptions, type DiscoveredParent, type EndUser, type EndUserPage, EndUsersModule, type ExchangeZone, type ExchangeZoneDetail, type ExchangeZonePage, ExchangeZonesModule, type GrantAlgorithm, GrantsModule, type HandoffMode, type Intent, Intents, type KeyValueStorage, type Me, MemoryTelemetryQueue, MemoryTokenStorage, type MintedCommand, type NotifyLine, type Open, type Order, type OrderPage, type OrderStatusFields, OrdersModule, type OverrideLink, OverrideLinksModule, type ParentTransport, type PaymentRequiredDetails, PushModule, type PushPlatform, type QueuedTelemetry, REJECT_REASONS, RELAI_RX_CHAR, RELAI_TX_CHAR, RELAI_UART_SERVICE, type RecipientMatch, RecipientsModule, RelaiApiError, RelaiClient, type RelaiClientOptions, RelaiConfigError, RelaiError, type RelaiErrorContext, RelaiLateFeeDue, RelaiMissingKeyError, RelaiNetworkError, RelaiTransportError, RelaiUnlockRejected, type SandboxFault, type SandboxFaultResult, SandboxModule, type SelfBillingChoice, type Session, SimAuthenticatedTransport, type SimAuthenticatedTransportOptions, type SimulatedParentConfig, SimulatedTransport, StorageTelemetryQueue, type StorageTelemetryQueueOptions, type StripeSdk, type TelemetryAction, type TelemetryEvent, TelemetryModule, type TelemetryPayload, type TelemetryQueue, TelemetryUploader, type TokenPair, type TokenStorage, type Tower, type TowerNode, type TowerTelemetry, type UnlockDeps, type UnlockGrant, type UnlockInput, type UnlockResult, type VerifyWebhookInput, type WebhookEvent, type WebhookEventOf, type WebhookEventType, type WebhookPayloads, asPaymentRequired, deliverOpen, isStripePublishableKey, parseNotifyLine, presentRelaiPaymentSheet, verifyWebhook };
1516
+ export { type AccessLinkTarget, AccessLinksModule, type AnyWebhookEvent, type ApiEnvironment, type ApiErrorBody, AppModule, type AppSelf, AuthModule, type BleDeviceLike, type BleManagerLike, BleTransport, type BleTransportOptions, type CommandAck, type DayWindow, type DeliverOptions, type DiscoveredParent, type EndUser, type EndUserPage, EndUsersModule, type ExchangeZone, type ExchangeZoneDetail, type ExchangeZonePage, ExchangeZonesModule, type GrantAlgorithm, GrantsModule, type HandoffMode, type Intent, Intents, type KeyValueStorage, type Me, MemoryTelemetryQueue, MemoryTokenStorage, type MintedCommand, type NotifyLine, type Open, type OperatingHours, type Order, type OrderPage, type OrderStatusFields, OrdersModule, type OverrideLink, OverrideLinksModule, type ParentTransport, type PaymentRequiredDetails, PushModule, type PushPlatform, type QueuedTelemetry, REJECT_REASONS, RELAI_RX_CHAR, RELAI_TX_CHAR, RELAI_UART_SERVICE, type RecipientMatch, RecipientsModule, RelaiApiError, RelaiClient, type RelaiClientOptions, RelaiConfigError, RelaiError, type RelaiErrorContext, RelaiLateFeeDue, RelaiMissingKeyError, RelaiNetworkError, RelaiTransportError, RelaiUnlockRejected, type SandboxFault, type SandboxFaultResult, SandboxModule, type SelfBillingChoice, type Session, SimAuthenticatedTransport, type SimAuthenticatedTransportOptions, type SimulatedParentConfig, SimulatedTransport, StorageTelemetryQueue, type StorageTelemetryQueueOptions, type StripeSdk, type TelemetryAction, type TelemetryEvent, TelemetryModule, type TelemetryPayload, type TelemetryQueue, TelemetryUploader, type TokenPair, type TokenStorage, type Tower, type TowerNode, type TowerTelemetry, type UnlockDeps, type UnlockGrant, type UnlockInput, type UnlockResult, type VerifyWebhookInput, type WebhookEvent, type WebhookEventOf, type WebhookEventType, type WebhookPayloads, asPaymentRequired, deliverOpen, isStripePublishableKey, parseNotifyLine, presentRelaiPaymentSheet, verifyWebhook };
package/dist/index.d.ts CHANGED
@@ -225,8 +225,43 @@ interface ExchangeZone {
225
225
  placement: "inside" | "outside" | "both" | "na";
226
226
  /** IANA timezone of the location, for presenting local times. */
227
227
  timezone: string;
228
+ /**
229
+ * True when this Exchange Zone has no operating hours and is always open.
230
+ * Every Exchange Zone is 24/7 unless its host sets hours, so this is usually
231
+ * true and `operating_hours` is usually null.
232
+ */
233
+ open_24_7: boolean;
234
+ /** The weekly schedule, or null when `open_24_7`. An absent or null day is closed. */
235
+ operating_hours: OperatingHours | null;
236
+ /**
237
+ * Computed server-side in THIS Exchange Zone's timezone, daylight saving
238
+ * included. Trust it rather than comparing `operating_hours` against the
239
+ * device clock: the device is in the user's timezone, which is not
240
+ * necessarily the Exchange Zone's, and the arithmetic across a DST boundary
241
+ * is where hand-rolled versions go wrong.
242
+ */
243
+ is_open_now: boolean;
244
+ /** When it next opens. Null when open now, and null when it never opens. */
245
+ next_open_at: string | null;
228
246
  is_simulated: boolean;
229
247
  }
248
+ /** A day's window in the Exchange Zone's local time. Null means closed. */
249
+ interface DayWindow {
250
+ /** `HH:MM`, 24-hour, local to the Exchange Zone. */
251
+ open: string;
252
+ /** `HH:MM`. At or before `open` means the window runs through midnight. */
253
+ close: string;
254
+ }
255
+ /** A week of operating hours. A day that is absent or null is closed. */
256
+ interface OperatingHours {
257
+ sun?: DayWindow | null;
258
+ mon?: DayWindow | null;
259
+ tue?: DayWindow | null;
260
+ wed?: DayWindow | null;
261
+ thu?: DayWindow | null;
262
+ fri?: DayWindow | null;
263
+ sat?: DayWindow | null;
264
+ }
230
265
  /**
231
266
  * One page of Exchange Zones, and the cursor to continue.
232
267
  *
@@ -1478,4 +1513,4 @@ declare class RelaiTransportError extends RelaiError {
1478
1513
  constructor(message: string);
1479
1514
  }
1480
1515
 
1481
- export { type AccessLinkTarget, AccessLinksModule, type AnyWebhookEvent, type ApiEnvironment, type ApiErrorBody, AppModule, type AppSelf, AuthModule, type BleDeviceLike, type BleManagerLike, BleTransport, type BleTransportOptions, type CommandAck, type DeliverOptions, type DiscoveredParent, type EndUser, type EndUserPage, EndUsersModule, type ExchangeZone, type ExchangeZoneDetail, type ExchangeZonePage, ExchangeZonesModule, type GrantAlgorithm, GrantsModule, type HandoffMode, type Intent, Intents, type KeyValueStorage, type Me, MemoryTelemetryQueue, MemoryTokenStorage, type MintedCommand, type NotifyLine, type Open, type Order, type OrderPage, type OrderStatusFields, OrdersModule, type OverrideLink, OverrideLinksModule, type ParentTransport, type PaymentRequiredDetails, PushModule, type PushPlatform, type QueuedTelemetry, REJECT_REASONS, RELAI_RX_CHAR, RELAI_TX_CHAR, RELAI_UART_SERVICE, type RecipientMatch, RecipientsModule, RelaiApiError, RelaiClient, type RelaiClientOptions, RelaiConfigError, RelaiError, type RelaiErrorContext, RelaiLateFeeDue, RelaiMissingKeyError, RelaiNetworkError, RelaiTransportError, RelaiUnlockRejected, type SandboxFault, type SandboxFaultResult, SandboxModule, type SelfBillingChoice, type Session, SimAuthenticatedTransport, type SimAuthenticatedTransportOptions, type SimulatedParentConfig, SimulatedTransport, StorageTelemetryQueue, type StorageTelemetryQueueOptions, type StripeSdk, type TelemetryAction, type TelemetryEvent, TelemetryModule, type TelemetryPayload, type TelemetryQueue, TelemetryUploader, type TokenPair, type TokenStorage, type Tower, type TowerNode, type TowerTelemetry, type UnlockDeps, type UnlockGrant, type UnlockInput, type UnlockResult, type VerifyWebhookInput, type WebhookEvent, type WebhookEventOf, type WebhookEventType, type WebhookPayloads, asPaymentRequired, deliverOpen, isStripePublishableKey, parseNotifyLine, presentRelaiPaymentSheet, verifyWebhook };
1516
+ export { type AccessLinkTarget, AccessLinksModule, type AnyWebhookEvent, type ApiEnvironment, type ApiErrorBody, AppModule, type AppSelf, AuthModule, type BleDeviceLike, type BleManagerLike, BleTransport, type BleTransportOptions, type CommandAck, type DayWindow, type DeliverOptions, type DiscoveredParent, type EndUser, type EndUserPage, EndUsersModule, type ExchangeZone, type ExchangeZoneDetail, type ExchangeZonePage, ExchangeZonesModule, type GrantAlgorithm, GrantsModule, type HandoffMode, type Intent, Intents, type KeyValueStorage, type Me, MemoryTelemetryQueue, MemoryTokenStorage, type MintedCommand, type NotifyLine, type Open, type OperatingHours, type Order, type OrderPage, type OrderStatusFields, OrdersModule, type OverrideLink, OverrideLinksModule, type ParentTransport, type PaymentRequiredDetails, PushModule, type PushPlatform, type QueuedTelemetry, REJECT_REASONS, RELAI_RX_CHAR, RELAI_TX_CHAR, RELAI_UART_SERVICE, type RecipientMatch, RecipientsModule, RelaiApiError, RelaiClient, type RelaiClientOptions, RelaiConfigError, RelaiError, type RelaiErrorContext, RelaiLateFeeDue, RelaiMissingKeyError, RelaiNetworkError, RelaiTransportError, RelaiUnlockRejected, type SandboxFault, type SandboxFaultResult, SandboxModule, type SelfBillingChoice, type Session, SimAuthenticatedTransport, type SimAuthenticatedTransportOptions, type SimulatedParentConfig, SimulatedTransport, StorageTelemetryQueue, type StorageTelemetryQueueOptions, type StripeSdk, type TelemetryAction, type TelemetryEvent, TelemetryModule, type TelemetryPayload, type TelemetryQueue, TelemetryUploader, type TokenPair, type TokenStorage, type Tower, type TowerNode, type TowerTelemetry, type UnlockDeps, type UnlockGrant, type UnlockInput, type UnlockResult, type VerifyWebhookInput, type WebhookEvent, type WebhookEventOf, type WebhookEventType, type WebhookPayloads, asPaymentRequired, deliverOpen, isStripePublishableKey, parseNotifyLine, presentRelaiPaymentSheet, verifyWebhook };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relai-team/access-sdk",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Official Relai Access SDK, open Relai Exchange Zone nodes over BLE, backed by the Relai Access platform (server-owns-trust).",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",