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