order3000 1.5.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 +50 -14
- package/dist/client.d.cts +350 -19
- package/dist/client.d.mts +350 -19
- package/dist/client.mjs +50 -14
- package/dist/schemas.cjs +462 -4
- package/dist/schemas.d.cts +268 -3
- package/dist/schemas.d.mts +268 -3
- package/dist/schemas.mjs +462 -4
- 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/schemas.mjs
CHANGED
|
@@ -11,9 +11,9 @@ const abandonBasketResponseSchema = z.object({
|
|
|
11
11
|
|
|
12
12
|
const actorTypeSchema = z.enum(["human", "robot"]);
|
|
13
13
|
|
|
14
|
-
const adChannelSchema = z.enum(["google"]);
|
|
14
|
+
const adChannelSchema = z.enum(["google", "facebook", "instagram"]);
|
|
15
15
|
|
|
16
|
-
const adOwnerTypeSchema = z.enum(["event"]);
|
|
16
|
+
const adOwnerTypeSchema = z.enum(["event", "ritual"]);
|
|
17
17
|
|
|
18
18
|
const adStatusSchema = z.enum(["draft", "ready", "archived"]);
|
|
19
19
|
|
|
@@ -578,6 +578,27 @@ const createAdResponseSchema = z.object({
|
|
|
578
578
|
z.array(z.any()),
|
|
579
579
|
z.object({}).catchall(z.any())
|
|
580
580
|
]),
|
|
581
|
+
metaContent: z.nullable(
|
|
582
|
+
z.union([
|
|
583
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
584
|
+
z.array(z.any()),
|
|
585
|
+
z.object({}).catchall(z.any())
|
|
586
|
+
])
|
|
587
|
+
),
|
|
588
|
+
metaRefs: z.nullable(
|
|
589
|
+
z.union([
|
|
590
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
591
|
+
z.array(z.any()),
|
|
592
|
+
z.object({}).catchall(z.any())
|
|
593
|
+
])
|
|
594
|
+
),
|
|
595
|
+
targetingOverride: z.nullable(
|
|
596
|
+
z.union([
|
|
597
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
598
|
+
z.array(z.any()),
|
|
599
|
+
z.object({}).catchall(z.any())
|
|
600
|
+
])
|
|
601
|
+
),
|
|
581
602
|
keywords: z.union([
|
|
582
603
|
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
583
604
|
z.array(z.any()),
|
|
@@ -818,6 +839,27 @@ const deleteAdResponseSchema = z.object({
|
|
|
818
839
|
z.array(z.any()),
|
|
819
840
|
z.object({}).catchall(z.any())
|
|
820
841
|
]),
|
|
842
|
+
metaContent: z.nullable(
|
|
843
|
+
z.union([
|
|
844
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
845
|
+
z.array(z.any()),
|
|
846
|
+
z.object({}).catchall(z.any())
|
|
847
|
+
])
|
|
848
|
+
),
|
|
849
|
+
metaRefs: z.nullable(
|
|
850
|
+
z.union([
|
|
851
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
852
|
+
z.array(z.any()),
|
|
853
|
+
z.object({}).catchall(z.any())
|
|
854
|
+
])
|
|
855
|
+
),
|
|
856
|
+
targetingOverride: z.nullable(
|
|
857
|
+
z.union([
|
|
858
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
859
|
+
z.array(z.any()),
|
|
860
|
+
z.object({}).catchall(z.any())
|
|
861
|
+
])
|
|
862
|
+
),
|
|
821
863
|
keywords: z.union([
|
|
822
864
|
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
823
865
|
z.array(z.any()),
|
|
@@ -946,6 +988,27 @@ const editAdResponseSchema = z.object({
|
|
|
946
988
|
z.array(z.any()),
|
|
947
989
|
z.object({}).catchall(z.any())
|
|
948
990
|
]),
|
|
991
|
+
metaContent: z.nullable(
|
|
992
|
+
z.union([
|
|
993
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
994
|
+
z.array(z.any()),
|
|
995
|
+
z.object({}).catchall(z.any())
|
|
996
|
+
])
|
|
997
|
+
),
|
|
998
|
+
metaRefs: z.nullable(
|
|
999
|
+
z.union([
|
|
1000
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1001
|
+
z.array(z.any()),
|
|
1002
|
+
z.object({}).catchall(z.any())
|
|
1003
|
+
])
|
|
1004
|
+
),
|
|
1005
|
+
targetingOverride: z.nullable(
|
|
1006
|
+
z.union([
|
|
1007
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1008
|
+
z.array(z.any()),
|
|
1009
|
+
z.object({}).catchall(z.any())
|
|
1010
|
+
])
|
|
1011
|
+
),
|
|
949
1012
|
keywords: z.union([
|
|
950
1013
|
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
951
1014
|
z.array(z.any()),
|
|
@@ -1186,6 +1249,103 @@ const editEventResponseSchema = z.object({
|
|
|
1186
1249
|
)
|
|
1187
1250
|
}).describe("Successfully updated event with schedule");
|
|
1188
1251
|
|
|
1252
|
+
const editMetaAdRequestSchema = z.object({
|
|
1253
|
+
venueAccessor: z.string().min(1),
|
|
1254
|
+
id: z.string().min(1),
|
|
1255
|
+
metaContent: z.optional(
|
|
1256
|
+
z.object({
|
|
1257
|
+
primaryText: z.object({}).catchall(z.string().max(125)),
|
|
1258
|
+
headline: z.object({}).catchall(z.string().max(40)),
|
|
1259
|
+
description: z.object({}).catchall(z.string().max(30)),
|
|
1260
|
+
finalUrl: z.url(),
|
|
1261
|
+
callToAction: z.string(),
|
|
1262
|
+
creatives: z.object({}).catchall(
|
|
1263
|
+
z.object({
|
|
1264
|
+
assetId: z.string()
|
|
1265
|
+
})
|
|
1266
|
+
)
|
|
1267
|
+
})
|
|
1268
|
+
),
|
|
1269
|
+
get status() {
|
|
1270
|
+
return adStatusSchema.optional();
|
|
1271
|
+
}
|
|
1272
|
+
}).describe("Partial-update body for an existing Meta ad");
|
|
1273
|
+
|
|
1274
|
+
const editMetaAdResponseSchema = z.object({
|
|
1275
|
+
id: z.string(),
|
|
1276
|
+
venueId: z.string(),
|
|
1277
|
+
get ownerEntityType() {
|
|
1278
|
+
return adOwnerTypeSchema;
|
|
1279
|
+
},
|
|
1280
|
+
ownerEntityId: z.string(),
|
|
1281
|
+
get channel() {
|
|
1282
|
+
return adChannelSchema;
|
|
1283
|
+
},
|
|
1284
|
+
get status() {
|
|
1285
|
+
return adStatusSchema;
|
|
1286
|
+
},
|
|
1287
|
+
campaignId: z.nullable(z.string()),
|
|
1288
|
+
content: z.union([
|
|
1289
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1290
|
+
z.array(z.any()),
|
|
1291
|
+
z.object({}).catchall(z.any())
|
|
1292
|
+
]),
|
|
1293
|
+
metaContent: z.nullable(
|
|
1294
|
+
z.union([
|
|
1295
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1296
|
+
z.array(z.any()),
|
|
1297
|
+
z.object({}).catchall(z.any())
|
|
1298
|
+
])
|
|
1299
|
+
),
|
|
1300
|
+
metaRefs: z.nullable(
|
|
1301
|
+
z.union([
|
|
1302
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1303
|
+
z.array(z.any()),
|
|
1304
|
+
z.object({}).catchall(z.any())
|
|
1305
|
+
])
|
|
1306
|
+
),
|
|
1307
|
+
targetingOverride: z.nullable(
|
|
1308
|
+
z.union([
|
|
1309
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1310
|
+
z.array(z.any()),
|
|
1311
|
+
z.object({}).catchall(z.any())
|
|
1312
|
+
])
|
|
1313
|
+
),
|
|
1314
|
+
keywords: z.union([
|
|
1315
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1316
|
+
z.array(z.any()),
|
|
1317
|
+
z.object({}).catchall(z.any())
|
|
1318
|
+
]),
|
|
1319
|
+
negativeKeywords: z.union([
|
|
1320
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1321
|
+
z.array(z.any()),
|
|
1322
|
+
z.object({}).catchall(z.any())
|
|
1323
|
+
]),
|
|
1324
|
+
disabledVenueKeywords: z.union([
|
|
1325
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1326
|
+
z.array(z.any()),
|
|
1327
|
+
z.object({}).catchall(z.any())
|
|
1328
|
+
]),
|
|
1329
|
+
dismissedKeywords: z.union([
|
|
1330
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1331
|
+
z.array(z.any()),
|
|
1332
|
+
z.object({}).catchall(z.any())
|
|
1333
|
+
]),
|
|
1334
|
+
publishedContentHash: z.nullable(z.string()),
|
|
1335
|
+
publishedAt: z.nullable(z.any()),
|
|
1336
|
+
pushedKeywords: z.nullable(
|
|
1337
|
+
z.union([
|
|
1338
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1339
|
+
z.array(z.any()),
|
|
1340
|
+
z.object({}).catchall(z.any())
|
|
1341
|
+
])
|
|
1342
|
+
),
|
|
1343
|
+
createdBy: z.nullable(z.string()),
|
|
1344
|
+
updatedBy: z.nullable(z.string()),
|
|
1345
|
+
createdAt: z.nullable(z.any()),
|
|
1346
|
+
updatedAt: z.nullable(z.any())
|
|
1347
|
+
}).describe("Successfully updated Meta ad");
|
|
1348
|
+
|
|
1189
1349
|
const entityOwnerTypeSchema = z.enum([
|
|
1190
1350
|
"event",
|
|
1191
1351
|
"dish",
|
|
@@ -1258,6 +1418,27 @@ const fetchAdResponseSchema = z.object({
|
|
|
1258
1418
|
z.array(z.any()),
|
|
1259
1419
|
z.object({}).catchall(z.any())
|
|
1260
1420
|
]),
|
|
1421
|
+
metaContent: z.nullable(
|
|
1422
|
+
z.union([
|
|
1423
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1424
|
+
z.array(z.any()),
|
|
1425
|
+
z.object({}).catchall(z.any())
|
|
1426
|
+
])
|
|
1427
|
+
),
|
|
1428
|
+
metaRefs: z.nullable(
|
|
1429
|
+
z.union([
|
|
1430
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1431
|
+
z.array(z.any()),
|
|
1432
|
+
z.object({}).catchall(z.any())
|
|
1433
|
+
])
|
|
1434
|
+
),
|
|
1435
|
+
targetingOverride: z.nullable(
|
|
1436
|
+
z.union([
|
|
1437
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1438
|
+
z.array(z.any()),
|
|
1439
|
+
z.object({}).catchall(z.any())
|
|
1440
|
+
])
|
|
1441
|
+
),
|
|
1261
1442
|
keywords: z.union([
|
|
1262
1443
|
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1263
1444
|
z.array(z.any()),
|
|
@@ -1313,6 +1494,27 @@ const fetchAdsResponseSchema = z.array(
|
|
|
1313
1494
|
z.array(z.any()),
|
|
1314
1495
|
z.object({}).catchall(z.any())
|
|
1315
1496
|
]),
|
|
1497
|
+
metaContent: z.nullable(
|
|
1498
|
+
z.union([
|
|
1499
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1500
|
+
z.array(z.any()),
|
|
1501
|
+
z.object({}).catchall(z.any())
|
|
1502
|
+
])
|
|
1503
|
+
),
|
|
1504
|
+
metaRefs: z.nullable(
|
|
1505
|
+
z.union([
|
|
1506
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1507
|
+
z.array(z.any()),
|
|
1508
|
+
z.object({}).catchall(z.any())
|
|
1509
|
+
])
|
|
1510
|
+
),
|
|
1511
|
+
targetingOverride: z.nullable(
|
|
1512
|
+
z.union([
|
|
1513
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1514
|
+
z.array(z.any()),
|
|
1515
|
+
z.object({}).catchall(z.any())
|
|
1516
|
+
])
|
|
1517
|
+
),
|
|
1316
1518
|
keywords: z.union([
|
|
1317
1519
|
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
1318
1520
|
z.array(z.any()),
|
|
@@ -1679,7 +1881,7 @@ const fetchEventResponseSchema = z.object({
|
|
|
1679
1881
|
)
|
|
1680
1882
|
)
|
|
1681
1883
|
}).describe(
|
|
1682
|
-
"Event details. Nested objects (schedule, timeSlots, menus,
|
|
1884
|
+
"Event details. Nested objects (schedule, timeSlots, menus, assets, nextOccurrence) pass through; their shape follows the SDK Event interface."
|
|
1683
1885
|
);
|
|
1684
1886
|
|
|
1685
1887
|
const promotionBenefitTypeSchema = z.enum([
|
|
@@ -2250,6 +2452,233 @@ const fetchMenuSubscriptionsResponseSchema = z.array(
|
|
|
2250
2452
|
})
|
|
2251
2453
|
);
|
|
2252
2454
|
|
|
2455
|
+
const fetchRitualResponseSchema = z.object({
|
|
2456
|
+
id: z.string(),
|
|
2457
|
+
venueId: z.string(),
|
|
2458
|
+
accessor: z.string(),
|
|
2459
|
+
get ritualType() {
|
|
2460
|
+
return ritualTypeSchema;
|
|
2461
|
+
},
|
|
2462
|
+
scheduleId: z.nullable(z.string()),
|
|
2463
|
+
name: z.union([
|
|
2464
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2465
|
+
z.array(z.any()),
|
|
2466
|
+
z.object({}).catchall(z.any())
|
|
2467
|
+
]),
|
|
2468
|
+
description: z.nullable(
|
|
2469
|
+
z.union([
|
|
2470
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2471
|
+
z.array(z.any()),
|
|
2472
|
+
z.object({}).catchall(z.any())
|
|
2473
|
+
])
|
|
2474
|
+
),
|
|
2475
|
+
playbook: z.nullable(
|
|
2476
|
+
z.union([
|
|
2477
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2478
|
+
z.array(z.any()),
|
|
2479
|
+
z.object({}).catchall(z.any())
|
|
2480
|
+
])
|
|
2481
|
+
),
|
|
2482
|
+
maxBookings: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2483
|
+
maxGuests: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2484
|
+
minPartySize: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2485
|
+
maxPartySize: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2486
|
+
isPublic: z.boolean(),
|
|
2487
|
+
reservationsEnabled: z.boolean(),
|
|
2488
|
+
bookingOpensAtDays: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2489
|
+
bookingClosesAtOffset: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2490
|
+
isActive: z.boolean(),
|
|
2491
|
+
isFeatured: z.boolean(),
|
|
2492
|
+
priority: z.int().min(-2147483648).max(2147483647),
|
|
2493
|
+
createdBy: z.nullable(z.string()),
|
|
2494
|
+
updatedBy: z.nullable(z.string()),
|
|
2495
|
+
createdAt: z.nullable(z.any()),
|
|
2496
|
+
updatedAt: z.nullable(z.any()),
|
|
2497
|
+
assets: z.array(
|
|
2498
|
+
z.object({
|
|
2499
|
+
id: z.string(),
|
|
2500
|
+
get type() {
|
|
2501
|
+
return assetTypeSchema;
|
|
2502
|
+
},
|
|
2503
|
+
tags: z.nullable(z.array(z.string())),
|
|
2504
|
+
bucket: z.string(),
|
|
2505
|
+
storagePath: z.string(),
|
|
2506
|
+
filename: z.string(),
|
|
2507
|
+
contentType: z.string(),
|
|
2508
|
+
sizeBytes: z.int().min(-2147483648).max(2147483647),
|
|
2509
|
+
caption: z.union([
|
|
2510
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2511
|
+
z.array(z.any()),
|
|
2512
|
+
z.object({}).catchall(z.any())
|
|
2513
|
+
]),
|
|
2514
|
+
alt: z.union([
|
|
2515
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2516
|
+
z.array(z.any()),
|
|
2517
|
+
z.object({}).catchall(z.any())
|
|
2518
|
+
]),
|
|
2519
|
+
metadata: z.nullable(
|
|
2520
|
+
z.union([
|
|
2521
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2522
|
+
z.array(z.any()),
|
|
2523
|
+
z.object({}).catchall(z.any())
|
|
2524
|
+
])
|
|
2525
|
+
),
|
|
2526
|
+
cropArea: z.nullable(
|
|
2527
|
+
z.union([
|
|
2528
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2529
|
+
z.array(z.any()),
|
|
2530
|
+
z.object({}).catchall(z.any())
|
|
2531
|
+
])
|
|
2532
|
+
),
|
|
2533
|
+
isActive: z.boolean(),
|
|
2534
|
+
sortIndex: z.nullable(z.string().max(255)),
|
|
2535
|
+
createdAt: z.nullable(z.any()),
|
|
2536
|
+
updatedAt: z.nullable(z.any()),
|
|
2537
|
+
createdBy: z.nullable(z.string()),
|
|
2538
|
+
updatedBy: z.nullable(z.string()),
|
|
2539
|
+
venueId: z.nullable(z.string()),
|
|
2540
|
+
publicUrl: z.string()
|
|
2541
|
+
})
|
|
2542
|
+
),
|
|
2543
|
+
events: z.array(
|
|
2544
|
+
z.object({
|
|
2545
|
+
id: z.string(),
|
|
2546
|
+
venueId: z.string(),
|
|
2547
|
+
accessor: z.nullable(z.string()),
|
|
2548
|
+
name: z.union([
|
|
2549
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2550
|
+
z.array(z.any()),
|
|
2551
|
+
z.object({}).catchall(z.any())
|
|
2552
|
+
]),
|
|
2553
|
+
description: z.nullable(
|
|
2554
|
+
z.union([
|
|
2555
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2556
|
+
z.array(z.any()),
|
|
2557
|
+
z.object({}).catchall(z.any())
|
|
2558
|
+
])
|
|
2559
|
+
),
|
|
2560
|
+
scheduleId: z.nullable(z.string()),
|
|
2561
|
+
ritualId: z.nullable(z.string()),
|
|
2562
|
+
occurrenceDate: z.nullable(z.string()),
|
|
2563
|
+
maxBookings: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2564
|
+
maxGuests: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2565
|
+
minPartySize: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2566
|
+
maxPartySize: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2567
|
+
isPublic: z.boolean(),
|
|
2568
|
+
reservationsEnabled: z.boolean(),
|
|
2569
|
+
bookingOpensAtDays: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2570
|
+
bookingClosesAtOffset: z.nullable(
|
|
2571
|
+
z.int().min(-2147483648).max(2147483647)
|
|
2572
|
+
),
|
|
2573
|
+
isActive: z.boolean(),
|
|
2574
|
+
isFeatured: z.boolean(),
|
|
2575
|
+
priority: z.int().min(-2147483648).max(2147483647),
|
|
2576
|
+
createdBy: z.nullable(z.string()),
|
|
2577
|
+
updatedBy: z.nullable(z.string()),
|
|
2578
|
+
createdAt: z.nullable(z.any()),
|
|
2579
|
+
updatedAt: z.nullable(z.any()),
|
|
2580
|
+
covers: z.number()
|
|
2581
|
+
})
|
|
2582
|
+
),
|
|
2583
|
+
schedule: z.nullable(
|
|
2584
|
+
z.object({
|
|
2585
|
+
id: z.string(),
|
|
2586
|
+
name: z.union([
|
|
2587
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2588
|
+
z.array(z.any()),
|
|
2589
|
+
z.object({}).catchall(z.any())
|
|
2590
|
+
]),
|
|
2591
|
+
description: z.nullable(
|
|
2592
|
+
z.union([
|
|
2593
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2594
|
+
z.array(z.any()),
|
|
2595
|
+
z.object({}).catchall(z.any())
|
|
2596
|
+
])
|
|
2597
|
+
),
|
|
2598
|
+
timezone: z.string(),
|
|
2599
|
+
rrule: z.nullable(z.string()),
|
|
2600
|
+
exdates: z.nullable(z.array(z.string())),
|
|
2601
|
+
validFrom: z.nullable(z.string()),
|
|
2602
|
+
validTo: z.nullable(z.string()),
|
|
2603
|
+
priority: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2604
|
+
get slotMode() {
|
|
2605
|
+
return slotModeSchema;
|
|
2606
|
+
},
|
|
2607
|
+
intervalDuration: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2608
|
+
duration: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2609
|
+
isActive: z.boolean(),
|
|
2610
|
+
sortIndex: z.nullable(z.string().max(255)),
|
|
2611
|
+
updatedAt: z.nullable(z.any()),
|
|
2612
|
+
updatedBy: z.nullable(z.string()),
|
|
2613
|
+
createdAt: z.nullable(z.any()),
|
|
2614
|
+
createdBy: z.nullable(z.string()),
|
|
2615
|
+
scheduleTimeSlots: z.array(
|
|
2616
|
+
z.object({
|
|
2617
|
+
scheduleId: z.nullable(z.string()),
|
|
2618
|
+
timeSlotId: z.nullable(z.string()),
|
|
2619
|
+
get dayOfWeek() {
|
|
2620
|
+
return dayOfWeekSchema;
|
|
2621
|
+
},
|
|
2622
|
+
sortIndex: z.nullable(z.string().max(255)),
|
|
2623
|
+
timeSlot: z.nullable(
|
|
2624
|
+
z.object({
|
|
2625
|
+
id: z.string(),
|
|
2626
|
+
startTime: z.string(),
|
|
2627
|
+
endTime: z.nullable(z.string()),
|
|
2628
|
+
isActive: z.nullable(z.boolean()),
|
|
2629
|
+
isSchedulable: z.nullable(z.boolean()),
|
|
2630
|
+
sortIndex: z.nullable(z.string().max(255)),
|
|
2631
|
+
updatedAt: z.nullable(z.any()),
|
|
2632
|
+
updatedBy: z.nullable(z.string()),
|
|
2633
|
+
createdAt: z.nullable(z.any()),
|
|
2634
|
+
createdBy: z.nullable(z.string())
|
|
2635
|
+
})
|
|
2636
|
+
)
|
|
2637
|
+
})
|
|
2638
|
+
),
|
|
2639
|
+
scheduleOverrides: z.array(
|
|
2640
|
+
z.object({
|
|
2641
|
+
id: z.string(),
|
|
2642
|
+
scheduleId: z.string(),
|
|
2643
|
+
date: z.string(),
|
|
2644
|
+
reason: z.nullable(
|
|
2645
|
+
z.union([
|
|
2646
|
+
z.union([z.boolean(), z.string(), z.number(), z.enum([])]),
|
|
2647
|
+
z.array(z.any()),
|
|
2648
|
+
z.object({}).catchall(z.any())
|
|
2649
|
+
])
|
|
2650
|
+
),
|
|
2651
|
+
isActive: z.boolean(),
|
|
2652
|
+
priority: z.nullable(z.int().min(-2147483648).max(2147483647)),
|
|
2653
|
+
updatedAt: z.nullable(z.any()),
|
|
2654
|
+
updatedBy: z.nullable(z.string()),
|
|
2655
|
+
createdAt: z.nullable(z.any()),
|
|
2656
|
+
createdBy: z.nullable(z.string()),
|
|
2657
|
+
scheduleOverrideTimeSlots: z.array(
|
|
2658
|
+
z.object({
|
|
2659
|
+
overrideId: z.string(),
|
|
2660
|
+
timeSlotId: z.string(),
|
|
2661
|
+
sortIndex: z.nullable(z.string().max(255)),
|
|
2662
|
+
timeSlot: z.object({
|
|
2663
|
+
id: z.string(),
|
|
2664
|
+
startTime: z.string(),
|
|
2665
|
+
endTime: z.nullable(z.string()),
|
|
2666
|
+
isActive: z.nullable(z.boolean()),
|
|
2667
|
+
isSchedulable: z.nullable(z.boolean()),
|
|
2668
|
+
sortIndex: z.nullable(z.string().max(255)),
|
|
2669
|
+
updatedAt: z.nullable(z.any()),
|
|
2670
|
+
updatedBy: z.nullable(z.string()),
|
|
2671
|
+
createdAt: z.nullable(z.any()),
|
|
2672
|
+
createdBy: z.nullable(z.string())
|
|
2673
|
+
})
|
|
2674
|
+
})
|
|
2675
|
+
)
|
|
2676
|
+
})
|
|
2677
|
+
)
|
|
2678
|
+
})
|
|
2679
|
+
)
|
|
2680
|
+
});
|
|
2681
|
+
|
|
2253
2682
|
const fetchTeamOrderResponseSchema = z.object({
|
|
2254
2683
|
teamOrder: z.object({
|
|
2255
2684
|
id: z.string(),
|
|
@@ -2369,6 +2798,21 @@ const fetchTeamOrderResponseSchema = z.object({
|
|
|
2369
2798
|
isLead: z.boolean()
|
|
2370
2799
|
});
|
|
2371
2800
|
|
|
2801
|
+
const gbpMediaCategorySchema = z.enum([
|
|
2802
|
+
"cover",
|
|
2803
|
+
"logo",
|
|
2804
|
+
"gallery",
|
|
2805
|
+
"video"
|
|
2806
|
+
]);
|
|
2807
|
+
|
|
2808
|
+
const gbpSyncStatusSchema = z.enum([
|
|
2809
|
+
"processing",
|
|
2810
|
+
"live",
|
|
2811
|
+
"rejected",
|
|
2812
|
+
"failed",
|
|
2813
|
+
"removed"
|
|
2814
|
+
]);
|
|
2815
|
+
|
|
2372
2816
|
const getAreaAvailabilityResponseSchema = z.object({
|
|
2373
2817
|
from: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
2374
2818
|
to: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
@@ -2503,7 +2947,12 @@ const integrationNotificationTypeSchema = z.enum([
|
|
|
2503
2947
|
"reservation_cancelled"
|
|
2504
2948
|
]);
|
|
2505
2949
|
|
|
2506
|
-
const integrationTypeSchema = z.enum([
|
|
2950
|
+
const integrationTypeSchema = z.enum([
|
|
2951
|
+
"telegram",
|
|
2952
|
+
"google_ads",
|
|
2953
|
+
"google_business_profile",
|
|
2954
|
+
"meta_ads"
|
|
2955
|
+
]);
|
|
2507
2956
|
|
|
2508
2957
|
const inventoryAssetStatusSchema = z.enum([
|
|
2509
2958
|
"available",
|
|
@@ -2769,6 +3218,9 @@ const makeReservationRequestSchema = z.object({
|
|
|
2769
3218
|
).nullish(),
|
|
2770
3219
|
wbraid: z.string().describe(
|
|
2771
3220
|
"Google Ads click identifier for web-to-app (iOS) where `gclid` is unavailable."
|
|
3221
|
+
).nullish(),
|
|
3222
|
+
fbclid: z.string().describe(
|
|
3223
|
+
"Meta (Facebook/Instagram) click identifier from the landing URL. Stored for server-side Conversions API reporting."
|
|
2772
3224
|
).nullish()
|
|
2773
3225
|
}).describe("Request payload for making a new reservation");
|
|
2774
3226
|
|
|
@@ -2830,6 +3282,7 @@ const makeReservationResponseSchema = z.object({
|
|
|
2830
3282
|
gclid: z.nullable(z.string()),
|
|
2831
3283
|
gbraid: z.nullable(z.string()),
|
|
2832
3284
|
wbraid: z.nullable(z.string()),
|
|
3285
|
+
fbclid: z.nullable(z.string()),
|
|
2833
3286
|
specialRequests: z.nullable(
|
|
2834
3287
|
z.string().describe("Any special requirements or notes")
|
|
2835
3288
|
),
|
|
@@ -3308,6 +3761,8 @@ const schemas = {
|
|
|
3308
3761
|
EditArticleResponse: editArticleResponseSchema,
|
|
3309
3762
|
EditEventRequest: editEventRequestSchema,
|
|
3310
3763
|
EditEventResponse: editEventResponseSchema,
|
|
3764
|
+
EditMetaAdRequest: editMetaAdRequestSchema,
|
|
3765
|
+
EditMetaAdResponse: editMetaAdResponseSchema,
|
|
3311
3766
|
EntityOwnerType: entityOwnerTypeSchema,
|
|
3312
3767
|
EnumFalse: enumFalseSchema,
|
|
3313
3768
|
EnumTrue: enumTrueSchema,
|
|
@@ -3332,8 +3787,11 @@ const schemas = {
|
|
|
3332
3787
|
FetchMenuBundlesResponse: fetchMenuBundlesResponseSchema,
|
|
3333
3788
|
FetchMenuResponse: fetchMenuResponseSchema,
|
|
3334
3789
|
FetchMenuSubscriptionsResponse: fetchMenuSubscriptionsResponseSchema,
|
|
3790
|
+
FetchRitualResponse: fetchRitualResponseSchema,
|
|
3335
3791
|
FetchTeamOrderResponse: fetchTeamOrderResponseSchema,
|
|
3336
3792
|
FulfillmentType: fulfillmentTypeSchema,
|
|
3793
|
+
GbpMediaCategory: gbpMediaCategorySchema,
|
|
3794
|
+
GbpSyncStatus: gbpSyncStatusSchema,
|
|
3337
3795
|
GetAreaAvailabilityResponse: getAreaAvailabilityResponseSchema,
|
|
3338
3796
|
GetBasketTotalsRequest: getBasketTotalsRequestSchema,
|
|
3339
3797
|
GetBasketTotalsResponse: getBasketTotalsResponseSchema,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const AD_CLICK_ID_KEYS = [
|
|
4
|
+
"gclid",
|
|
5
|
+
"gbraid",
|
|
6
|
+
"wbraid",
|
|
7
|
+
"fbclid"
|
|
8
|
+
];
|
|
9
|
+
const AD_CLICK_COOKIE_MAX_AGE = 90 * 24 * 60 * 60;
|
|
10
|
+
function writeCookie(name, value) {
|
|
11
|
+
document.cookie = `${name}=${encodeURIComponent(value)}; path=/; max-age=${AD_CLICK_COOKIE_MAX_AGE}; SameSite=Lax`;
|
|
12
|
+
}
|
|
13
|
+
function readCookie(name) {
|
|
14
|
+
const match = document.cookie.split("; ").find((row) => row.startsWith(`${name}=`));
|
|
15
|
+
return match ? decodeURIComponent(match.slice(name.length + 1)) : void 0;
|
|
16
|
+
}
|
|
17
|
+
function persistAdClickIdsFromUrl() {
|
|
18
|
+
if (typeof window === "undefined") return;
|
|
19
|
+
const params = new URLSearchParams(window.location.search);
|
|
20
|
+
for (const key of AD_CLICK_ID_KEYS) {
|
|
21
|
+
const value = params.get(key);
|
|
22
|
+
if (value) writeCookie(key, value);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function getAdClickIds() {
|
|
26
|
+
if (typeof window === "undefined") return {};
|
|
27
|
+
const ids = {};
|
|
28
|
+
for (const key of AD_CLICK_ID_KEYS) {
|
|
29
|
+
const value = readCookie(key);
|
|
30
|
+
if (value) ids[key] = value;
|
|
31
|
+
}
|
|
32
|
+
return ids;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.AD_CLICK_ID_KEYS = AD_CLICK_ID_KEYS;
|
|
36
|
+
exports.getAdClickIds = getAdClickIds;
|
|
37
|
+
exports.persistAdClickIdsFromUrl = persistAdClickIdsFromUrl;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* order3000 ad-click attribution — first-party capture of the click identifiers
|
|
3
|
+
* that appear on an ad's landing URL (Google Ads auto-tagging `gclid`/`gbraid`/
|
|
4
|
+
* `wbraid`; Meta `fbclid`). A reservation made later in the session is then
|
|
5
|
+
* attributed to the originating ad click and reported to the ad platform
|
|
6
|
+
* server-side — Google Ads offline conversions and the Meta Conversions API.
|
|
7
|
+
*
|
|
8
|
+
* **Provided by order3000 so every consumer captures attribution identically,
|
|
9
|
+
* without re-implementing this logic.** Wire it in two lines on the restaurant
|
|
10
|
+
* frontend:
|
|
11
|
+
*
|
|
12
|
+
* - call `persistAdClickIdsFromUrl()` once on landing (every page), and
|
|
13
|
+
* - spread `getAdClickIds()` into the `reservations.make(...)` payload on
|
|
14
|
+
* submit.
|
|
15
|
+
*
|
|
16
|
+
* No Google/Meta script is ever loaded — these are plain query params we read
|
|
17
|
+
* ourselves and store in first-party cookies (browser-only; every function is a
|
|
18
|
+
* no-op when `window` is undefined, so it is safe to import in SSR code).
|
|
19
|
+
*/
|
|
20
|
+
/** The ad-click identifiers order3000 captures from a landing URL. */
|
|
21
|
+
declare const AD_CLICK_ID_KEYS: readonly ["gclid", "gbraid", "wbraid", "fbclid"];
|
|
22
|
+
type AdClickIdKey = (typeof AD_CLICK_ID_KEYS)[number];
|
|
23
|
+
type AdClickIds = Partial<Record<AdClickIdKey, string>>;
|
|
24
|
+
/**
|
|
25
|
+
* Read any ad-click ids from the current URL and persist them to first-party
|
|
26
|
+
* cookies. Call once on landing (every page). Only a present id is written, so a
|
|
27
|
+
* later non-ad navigation never clears an earlier attribution.
|
|
28
|
+
*/
|
|
29
|
+
declare function persistAdClickIdsFromUrl(): void;
|
|
30
|
+
/** The persisted ad-click ids, for attaching to a reservation on submit. */
|
|
31
|
+
declare function getAdClickIds(): AdClickIds;
|
|
32
|
+
|
|
33
|
+
export { AD_CLICK_ID_KEYS, getAdClickIds, persistAdClickIdsFromUrl };
|
|
34
|
+
export type { AdClickIdKey, AdClickIds };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* order3000 ad-click attribution — first-party capture of the click identifiers
|
|
3
|
+
* that appear on an ad's landing URL (Google Ads auto-tagging `gclid`/`gbraid`/
|
|
4
|
+
* `wbraid`; Meta `fbclid`). A reservation made later in the session is then
|
|
5
|
+
* attributed to the originating ad click and reported to the ad platform
|
|
6
|
+
* server-side — Google Ads offline conversions and the Meta Conversions API.
|
|
7
|
+
*
|
|
8
|
+
* **Provided by order3000 so every consumer captures attribution identically,
|
|
9
|
+
* without re-implementing this logic.** Wire it in two lines on the restaurant
|
|
10
|
+
* frontend:
|
|
11
|
+
*
|
|
12
|
+
* - call `persistAdClickIdsFromUrl()` once on landing (every page), and
|
|
13
|
+
* - spread `getAdClickIds()` into the `reservations.make(...)` payload on
|
|
14
|
+
* submit.
|
|
15
|
+
*
|
|
16
|
+
* No Google/Meta script is ever loaded — these are plain query params we read
|
|
17
|
+
* ourselves and store in first-party cookies (browser-only; every function is a
|
|
18
|
+
* no-op when `window` is undefined, so it is safe to import in SSR code).
|
|
19
|
+
*/
|
|
20
|
+
/** The ad-click identifiers order3000 captures from a landing URL. */
|
|
21
|
+
declare const AD_CLICK_ID_KEYS: readonly ["gclid", "gbraid", "wbraid", "fbclid"];
|
|
22
|
+
type AdClickIdKey = (typeof AD_CLICK_ID_KEYS)[number];
|
|
23
|
+
type AdClickIds = Partial<Record<AdClickIdKey, string>>;
|
|
24
|
+
/**
|
|
25
|
+
* Read any ad-click ids from the current URL and persist them to first-party
|
|
26
|
+
* cookies. Call once on landing (every page). Only a present id is written, so a
|
|
27
|
+
* later non-ad navigation never clears an earlier attribution.
|
|
28
|
+
*/
|
|
29
|
+
declare function persistAdClickIdsFromUrl(): void;
|
|
30
|
+
/** The persisted ad-click ids, for attaching to a reservation on submit. */
|
|
31
|
+
declare function getAdClickIds(): AdClickIds;
|
|
32
|
+
|
|
33
|
+
export { AD_CLICK_ID_KEYS, getAdClickIds, persistAdClickIdsFromUrl };
|
|
34
|
+
export type { AdClickIdKey, AdClickIds };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const AD_CLICK_ID_KEYS = [
|
|
2
|
+
"gclid",
|
|
3
|
+
"gbraid",
|
|
4
|
+
"wbraid",
|
|
5
|
+
"fbclid"
|
|
6
|
+
];
|
|
7
|
+
const AD_CLICK_COOKIE_MAX_AGE = 90 * 24 * 60 * 60;
|
|
8
|
+
function writeCookie(name, value) {
|
|
9
|
+
document.cookie = `${name}=${encodeURIComponent(value)}; path=/; max-age=${AD_CLICK_COOKIE_MAX_AGE}; SameSite=Lax`;
|
|
10
|
+
}
|
|
11
|
+
function readCookie(name) {
|
|
12
|
+
const match = document.cookie.split("; ").find((row) => row.startsWith(`${name}=`));
|
|
13
|
+
return match ? decodeURIComponent(match.slice(name.length + 1)) : void 0;
|
|
14
|
+
}
|
|
15
|
+
function persistAdClickIdsFromUrl() {
|
|
16
|
+
if (typeof window === "undefined") return;
|
|
17
|
+
const params = new URLSearchParams(window.location.search);
|
|
18
|
+
for (const key of AD_CLICK_ID_KEYS) {
|
|
19
|
+
const value = params.get(key);
|
|
20
|
+
if (value) writeCookie(key, value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function getAdClickIds() {
|
|
24
|
+
if (typeof window === "undefined") return {};
|
|
25
|
+
const ids = {};
|
|
26
|
+
for (const key of AD_CLICK_ID_KEYS) {
|
|
27
|
+
const value = readCookie(key);
|
|
28
|
+
if (value) ids[key] = value;
|
|
29
|
+
}
|
|
30
|
+
return ids;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { AD_CLICK_ID_KEYS, getAdClickIds, persistAdClickIdsFromUrl };
|