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