@gethydra/sdk 0.1.17 → 0.1.19

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.ts CHANGED
@@ -79,6 +79,19 @@ interface components {
79
79
  * ]
80
80
  */
81
81
  enabled_extensions: string[];
82
+ /** @description Booking configuration for the store */
83
+ booking_config: {
84
+ /** @example 60 */
85
+ lookahead_days: number;
86
+ /** @example 1 */
87
+ min_advance_hours: number;
88
+ /** @example 1000 */
89
+ deposit_amount: number;
90
+ /** @example 1 */
91
+ max_active_bookings: number;
92
+ /** @example true */
93
+ confirmation_email: boolean;
94
+ } | null;
82
95
  pricing_config: {
83
96
  /** @example 2 */
84
97
  next_key_index: number;
@@ -3302,6 +3315,21 @@ interface components {
3302
3315
  /** @example Visit our Birmingham retail location. */
3303
3316
  description?: string;
3304
3317
  };
3318
+ /** @example false */
3319
+ booking_enabled: boolean;
3320
+ /** @example 1 */
3321
+ room_count: number;
3322
+ /** @example 30 */
3323
+ slot_duration_minutes: number;
3324
+ /** @example 0 */
3325
+ buffer_minutes: number;
3326
+ /** @example {} */
3327
+ opening_hours: {
3328
+ [key: string]: {
3329
+ open: string;
3330
+ close: string;
3331
+ } | null;
3332
+ };
3305
3333
  /**
3306
3334
  * @description Number of variants with inventory at this location
3307
3335
  * @example 12
@@ -3355,6 +3383,112 @@ interface components {
3355
3383
  valid: boolean;
3356
3384
  staff?: components["schemas"]["PosStaff"];
3357
3385
  };
3386
+ DayAvailability: {
3387
+ /** @example 2026-11-20 */
3388
+ date: string;
3389
+ /** @example wednesday */
3390
+ day_of_week: string;
3391
+ slots: components["schemas"]["Slot"][];
3392
+ };
3393
+ Slot: {
3394
+ /** @example 10:00 */
3395
+ start_time: string;
3396
+ /** @example 10:30 */
3397
+ end_time: string;
3398
+ /** @example 2 */
3399
+ available: number;
3400
+ };
3401
+ SuggestedSlot: {
3402
+ /** @example 2026-11-20 */
3403
+ date: string;
3404
+ /** @example wednesday */
3405
+ day_of_week: string;
3406
+ /** @example 10:00 */
3407
+ start_time: string;
3408
+ /** @example 10:30 */
3409
+ end_time: string;
3410
+ };
3411
+ Appointment: {
3412
+ /** @example appt_abc123def456ghi789 */
3413
+ id: string;
3414
+ /** @example loc_abc123def456ghi789 */
3415
+ location_id: string;
3416
+ /** @example null */
3417
+ customer_id: string | null;
3418
+ /** @example Sophie Turner */
3419
+ customer_name: string;
3420
+ /** @example sophie@example.com */
3421
+ customer_email: string;
3422
+ /** @example +447123456789 */
3423
+ customer_phone: string | null;
3424
+ /** @example 2026-11-20 */
3425
+ scheduled_date: string;
3426
+ /** @example 10:00 */
3427
+ start_time: string;
3428
+ /** @example 10:30 */
3429
+ end_time: string;
3430
+ /**
3431
+ * @example confirmed
3432
+ * @enum {string}
3433
+ */
3434
+ status: "pending" | "confirmed" | "cancelled" | "completed" | "no_show";
3435
+ /**
3436
+ * @example online
3437
+ * @enum {string}
3438
+ */
3439
+ source: "online" | "walk_in" | "phone";
3440
+ /** @example 1000 */
3441
+ deposit_amount: number | null;
3442
+ /** @example null */
3443
+ stripe_payment_intent_id: string | null;
3444
+ /** @example null */
3445
+ notes: string | null;
3446
+ /** @example null */
3447
+ metadata: {
3448
+ [key: string]: unknown;
3449
+ } | null;
3450
+ /**
3451
+ * Format: date-time
3452
+ * @example null
3453
+ */
3454
+ cancelled_at: string | null;
3455
+ /**
3456
+ * Format: date-time
3457
+ * @example 2026-11-12T10:00:00.000Z
3458
+ */
3459
+ created_at: string;
3460
+ /**
3461
+ * Format: date-time
3462
+ * @example 2026-11-12T10:00:00.000Z
3463
+ */
3464
+ updated_at: string;
3465
+ };
3466
+ AvailabilityOverride: {
3467
+ /** @example avo_abc123def456ghi789 */
3468
+ id: string;
3469
+ /** @example loc_abc123def456ghi789 */
3470
+ location_id: string;
3471
+ /** @example 2026-12-25 */
3472
+ date: string;
3473
+ /** @example true */
3474
+ is_closed: boolean;
3475
+ /** @example null */
3476
+ open_time: string | null;
3477
+ /** @example null */
3478
+ close_time: string | null;
3479
+ /** @example Christmas Day */
3480
+ reason: string | null;
3481
+ /**
3482
+ * Format: date-time
3483
+ * @example 2026-11-12T10:00:00.000Z
3484
+ */
3485
+ created_at: string;
3486
+ /**
3487
+ * Format: date-time
3488
+ * @example 2026-11-12T10:00:00.000Z
3489
+ */
3490
+ updated_at: string;
3491
+ };
3358
3492
  Post: {
3359
3493
  /** @example post_abc123 */
3360
3494
  id: string;
@@ -4176,6 +4310,19 @@ interface operations {
4176
4310
  * @example orders
4177
4311
  */
4178
4312
  notification_from_email?: string | null;
4313
+ /** @description Partial update — only provided fields are changed, others are preserved. */
4314
+ booking_config?: {
4315
+ /** @example 60 */
4316
+ lookahead_days?: number;
4317
+ /** @example 1 */
4318
+ min_advance_hours?: number;
4319
+ /** @example 1000 */
4320
+ deposit_amount?: number;
4321
+ /** @example 1 */
4322
+ max_active_bookings?: number;
4323
+ /** @example true */
4324
+ confirmation_email?: boolean;
4325
+ };
4179
4326
  };
4180
4327
  };
4181
4328
  };
@@ -11258,6 +11405,8 @@ interface operations {
11258
11405
  created_before?: string;
11259
11406
  /** @description Filter orders by channel */
11260
11407
  channel_id?: string;
11408
+ /** @description Filter orders by location */
11409
+ location_id?: string;
11261
11410
  expand?: string;
11262
11411
  };
11263
11412
  header?: never;
@@ -11361,6 +11510,11 @@ interface operations {
11361
11510
  payment_method?: "card" | "cash" | "loyalty_points" | "store_credit" | "gift_card";
11362
11511
  /** @example Gift wrap requested. */
11363
11512
  notes?: string;
11513
+ /**
11514
+ * @description Location that placed this order (e.g. POS branch).
11515
+ * @example loc_abc123
11516
+ */
11517
+ location_id?: string;
11364
11518
  /** @default {} */
11365
11519
  metadata?: {
11366
11520
  [key: string]: string | number;
@@ -12836,7 +12990,7 @@ interface operations {
12836
12990
  * "order.paid"
12837
12991
  * ]
12838
12992
  */
12839
- events: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "channel.created" | "channel.updated" | "channel.archived" | "collection.created" | "collection.updated" | "collection.deleted" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "customer_photo.submitted" | "customer_photo.approved" | "customer_photo.rejected" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning")[];
12993
+ events: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "channel.created" | "channel.updated" | "channel.archived" | "collection.created" | "collection.updated" | "collection.deleted" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "customer_photo.submitted" | "customer_photo.approved" | "customer_photo.rejected" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning" | "booking.created" | "booking.confirmed" | "booking.cancelled" | "booking.completed")[];
12840
12994
  /**
12841
12995
  * @default active
12842
12996
  * @example active
@@ -12930,7 +13084,7 @@ interface operations {
12930
13084
  * "product.updated"
12931
13085
  * ]
12932
13086
  */
12933
- events?: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "channel.created" | "channel.updated" | "channel.archived" | "collection.created" | "collection.updated" | "collection.deleted" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "customer_photo.submitted" | "customer_photo.approved" | "customer_photo.rejected" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning")[];
13087
+ events?: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "channel.created" | "channel.updated" | "channel.archived" | "collection.created" | "collection.updated" | "collection.deleted" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "customer_photo.submitted" | "customer_photo.approved" | "customer_photo.rejected" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning" | "booking.created" | "booking.confirmed" | "booking.cancelled" | "booking.completed")[];
12934
13088
  /**
12935
13089
  * @example active
12936
13090
  * @enum {string}
@@ -15633,6 +15787,33 @@ interface operations {
15633
15787
  metadata?: {
15634
15788
  [key: string]: string | number;
15635
15789
  };
15790
+ /** @example true */
15791
+ booking_enabled?: boolean;
15792
+ /** @example 2 */
15793
+ room_count?: number;
15794
+ /** @example 30 */
15795
+ slot_duration_minutes?: number;
15796
+ /** @example 10 */
15797
+ buffer_minutes?: number;
15798
+ /**
15799
+ * @example {
15800
+ * "monday": {
15801
+ * "open": "10:00",
15802
+ * "close": "18:00"
15803
+ * },
15804
+ * "tuesday": {
15805
+ * "open": "10:00",
15806
+ * "close": "18:00"
15807
+ * },
15808
+ * "sunday": null
15809
+ * }
15810
+ */
15811
+ opening_hours?: {
15812
+ [key: string]: {
15813
+ open: string;
15814
+ close: string;
15815
+ } | null;
15816
+ };
15636
15817
  };
15637
15818
  };
15638
15819
  };
@@ -16127,6 +16308,334 @@ interface operations {
16127
16308
  };
16128
16309
  };
16129
16310
  };
16311
+ listBookableLocations: {
16312
+ parameters: {
16313
+ query?: never;
16314
+ header?: never;
16315
+ path?: never;
16316
+ cookie?: never;
16317
+ };
16318
+ requestBody?: never;
16319
+ responses: {
16320
+ /** @description Bookable locations */
16321
+ 200: {
16322
+ headers: {
16323
+ [name: string]: unknown;
16324
+ };
16325
+ content: {
16326
+ "application/json": {
16327
+ data: {
16328
+ id: string;
16329
+ name: string;
16330
+ address_line1: string | null;
16331
+ city: string | null;
16332
+ postal_code: string | null;
16333
+ phone: string | null;
16334
+ slot_duration_minutes: number;
16335
+ opening_hours: {
16336
+ [key: string]: {
16337
+ open: string;
16338
+ close: string;
16339
+ } | null;
16340
+ };
16341
+ }[];
16342
+ };
16343
+ };
16344
+ };
16345
+ };
16346
+ };
16347
+ getBookingAvailability: {
16348
+ parameters: {
16349
+ query: {
16350
+ location_id: string;
16351
+ date?: string;
16352
+ suggest?: number;
16353
+ };
16354
+ header?: never;
16355
+ path?: never;
16356
+ cookie?: never;
16357
+ };
16358
+ requestBody?: never;
16359
+ responses: {
16360
+ /** @description Available time slots */
16361
+ 200: {
16362
+ headers: {
16363
+ [name: string]: unknown;
16364
+ };
16365
+ content: {
16366
+ "application/json": {
16367
+ data: components["schemas"]["DayAvailability"][] | components["schemas"]["SuggestedSlot"][];
16368
+ };
16369
+ };
16370
+ };
16371
+ };
16372
+ };
16373
+ listAppointments: {
16374
+ parameters: {
16375
+ query?: {
16376
+ limit?: number;
16377
+ cursor?: string;
16378
+ fields?: string;
16379
+ sort?: "created_at" | "scheduled_date";
16380
+ order?: "asc" | "desc";
16381
+ location_id?: string;
16382
+ date_from?: string;
16383
+ date_to?: string;
16384
+ status?: "pending" | "confirmed" | "cancelled" | "completed" | "no_show";
16385
+ customer_email?: string;
16386
+ };
16387
+ header?: never;
16388
+ path?: never;
16389
+ cookie?: never;
16390
+ };
16391
+ requestBody?: never;
16392
+ responses: {
16393
+ /** @description Paginated appointment list */
16394
+ 200: {
16395
+ headers: {
16396
+ [name: string]: unknown;
16397
+ };
16398
+ content: {
16399
+ "application/json": {
16400
+ data: components["schemas"]["Appointment"][];
16401
+ pagination: {
16402
+ cursor: string | null;
16403
+ has_more: boolean;
16404
+ total: number;
16405
+ };
16406
+ };
16407
+ };
16408
+ };
16409
+ };
16410
+ };
16411
+ createAppointment: {
16412
+ parameters: {
16413
+ query?: never;
16414
+ header?: never;
16415
+ path?: never;
16416
+ cookie?: never;
16417
+ };
16418
+ requestBody?: {
16419
+ content: {
16420
+ "application/json": {
16421
+ /** @example loc_abc123def456ghi789 */
16422
+ location_id: string;
16423
+ /** @example Sophie Turner */
16424
+ customer_name: string;
16425
+ /**
16426
+ * Format: email
16427
+ * @example sophie@example.com
16428
+ */
16429
+ customer_email: string;
16430
+ /** @example +447123456789 */
16431
+ customer_phone?: string;
16432
+ /** @example 2026-11-20 */
16433
+ scheduled_date: string;
16434
+ /** @example 10:00 */
16435
+ start_time: string;
16436
+ /** @example First piercing appointment */
16437
+ notes?: string;
16438
+ /** @default {} */
16439
+ metadata?: {
16440
+ [key: string]: string | number;
16441
+ };
16442
+ };
16443
+ };
16444
+ };
16445
+ responses: {
16446
+ /** @description Appointment created with Stripe client_secret */
16447
+ 201: {
16448
+ headers: {
16449
+ [name: string]: unknown;
16450
+ };
16451
+ content: {
16452
+ "application/json": {
16453
+ data: components["schemas"]["Appointment"];
16454
+ client_secret: string;
16455
+ };
16456
+ };
16457
+ };
16458
+ };
16459
+ };
16460
+ confirmAppointment: {
16461
+ parameters: {
16462
+ query?: never;
16463
+ header?: never;
16464
+ path: {
16465
+ id: string;
16466
+ };
16467
+ cookie?: never;
16468
+ };
16469
+ requestBody?: never;
16470
+ responses: {
16471
+ /** @description Appointment confirmed */
16472
+ 200: {
16473
+ headers: {
16474
+ [name: string]: unknown;
16475
+ };
16476
+ content: {
16477
+ "application/json": {
16478
+ data: components["schemas"]["Appointment"];
16479
+ };
16480
+ };
16481
+ };
16482
+ };
16483
+ };
16484
+ getAppointment: {
16485
+ parameters: {
16486
+ query?: never;
16487
+ header?: never;
16488
+ path: {
16489
+ id: string;
16490
+ };
16491
+ cookie?: never;
16492
+ };
16493
+ requestBody?: never;
16494
+ responses: {
16495
+ /** @description Appointment details */
16496
+ 200: {
16497
+ headers: {
16498
+ [name: string]: unknown;
16499
+ };
16500
+ content: {
16501
+ "application/json": {
16502
+ data: components["schemas"]["Appointment"];
16503
+ };
16504
+ };
16505
+ };
16506
+ };
16507
+ };
16508
+ updateAppointment: {
16509
+ parameters: {
16510
+ query?: never;
16511
+ header?: never;
16512
+ path: {
16513
+ id: string;
16514
+ };
16515
+ cookie?: never;
16516
+ };
16517
+ requestBody?: {
16518
+ content: {
16519
+ "application/json": {
16520
+ /** @enum {string} */
16521
+ status?: "confirmed" | "cancelled" | "completed" | "no_show";
16522
+ notes?: string;
16523
+ metadata?: {
16524
+ [key: string]: string | number;
16525
+ };
16526
+ };
16527
+ };
16528
+ };
16529
+ responses: {
16530
+ /** @description Appointment updated */
16531
+ 200: {
16532
+ headers: {
16533
+ [name: string]: unknown;
16534
+ };
16535
+ content: {
16536
+ "application/json": {
16537
+ data: components["schemas"]["Appointment"];
16538
+ };
16539
+ };
16540
+ };
16541
+ };
16542
+ };
16543
+ listAvailabilityOverrides: {
16544
+ parameters: {
16545
+ query: {
16546
+ limit?: number;
16547
+ cursor?: string;
16548
+ fields?: string;
16549
+ location_id: string;
16550
+ date_from?: string;
16551
+ date_to?: string;
16552
+ };
16553
+ header?: never;
16554
+ path?: never;
16555
+ cookie?: never;
16556
+ };
16557
+ requestBody?: never;
16558
+ responses: {
16559
+ /** @description Override list */
16560
+ 200: {
16561
+ headers: {
16562
+ [name: string]: unknown;
16563
+ };
16564
+ content: {
16565
+ "application/json": {
16566
+ data: components["schemas"]["AvailabilityOverride"][];
16567
+ pagination: {
16568
+ cursor: string | null;
16569
+ has_more: boolean;
16570
+ total: number;
16571
+ };
16572
+ };
16573
+ };
16574
+ };
16575
+ };
16576
+ };
16577
+ createAvailabilityOverride: {
16578
+ parameters: {
16579
+ query?: never;
16580
+ header?: never;
16581
+ path?: never;
16582
+ cookie?: never;
16583
+ };
16584
+ requestBody?: {
16585
+ content: {
16586
+ "application/json": {
16587
+ /** @example loc_abc123def456ghi789 */
16588
+ location_id: string;
16589
+ /** @example 2026-12-25 */
16590
+ date: string;
16591
+ /**
16592
+ * @default false
16593
+ * @example true
16594
+ */
16595
+ is_closed?: boolean;
16596
+ /** @example 10:00 */
16597
+ open_time?: string;
16598
+ /** @example 14:00 */
16599
+ close_time?: string;
16600
+ /** @example Christmas Day */
16601
+ reason?: string;
16602
+ };
16603
+ };
16604
+ };
16605
+ responses: {
16606
+ /** @description Override created */
16607
+ 201: {
16608
+ headers: {
16609
+ [name: string]: unknown;
16610
+ };
16611
+ content: {
16612
+ "application/json": {
16613
+ data: components["schemas"]["AvailabilityOverride"];
16614
+ };
16615
+ };
16616
+ };
16617
+ };
16618
+ };
16619
+ deleteAvailabilityOverride: {
16620
+ parameters: {
16621
+ query?: never;
16622
+ header?: never;
16623
+ path: {
16624
+ id: string;
16625
+ };
16626
+ cookie?: never;
16627
+ };
16628
+ requestBody?: never;
16629
+ responses: {
16630
+ /** @description Override deleted */
16631
+ 204: {
16632
+ headers: {
16633
+ [name: string]: unknown;
16634
+ };
16635
+ content?: never;
16636
+ };
16637
+ };
16638
+ };
16130
16639
  listPosts: {
16131
16640
  parameters: {
16132
16641
  query?: {
@@ -17080,7 +17589,7 @@ interface operations {
17080
17589
  sort?: "created_at" | "updated_at" | "title" | "relevance";
17081
17590
  order?: "asc" | "desc";
17082
17591
  /** @description Filter by notification type */
17083
- type?: "email_verification" | "welcome" | "password_reset" | "password_changed" | "order_confirmation" | "order_cancelled" | "refund_issued" | "draft_order_payment_request" | "shipping_confirmation" | "delivery_confirmation" | "cart_recovery" | "new_order" | "low_stock" | "domain_warning" | "domain_revoked" | "domain_recovered";
17592
+ type?: "email_verification" | "welcome" | "password_reset" | "password_changed" | "order_confirmation" | "order_cancelled" | "refund_issued" | "draft_order_payment_request" | "shipping_confirmation" | "delivery_confirmation" | "cart_recovery" | "booking_confirmation" | "new_order" | "low_stock" | "domain_warning" | "domain_revoked" | "domain_recovered";
17084
17593
  /** @description Filter by delivery status */
17085
17594
  status?: "sent" | "failed" | "skipped";
17086
17595
  /** @description Filter by recipient email */
@@ -17153,7 +17662,7 @@ interface operations {
17153
17662
  * @example new_order
17154
17663
  * @enum {string}
17155
17664
  */
17156
- type: "email_verification" | "welcome" | "password_reset" | "password_changed" | "order_confirmation" | "order_cancelled" | "refund_issued" | "draft_order_payment_request" | "shipping_confirmation" | "delivery_confirmation" | "cart_recovery" | "new_order" | "low_stock" | "domain_warning" | "domain_revoked" | "domain_recovered";
17665
+ type: "email_verification" | "welcome" | "password_reset" | "password_changed" | "order_confirmation" | "order_cancelled" | "refund_issued" | "draft_order_payment_request" | "shipping_confirmation" | "delivery_confirmation" | "cart_recovery" | "booking_confirmation" | "new_order" | "low_stock" | "domain_warning" | "domain_revoked" | "domain_recovered";
17157
17666
  /**
17158
17667
  * Format: email
17159
17668
  * @description Email address to send the test to
@@ -18436,6 +18945,11 @@ type Post$1 = components['schemas']['Post'];
18436
18945
  type ContentCategory$1 = components['schemas']['ContentCategory'];
18437
18946
  type MembershipPlan$1 = components['schemas']['MembershipPlan'];
18438
18947
  type CustomerMembership$1 = components['schemas']['CustomerMembership'];
18948
+ type Appointment$1 = components['schemas']['Appointment'];
18949
+ type AvailabilityOverride$1 = components['schemas']['AvailabilityOverride'];
18950
+ type Slot = components['schemas']['Slot'];
18951
+ type DayAvailability$1 = components['schemas']['DayAvailability'];
18952
+ type SuggestedSlot$1 = components['schemas']['SuggestedSlot'];
18439
18953
  interface Pagination {
18440
18954
  cursor: string | null;
18441
18955
  has_more: boolean;
@@ -19521,6 +20035,51 @@ declare class MembershipPlansResource {
19521
20035
  listSubscriptions(params?: SubscriptionListParams): Promise<ListResponse<CustomerMembership>>;
19522
20036
  }
19523
20037
 
20038
+ type Appointment = components['schemas']['Appointment'];
20039
+ type AvailabilityOverride = components['schemas']['AvailabilityOverride'];
20040
+ type DayAvailability = components['schemas']['DayAvailability'];
20041
+ type SuggestedSlot = components['schemas']['SuggestedSlot'];
20042
+ type ListAppointmentsParams = NonNullable<operations['listAppointments']['parameters']['query']>;
20043
+ type CreateAppointmentBody = NonNullable<operations['createAppointment']['requestBody']>['content']['application/json'];
20044
+ type UpdateAppointmentBody = NonNullable<operations['updateAppointment']['requestBody']>['content']['application/json'];
20045
+ type AvailabilityParams = NonNullable<operations['getBookingAvailability']['parameters']['query']>;
20046
+ type CreateOverrideBody = NonNullable<operations['createAvailabilityOverride']['requestBody']>['content']['application/json'];
20047
+ type ListOverridesParams = NonNullable<operations['listAvailabilityOverrides']['parameters']['query']>;
20048
+ declare class BookingsResource {
20049
+ private client;
20050
+ constructor(client: Hydra);
20051
+ listLocations(): Promise<DataResponse<{
20052
+ id: string;
20053
+ name: string;
20054
+ address_line1: string | null;
20055
+ city: string | null;
20056
+ postal_code: string | null;
20057
+ phone: string | null;
20058
+ slot_duration_minutes: number;
20059
+ opening_hours: Record<string, {
20060
+ open: string;
20061
+ close: string;
20062
+ } | null>;
20063
+ }[]>>;
20064
+ getAvailability(params: AvailabilityParams): Promise<{
20065
+ data: DayAvailability[] | SuggestedSlot[];
20066
+ }>;
20067
+ createAppointment(body: CreateAppointmentBody, options?: ResourceRequestOptions): Promise<DataResponse<Appointment> & {
20068
+ client_secret: string;
20069
+ }>;
20070
+ confirmAppointment(id: string): Promise<DataResponse<Appointment>>;
20071
+ listAppointments(params?: ListAppointmentsParams): Promise<ListResponse<Appointment>>;
20072
+ iterateAppointments(params?: Omit<ListAppointmentsParams, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Appointment, void, undefined>;
20073
+ toArrayAppointments(params?: Omit<ListAppointmentsParams, 'cursor'>, options?: PaginateOptions & {
20074
+ limit?: number;
20075
+ }): Promise<Appointment[]>;
20076
+ getAppointment(id: string): Promise<DataResponse<Appointment>>;
20077
+ updateAppointment(id: string, body: UpdateAppointmentBody): Promise<DataResponse<Appointment>>;
20078
+ createOverride(body: CreateOverrideBody, options?: ResourceRequestOptions): Promise<DataResponse<AvailabilityOverride>>;
20079
+ listOverrides(params: ListOverridesParams): Promise<ListResponse<AvailabilityOverride>>;
20080
+ deleteOverride(id: string): Promise<void>;
20081
+ }
20082
+
19524
20083
  interface AppInfo {
19525
20084
  /** Integration/plugin name (e.g. "MyShopTheme") */
19526
20085
  name: string;
@@ -19602,6 +20161,7 @@ declare class Hydra {
19602
20161
  readonly posts: PostsResource;
19603
20162
  readonly contentCategories: ContentCategoriesResource;
19604
20163
  readonly membershipPlans: MembershipPlansResource;
20164
+ readonly bookings: BookingsResource;
19605
20165
  constructor(config: HydraConfig);
19606
20166
  request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
19607
20167
  /** Multipart upload for file-based endpoints (e.g. images) */
@@ -19683,4 +20243,4 @@ declare class HydraIdempotencyError extends HydraError {
19683
20243
  constructor(body: HydraErrorBody, headers: Headers);
19684
20244
  }
19685
20245
 
19686
- export { AddressesResource, type AnalyticsActionItems$1 as AnalyticsActionItems, type AnalyticsOrdersSeries$1 as AnalyticsOrdersSeries, AnalyticsResource, type AnalyticsSummary$1 as AnalyticsSummary, type AnalyticsTimeSeries$1 as AnalyticsTimeSeries, type AnalyticsTopProduct$1 as AnalyticsTopProduct, type AppInfo, type Cart$1 as Cart, type CartItem, CartResource, type Channel$1 as Channel, ChannelsResource, type CheckoutCreate$1 as CheckoutCreate, type CheckoutGet$1 as CheckoutGet, type CheckoutListItem$1 as CheckoutListItem, CheckoutResource, CheckoutsResource, type Collection$1 as Collection, CollectionsResource, CompaniesResource, type Company$1 as Company, ContentCategoriesResource, type ContentCategory$1 as ContentCategory, type Customer$1 as Customer, type CustomerGroup$1 as CustomerGroup, CustomerGroupsResource, type CustomerMembership$1 as CustomerMembership, type CustomerPhoto$1 as CustomerPhoto, CustomerPhotosResource, CustomersResource, type DataResponse, type Discount$1 as Discount, DiscountsResource, type DraftOrder$1 as DraftOrder, DraftOrdersResource, type ExchangeRate$1 as ExchangeRate, ExchangeRatesResource, type Fulfillment$1 as Fulfillment, type FulfillmentOrder$2 as FulfillmentOrder, FulfillmentOrdersResource, FulfillmentsResource, type GenerateVariantsResult$1 as GenerateVariantsResult, Hydra, HydraAuthenticationError, type HydraConfig, HydraConnectionError, HydraError, type HydraErrorBody, HydraIdempotencyError, HydraNotFoundError, HydraPermissionError, HydraRateLimitError, HydraValidationError, type Image$2 as Image, ImagesResource, IntegrationsResource, type InventoryLevel$1 as InventoryLevel, InventoryResource, type ListResponse, type Location$1 as Location, LocationsResource, type MembershipPlan$1 as MembershipPlan, MembershipPlansResource, MetafieldsResource, type NotificationLog$1 as NotificationLog, NotificationsResource, type Order$2 as Order, OrdersResource, type PaginateOptions, type Pagination, type Post$1 as Post, PostsResource, type Product$1 as Product, type ProductStats$1 as ProductStats, ProductsResource, type Promotion$1 as Promotion, PromotionsResource, type PurchaseOrder$1 as PurchaseOrder, PurchaseOrdersResource, type Redirect$1 as Redirect, RedirectsResource, type Refund$1 as Refund, RefundsResource, type RequestOptions, type ResourceRequestOptions, type Return$1 as Return, ReturnsResource, SearchResource, type ShippingRate$1 as ShippingRate, ShippingResource, type ShippingZone$1 as ShippingZone, type Store$1 as Store, StoreCreditResource, StoreResource, type Tag$1 as Tag, TagsResource, type TaxExemption$1 as TaxExemption, type TaxGroup$1 as TaxGroup, type TaxRate$1 as TaxRate, TaxResource, type Variant$2 as Variant, type VariantPrice$1 as VariantPrice, VariantsResource, type Webhook$1 as Webhook, WebhooksResource, paginate, toArray };
20246
+ export { AddressesResource, type AnalyticsActionItems$1 as AnalyticsActionItems, type AnalyticsOrdersSeries$1 as AnalyticsOrdersSeries, AnalyticsResource, type AnalyticsSummary$1 as AnalyticsSummary, type AnalyticsTimeSeries$1 as AnalyticsTimeSeries, type AnalyticsTopProduct$1 as AnalyticsTopProduct, type AppInfo, type Appointment$1 as Appointment, type AvailabilityOverride$1 as AvailabilityOverride, BookingsResource, type Cart$1 as Cart, type CartItem, CartResource, type Channel$1 as Channel, ChannelsResource, type CheckoutCreate$1 as CheckoutCreate, type CheckoutGet$1 as CheckoutGet, type CheckoutListItem$1 as CheckoutListItem, CheckoutResource, CheckoutsResource, type Collection$1 as Collection, CollectionsResource, CompaniesResource, type Company$1 as Company, ContentCategoriesResource, type ContentCategory$1 as ContentCategory, type Customer$1 as Customer, type CustomerGroup$1 as CustomerGroup, CustomerGroupsResource, type CustomerMembership$1 as CustomerMembership, type CustomerPhoto$1 as CustomerPhoto, CustomerPhotosResource, CustomersResource, type DataResponse, type DayAvailability$1 as DayAvailability, type Discount$1 as Discount, DiscountsResource, type DraftOrder$1 as DraftOrder, DraftOrdersResource, type ExchangeRate$1 as ExchangeRate, ExchangeRatesResource, type Fulfillment$1 as Fulfillment, type FulfillmentOrder$2 as FulfillmentOrder, FulfillmentOrdersResource, FulfillmentsResource, type GenerateVariantsResult$1 as GenerateVariantsResult, Hydra, HydraAuthenticationError, type HydraConfig, HydraConnectionError, HydraError, type HydraErrorBody, HydraIdempotencyError, HydraNotFoundError, HydraPermissionError, HydraRateLimitError, HydraValidationError, type Image$2 as Image, ImagesResource, IntegrationsResource, type InventoryLevel$1 as InventoryLevel, InventoryResource, type ListResponse, type Location$1 as Location, LocationsResource, type MembershipPlan$1 as MembershipPlan, MembershipPlansResource, MetafieldsResource, type NotificationLog$1 as NotificationLog, NotificationsResource, type Order$2 as Order, OrdersResource, type PaginateOptions, type Pagination, type Post$1 as Post, PostsResource, type Product$1 as Product, type ProductStats$1 as ProductStats, ProductsResource, type Promotion$1 as Promotion, PromotionsResource, type PurchaseOrder$1 as PurchaseOrder, PurchaseOrdersResource, type Redirect$1 as Redirect, RedirectsResource, type Refund$1 as Refund, RefundsResource, type RequestOptions, type ResourceRequestOptions, type Return$1 as Return, ReturnsResource, SearchResource, type ShippingRate$1 as ShippingRate, ShippingResource, type ShippingZone$1 as ShippingZone, type Slot, type Store$1 as Store, StoreCreditResource, StoreResource, type SuggestedSlot$1 as SuggestedSlot, type Tag$1 as Tag, TagsResource, type TaxExemption$1 as TaxExemption, type TaxGroup$1 as TaxGroup, type TaxRate$1 as TaxRate, TaxResource, type Variant$2 as Variant, type VariantPrice$1 as VariantPrice, VariantsResource, type Webhook$1 as Webhook, WebhooksResource, paginate, toArray };
package/dist/index.js CHANGED
@@ -1646,6 +1646,65 @@ var MembershipPlansResource = class {
1646
1646
  }
1647
1647
  };
1648
1648
 
1649
+ // src/resources/bookings.ts
1650
+ var BookingsResource = class {
1651
+ constructor(client) {
1652
+ this.client = client;
1653
+ }
1654
+ client;
1655
+ // ── Bookable locations ──
1656
+ async listLocations() {
1657
+ return this.client.request("GET", "/v1/bookings/locations");
1658
+ }
1659
+ // ── Availability ──
1660
+ async getAvailability(params) {
1661
+ return this.client.request("GET", "/v1/bookings/availability", { params });
1662
+ }
1663
+ // ── Appointments ──
1664
+ async createAppointment(body, options) {
1665
+ return this.client.request("POST", "/v1/bookings/appointments", {
1666
+ body,
1667
+ ...options
1668
+ });
1669
+ }
1670
+ async confirmAppointment(id) {
1671
+ return this.client.request("POST", `/v1/bookings/appointments/${id}/confirm`);
1672
+ }
1673
+ async listAppointments(params) {
1674
+ return this.client.request("GET", "/v1/bookings/appointments", { params });
1675
+ }
1676
+ iterateAppointments(params, options) {
1677
+ return paginate(
1678
+ (cursor) => this.listAppointments({ ...params, cursor }),
1679
+ options
1680
+ );
1681
+ }
1682
+ async toArrayAppointments(params, options) {
1683
+ return toArray(this.iterateAppointments(params, options), options);
1684
+ }
1685
+ async getAppointment(id) {
1686
+ return this.client.request("GET", `/v1/bookings/appointments/${id}`);
1687
+ }
1688
+ async updateAppointment(id, body) {
1689
+ return this.client.request("PATCH", `/v1/bookings/appointments/${id}`, {
1690
+ body
1691
+ });
1692
+ }
1693
+ // ── Availability overrides ──
1694
+ async createOverride(body, options) {
1695
+ return this.client.request("POST", "/v1/bookings/overrides", {
1696
+ body,
1697
+ ...options
1698
+ });
1699
+ }
1700
+ async listOverrides(params) {
1701
+ return this.client.request("GET", "/v1/bookings/overrides", { params });
1702
+ }
1703
+ async deleteOverride(id) {
1704
+ return this.client.request("DELETE", `/v1/bookings/overrides/${id}`);
1705
+ }
1706
+ };
1707
+
1649
1708
  // src/client.ts
1650
1709
  var SDK_VERSION = "0.1.0";
1651
1710
  var INITIAL_RETRY_DELAY = 0.5;
@@ -1726,6 +1785,8 @@ var Hydra = class {
1726
1785
  contentCategories = new ContentCategoriesResource(this);
1727
1786
  // P8: Subscriptions
1728
1787
  membershipPlans = new MembershipPlansResource(this);
1788
+ // P9: Bookings
1789
+ bookings = new BookingsResource(this);
1729
1790
  constructor(config) {
1730
1791
  for (const key of Object.keys(config)) {
1731
1792
  if (!VALID_CONFIG_KEYS.has(key)) {
@@ -1934,6 +1995,7 @@ var Hydra = class {
1934
1995
  export {
1935
1996
  AddressesResource,
1936
1997
  AnalyticsResource,
1998
+ BookingsResource,
1937
1999
  CartResource,
1938
2000
  ChannelsResource,
1939
2001
  CheckoutResource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethydra/sdk",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Official TypeScript SDK for the Hydra Commerce API",
5
5
  "license": "MIT",
6
6
  "author": "Grant Capital Group",