order3000 1.4.0 → 1.6.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 +67 -14
- package/dist/client.d.cts +425 -21
- package/dist/client.d.mts +425 -21
- package/dist/client.mjs +67 -14
- package/dist/schemas.cjs +566 -6
- package/dist/schemas.d.cts +299 -6
- package/dist/schemas.d.mts +299 -6
- package/dist/schemas.mjs +566 -6
- package/dist/tracking.cjs +37 -0
- package/dist/tracking.d.cts +34 -0
- package/dist/tracking.d.mts +34 -0
- package/dist/tracking.mjs +33 -0
- package/package.json +11 -1
package/dist/client.mjs
CHANGED
|
@@ -219,6 +219,38 @@ class AdsResource extends BaseResource {
|
|
|
219
219
|
body
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* Replace the ad's three owner-managed keyword sets in one shot: the
|
|
224
|
+
* active positive `keywords` the campaign bids on (alongside the venue
|
|
225
|
+
* keywords), the reversible `dismissedKeywords`, and the
|
|
226
|
+
* `disabledVenueKeywords` (venue keywords toggled off for this event).
|
|
227
|
+
* Every set is replaced wholesale — call {@link get} first and resend
|
|
228
|
+
* the full set to preserve existing entries. Texts are lowercased +
|
|
229
|
+
* de-duplicated server-side; an empty array clears that set. Returns the
|
|
230
|
+
* cleaned, persisted sets.
|
|
231
|
+
*/
|
|
232
|
+
async saveKeywords(adId, body) {
|
|
233
|
+
return this.request(
|
|
234
|
+
"PATCH",
|
|
235
|
+
`/${encodeURIComponent(adId)}/keywords`,
|
|
236
|
+
body
|
|
237
|
+
);
|
|
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
|
+
}
|
|
222
254
|
/**
|
|
223
255
|
* Permanently delete an ad by id. Returns the deleted ad row.
|
|
224
256
|
*/
|
|
@@ -505,7 +537,7 @@ class EventsResource extends BaseResource {
|
|
|
505
537
|
/**
|
|
506
538
|
* List all events for the venue
|
|
507
539
|
* @param options - Optional filters for the list request
|
|
508
|
-
* @returns Array of events with schedule,
|
|
540
|
+
* @returns Array of events with schedule, assets, and promotions
|
|
509
541
|
*/
|
|
510
542
|
async list(options) {
|
|
511
543
|
const queryParams = new URLSearchParams();
|
|
@@ -544,7 +576,7 @@ class EventsResource extends BaseResource {
|
|
|
544
576
|
* parts. The server resolves either form transparently.
|
|
545
577
|
* @param idOrAccessor - The event UUID or accessor (e.g., 'lunch-menu')
|
|
546
578
|
* @param options - Optional expand options
|
|
547
|
-
* @returns The event with optional schedule, timeSlots, menus, and
|
|
579
|
+
* @returns The event with optional schedule, timeSlots, menus, and assets
|
|
548
580
|
*/
|
|
549
581
|
async get(idOrAccessor, options) {
|
|
550
582
|
const queryString = this.buildQueryString(options);
|
|
@@ -580,23 +612,23 @@ class EventsResource extends BaseResource {
|
|
|
580
612
|
);
|
|
581
613
|
}
|
|
582
614
|
/**
|
|
583
|
-
* List the
|
|
584
|
-
* `get(idOrAccessor, { expand: ['
|
|
585
|
-
* `
|
|
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).
|
|
586
618
|
*/
|
|
587
|
-
async
|
|
619
|
+
async listAssets(idOrAccessor) {
|
|
588
620
|
const event = await this.get(idOrAccessor, {
|
|
589
|
-
expand: ["
|
|
621
|
+
expand: ["assets"]
|
|
590
622
|
});
|
|
591
|
-
return event.
|
|
623
|
+
return event.assets ?? [];
|
|
592
624
|
}
|
|
593
625
|
/**
|
|
594
|
-
* Upload a
|
|
626
|
+
* Upload a asset image for an event. The SDK builds the multipart
|
|
595
627
|
* body internally — pass a Buffer/Uint8Array, the original filename,
|
|
596
628
|
* and the MIME type. The asset is stored and linked to the event via
|
|
597
629
|
* `event_assets`; returns the new asset and its public URL.
|
|
598
630
|
*/
|
|
599
|
-
async
|
|
631
|
+
async uploadAsset(idOrAccessor, file) {
|
|
600
632
|
const form = new FormData();
|
|
601
633
|
form.append(
|
|
602
634
|
"file",
|
|
@@ -605,18 +637,18 @@ class EventsResource extends BaseResource {
|
|
|
605
637
|
);
|
|
606
638
|
return this.requestMultipart(
|
|
607
639
|
"POST",
|
|
608
|
-
`/${encodeURIComponent(idOrAccessor)}/
|
|
640
|
+
`/${encodeURIComponent(idOrAccessor)}/assets`,
|
|
609
641
|
form
|
|
610
642
|
);
|
|
611
643
|
}
|
|
612
644
|
/**
|
|
613
|
-
* Remove a
|
|
645
|
+
* Remove a asset from an event. Deletes the asset (storage object +
|
|
614
646
|
* DB row + `event_assets` link). Returns `{ success: true }`.
|
|
615
647
|
*/
|
|
616
|
-
async
|
|
648
|
+
async removeAsset(idOrAccessor, assetId) {
|
|
617
649
|
return this.request(
|
|
618
650
|
"DELETE",
|
|
619
|
-
`/${encodeURIComponent(idOrAccessor)}/
|
|
651
|
+
`/${encodeURIComponent(idOrAccessor)}/assets/${encodeURIComponent(assetId)}`
|
|
620
652
|
);
|
|
621
653
|
}
|
|
622
654
|
}
|
|
@@ -758,6 +790,25 @@ class ReservationsResource extends BaseResource {
|
|
|
758
790
|
}
|
|
759
791
|
}
|
|
760
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
|
+
|
|
761
812
|
class SubscriptionsResource extends BaseResource {
|
|
762
813
|
constructor(tokenManager, baseUrl) {
|
|
763
814
|
super(tokenManager, baseUrl, "/subscriptions");
|
|
@@ -1382,6 +1433,7 @@ class O3KClient {
|
|
|
1382
1433
|
__publicField(this, "orders");
|
|
1383
1434
|
__publicField(this, "paymentIntents");
|
|
1384
1435
|
__publicField(this, "reservations");
|
|
1436
|
+
__publicField(this, "rituals");
|
|
1385
1437
|
__publicField(this, "subscriptions");
|
|
1386
1438
|
__publicField(this, "teamOrders");
|
|
1387
1439
|
__publicField(this, "venues");
|
|
@@ -1412,6 +1464,7 @@ class O3KClient {
|
|
|
1412
1464
|
this.tokenManager,
|
|
1413
1465
|
this.baseUrl
|
|
1414
1466
|
);
|
|
1467
|
+
this.rituals = new RitualsResource(this.tokenManager, this.baseUrl);
|
|
1415
1468
|
this.subscriptions = new SubscriptionsResource(
|
|
1416
1469
|
this.tokenManager,
|
|
1417
1470
|
this.baseUrl
|