order3000 1.5.0 → 1.7.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/client.cjs CHANGED
@@ -237,6 +237,21 @@ class AdsResource extends BaseResource {
237
237
  body
238
238
  );
239
239
  }
240
+ /**
241
+ * Write paste-ready Meta (Facebook/Instagram) ad copy + creative onto the
242
+ * ad's `metaContent` document — the Meta analog of {@link patch} (which writes
243
+ * Google `content`). Pass `metaContent` (primary text / headline / description
244
+ * keyed by locale, `finalUrl`, `callToAction`, the per-placement `creatives`
245
+ * map) and/or `status`; Google `content` is left untouched. Returns the
246
+ * resulting ad.
247
+ */
248
+ async editMeta(adId, body) {
249
+ return this.request(
250
+ "PATCH",
251
+ `/${encodeURIComponent(adId)}/meta`,
252
+ body
253
+ );
254
+ }
240
255
  /**
241
256
  * Permanently delete an ad by id. Returns the deleted ad row.
242
257
  */
@@ -523,7 +538,7 @@ class EventsResource extends BaseResource {
523
538
  /**
524
539
  * List all events for the venue
525
540
  * @param options - Optional filters for the list request
526
- * @returns Array of events with schedule, posters, and promotions
541
+ * @returns Array of events with schedule, assets, and promotions
527
542
  */
528
543
  async list(options) {
529
544
  const queryParams = new URLSearchParams();
@@ -562,7 +577,7 @@ class EventsResource extends BaseResource {
562
577
  * parts. The server resolves either form transparently.
563
578
  * @param idOrAccessor - The event UUID or accessor (e.g., 'lunch-menu')
564
579
  * @param options - Optional expand options
565
- * @returns The event with optional schedule, timeSlots, menus, and posters
580
+ * @returns The event with optional schedule, timeSlots, menus, and assets
566
581
  */
567
582
  async get(idOrAccessor, options) {
568
583
  const queryString = this.buildQueryString(options);
@@ -598,23 +613,23 @@ class EventsResource extends BaseResource {
598
613
  );
599
614
  }
600
615
  /**
601
- * List the posters attached to an event. Convenience over
602
- * `get(idOrAccessor, { expand: ['posters'] })` — returns the
603
- * `posters[]` array (empty when the event has none).
616
+ * List the assets attached to an event. Convenience over
617
+ * `get(idOrAccessor, { expand: ['assets'] })` — returns the
618
+ * `assets[]` array (empty when the event has none).
604
619
  */
605
- async listPosters(idOrAccessor) {
620
+ async listAssets(idOrAccessor) {
606
621
  const event = await this.get(idOrAccessor, {
607
- expand: ["posters"]
622
+ expand: ["assets"]
608
623
  });
609
- return event.posters ?? [];
624
+ return event.assets ?? [];
610
625
  }
611
626
  /**
612
- * Upload a poster image for an event. The SDK builds the multipart
627
+ * Upload a asset image for an event. The SDK builds the multipart
613
628
  * body internally — pass a Buffer/Uint8Array, the original filename,
614
629
  * and the MIME type. The asset is stored and linked to the event via
615
630
  * `event_assets`; returns the new asset and its public URL.
616
631
  */
617
- async uploadPoster(idOrAccessor, file) {
632
+ async uploadAsset(idOrAccessor, file) {
618
633
  const form = new FormData();
619
634
  form.append(
620
635
  "file",
@@ -623,18 +638,18 @@ class EventsResource extends BaseResource {
623
638
  );
624
639
  return this.requestMultipart(
625
640
  "POST",
626
- `/${encodeURIComponent(idOrAccessor)}/posters`,
641
+ `/${encodeURIComponent(idOrAccessor)}/assets`,
627
642
  form
628
643
  );
629
644
  }
630
645
  /**
631
- * Remove a poster from an event. Deletes the asset (storage object +
646
+ * Remove a asset from an event. Deletes the asset (storage object +
632
647
  * DB row + `event_assets` link). Returns `{ success: true }`.
633
648
  */
634
- async removePoster(idOrAccessor, assetId) {
649
+ async removeAsset(idOrAccessor, assetId) {
635
650
  return this.request(
636
651
  "DELETE",
637
- `/${encodeURIComponent(idOrAccessor)}/posters/${encodeURIComponent(assetId)}`
652
+ `/${encodeURIComponent(idOrAccessor)}/assets/${encodeURIComponent(assetId)}`
638
653
  );
639
654
  }
640
655
  }
@@ -776,6 +791,25 @@ class ReservationsResource extends BaseResource {
776
791
  }
777
792
  }
778
793
 
794
+ class RitualsResource extends BaseResource {
795
+ constructor(tokenManager, baseUrl) {
796
+ super(tokenManager, baseUrl, "/rituals");
797
+ }
798
+ /**
799
+ * Get a single ritual by accessor (slug). Returns the ritual with its
800
+ * template schedule (time slots + date overrides), media, and the events
801
+ * materialised from it (with per-day covers).
802
+ * @param accessor - The ritual accessor (e.g. 'a-la-carte-weekend')
803
+ * @returns The ritual document
804
+ */
805
+ async get(accessor) {
806
+ return this.request(
807
+ "GET",
808
+ `/${encodeURIComponent(accessor)}`
809
+ );
810
+ }
811
+ }
812
+
779
813
  class SubscriptionsResource extends BaseResource {
780
814
  constructor(tokenManager, baseUrl) {
781
815
  super(tokenManager, baseUrl, "/subscriptions");
@@ -1400,6 +1434,7 @@ class O3KClient {
1400
1434
  __publicField(this, "orders");
1401
1435
  __publicField(this, "paymentIntents");
1402
1436
  __publicField(this, "reservations");
1437
+ __publicField(this, "rituals");
1403
1438
  __publicField(this, "subscriptions");
1404
1439
  __publicField(this, "teamOrders");
1405
1440
  __publicField(this, "venues");
@@ -1430,6 +1465,7 @@ class O3KClient {
1430
1465
  this.tokenManager,
1431
1466
  this.baseUrl
1432
1467
  );
1468
+ this.rituals = new RitualsResource(this.tokenManager, this.baseUrl);
1433
1469
  this.subscriptions = new SubscriptionsResource(
1434
1470
  this.tokenManager,
1435
1471
  this.baseUrl