@postrun/js 2.25.0 → 3.0.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.
@@ -79,7 +79,6 @@ var zErrorCode = z__namespace.enum([
79
79
  "content_missing",
80
80
  "content_conflict",
81
81
  "content_incomplete",
82
- "content_kind_mismatch",
83
82
  "media_type_mismatch",
84
83
  "tag_limit_exceeded",
85
84
  "reel_field_on_non_reel",
@@ -439,12 +438,6 @@ var zTikTokPrivacyLevel = z__namespace.enum([
439
438
  var zPostVariant = z__namespace.union([
440
439
  z__namespace.object({
441
440
  platform: z__namespace.literal("x"),
442
- post_type: z__namespace.enum([
443
- "text",
444
- "single_image",
445
- "multi_image",
446
- "video"
447
- ]),
448
441
  settings: z__namespace.object({
449
442
  reply_settings: z__namespace.enum([
450
443
  "everyone",
@@ -479,6 +472,7 @@ var zPostVariant = z__namespace.union([
479
472
  }),
480
473
  id: z__namespace.string(),
481
474
  object: z__namespace.literal("post_variant"),
475
+ post_type: zPostType.nullable(),
482
476
  connection_id: z__namespace.string().nullable(),
483
477
  body: z__namespace.string().nullable(),
484
478
  status: zPostVariantStatus,
@@ -545,7 +539,6 @@ var zPostVariant = z__namespace.union([
545
539
  "content_missing",
546
540
  "content_conflict",
547
541
  "content_incomplete",
548
- "content_kind_mismatch",
549
542
  "media_type_mismatch",
550
543
  "tag_limit_exceeded",
551
544
  "reel_field_on_non_reel",
@@ -629,23 +622,8 @@ var zPostVariant = z__namespace.union([
629
622
  }),
630
623
  z__namespace.object({
631
624
  platform: z__namespace.literal("linkedin"),
632
- post_type: z__namespace.enum([
633
- "text",
634
- "single_image",
635
- "multi_image",
636
- "video"
637
- ]),
638
625
  settings: z__namespace.object({
639
626
  visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
640
- content_kind: z__namespace.enum([
641
- "text",
642
- "single_image",
643
- "video",
644
- "multi_image",
645
- "document",
646
- "article",
647
- "poll"
648
- ]),
649
627
  article: z__namespace.object({
650
628
  source: z__namespace.url(),
651
629
  title: z__namespace.string().max(400).optional(),
@@ -674,6 +652,7 @@ var zPostVariant = z__namespace.union([
674
652
  }),
675
653
  id: z__namespace.string(),
676
654
  object: z__namespace.literal("post_variant"),
655
+ post_type: zPostType.nullable(),
677
656
  connection_id: z__namespace.string().nullable(),
678
657
  body: z__namespace.string().nullable(),
679
658
  status: zPostVariantStatus,
@@ -740,7 +719,6 @@ var zPostVariant = z__namespace.union([
740
719
  "content_missing",
741
720
  "content_conflict",
742
721
  "content_incomplete",
743
- "content_kind_mismatch",
744
722
  "media_type_mismatch",
745
723
  "tag_limit_exceeded",
746
724
  "reel_field_on_non_reel",
@@ -820,21 +798,25 @@ var zPostVariant = z__namespace.union([
820
798
  position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
821
799
  alt_text_override: z__namespace.string().nullable(),
822
800
  media: zMedia
823
- }))
824
- }),
825
- z__namespace.object({
826
- platform: z__namespace.literal("facebook_page"),
827
- post_type: z__namespace.enum([
801
+ })),
802
+ content_kind: z__namespace.enum([
828
803
  "text",
829
804
  "single_image",
805
+ "video",
830
806
  "multi_image",
831
- "reel"
832
- ]),
807
+ "document",
808
+ "article",
809
+ "poll"
810
+ ]).nullable()
811
+ }),
812
+ z__namespace.object({
813
+ platform: z__namespace.literal("facebook_page"),
833
814
  settings: z__namespace.object({
834
815
  link: z__namespace.url().optional()
835
816
  }),
836
817
  id: z__namespace.string(),
837
818
  object: z__namespace.literal("post_variant"),
819
+ post_type: zPostType.nullable(),
838
820
  connection_id: z__namespace.string().nullable(),
839
821
  body: z__namespace.string().nullable(),
840
822
  status: zPostVariantStatus,
@@ -901,7 +883,6 @@ var zPostVariant = z__namespace.union([
901
883
  "content_missing",
902
884
  "content_conflict",
903
885
  "content_incomplete",
904
- "content_kind_mismatch",
905
886
  "media_type_mismatch",
906
887
  "tag_limit_exceeded",
907
888
  "reel_field_on_non_reel",
@@ -985,17 +966,7 @@ var zPostVariant = z__namespace.union([
985
966
  }),
986
967
  z__namespace.object({
987
968
  platform: z__namespace.literal("instagram"),
988
- post_type: z__namespace.enum([
989
- "single_image",
990
- "carousel",
991
- "reel"
992
- ]),
993
969
  settings: z__namespace.object({
994
- media_type: z__namespace.enum([
995
- "IMAGE",
996
- "CAROUSEL",
997
- "REELS"
998
- ]).optional(),
999
970
  location_id: z__namespace.string().optional(),
1000
971
  user_tags: z__namespace.array(z__namespace.object({
1001
972
  username: z__namespace.string().min(1),
@@ -1010,6 +981,7 @@ var zPostVariant = z__namespace.union([
1010
981
  }),
1011
982
  id: z__namespace.string(),
1012
983
  object: z__namespace.literal("post_variant"),
984
+ post_type: zPostType.nullable(),
1013
985
  connection_id: z__namespace.string().nullable(),
1014
986
  body: z__namespace.string().nullable(),
1015
987
  status: zPostVariantStatus,
@@ -1076,7 +1048,6 @@ var zPostVariant = z__namespace.union([
1076
1048
  "content_missing",
1077
1049
  "content_conflict",
1078
1050
  "content_incomplete",
1079
- "content_kind_mismatch",
1080
1051
  "media_type_mismatch",
1081
1052
  "tag_limit_exceeded",
1082
1053
  "reel_field_on_non_reel",
@@ -1156,15 +1127,15 @@ var zPostVariant = z__namespace.union([
1156
1127
  position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
1157
1128
  alt_text_override: z__namespace.string().nullable(),
1158
1129
  media: zMedia
1159
- }))
1130
+ })),
1131
+ media_type: z__namespace.enum([
1132
+ "IMAGE",
1133
+ "CAROUSEL",
1134
+ "REELS"
1135
+ ]).nullable()
1160
1136
  }),
1161
1137
  z__namespace.object({
1162
1138
  platform: z__namespace.literal("tiktok"),
1163
- post_type: z__namespace.enum([
1164
- "video",
1165
- "single_image",
1166
- "carousel"
1167
- ]),
1168
1139
  settings: z__namespace.object({
1169
1140
  privacy_level: zTikTokPrivacyLevel.optional(),
1170
1141
  disable_comment: z__namespace.boolean().optional(),
@@ -1179,6 +1150,7 @@ var zPostVariant = z__namespace.union([
1179
1150
  }),
1180
1151
  id: z__namespace.string(),
1181
1152
  object: z__namespace.literal("post_variant"),
1153
+ post_type: zPostType.nullable(),
1182
1154
  connection_id: z__namespace.string().nullable(),
1183
1155
  body: z__namespace.string().nullable(),
1184
1156
  status: zPostVariantStatus,
@@ -1245,7 +1217,6 @@ var zPostVariant = z__namespace.union([
1245
1217
  "content_missing",
1246
1218
  "content_conflict",
1247
1219
  "content_incomplete",
1248
- "content_kind_mismatch",
1249
1220
  "media_type_mismatch",
1250
1221
  "tag_limit_exceeded",
1251
1222
  "reel_field_on_non_reel",
@@ -1370,12 +1341,6 @@ var zTikTokCreatorInfo = z__namespace.object({
1370
1341
  var zPostVariantInput = z__namespace.union([
1371
1342
  z__namespace.object({
1372
1343
  platform: z__namespace.literal("x"),
1373
- post_type: z__namespace.enum([
1374
- "text",
1375
- "single_image",
1376
- "multi_image",
1377
- "video"
1378
- ]),
1379
1344
  settings: z__namespace.object({
1380
1345
  reply_settings: z__namespace.enum([
1381
1346
  "everyone",
@@ -1417,23 +1382,8 @@ var zPostVariantInput = z__namespace.union([
1417
1382
  }),
1418
1383
  z__namespace.object({
1419
1384
  platform: z__namespace.literal("linkedin"),
1420
- post_type: z__namespace.enum([
1421
- "text",
1422
- "single_image",
1423
- "multi_image",
1424
- "video"
1425
- ]),
1426
1385
  settings: z__namespace.object({
1427
1386
  visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
1428
- content_kind: z__namespace.enum([
1429
- "text",
1430
- "single_image",
1431
- "video",
1432
- "multi_image",
1433
- "document",
1434
- "article",
1435
- "poll"
1436
- ]),
1437
1387
  article: z__namespace.object({
1438
1388
  source: z__namespace.url(),
1439
1389
  title: z__namespace.string().max(400).optional(),
@@ -1469,17 +1419,7 @@ var zPostVariantInput = z__namespace.union([
1469
1419
  }),
1470
1420
  z__namespace.object({
1471
1421
  platform: z__namespace.literal("instagram"),
1472
- post_type: z__namespace.enum([
1473
- "single_image",
1474
- "carousel",
1475
- "reel"
1476
- ]),
1477
1422
  settings: z__namespace.object({
1478
- media_type: z__namespace.enum([
1479
- "IMAGE",
1480
- "CAROUSEL",
1481
- "REELS"
1482
- ]).optional(),
1483
1423
  location_id: z__namespace.string().optional(),
1484
1424
  user_tags: z__namespace.array(z__namespace.object({
1485
1425
  username: z__namespace.string().min(1),
@@ -1501,12 +1441,6 @@ var zPostVariantInput = z__namespace.union([
1501
1441
  }),
1502
1442
  z__namespace.object({
1503
1443
  platform: z__namespace.literal("facebook_page"),
1504
- post_type: z__namespace.enum([
1505
- "text",
1506
- "single_image",
1507
- "multi_image",
1508
- "reel"
1509
- ]),
1510
1444
  settings: z__namespace.object({
1511
1445
  link: z__namespace.url().optional()
1512
1446
  }).optional().default({}),
@@ -1519,11 +1453,6 @@ var zPostVariantInput = z__namespace.union([
1519
1453
  }),
1520
1454
  z__namespace.object({
1521
1455
  platform: z__namespace.literal("tiktok"),
1522
- post_type: z__namespace.enum([
1523
- "video",
1524
- "single_image",
1525
- "carousel"
1526
- ]),
1527
1456
  settings: z__namespace.object({
1528
1457
  privacy_level: zTikTokPrivacyLevel.optional(),
1529
1458
  disable_comment: z__namespace.boolean().optional(),
@@ -1551,7 +1480,7 @@ var zCreatePostBody = z__namespace.object({
1551
1480
  "schedule",
1552
1481
  "draft"
1553
1482
  ]).optional().default("draft"),
1554
- schedule_at: z__namespace.iso.datetime().optional(),
1483
+ schedule_at: z__namespace.iso.datetime({ offset: true }).optional(),
1555
1484
  external_id: z__namespace.string().min(1).max(255).optional(),
1556
1485
  metadata: z__namespace.record(z__namespace.string(), z__namespace.union([
1557
1486
  z__namespace.string().max(500),
@@ -2218,7 +2147,7 @@ var zGoogleAdsConversionUserIdentifier = z__namespace.object({
2218
2147
  }).optional()
2219
2148
  });
2220
2149
  var zGoogleAdsConversionEvent = z__namespace.object({
2221
- event_timestamp: z__namespace.iso.datetime(),
2150
+ event_timestamp: z__namespace.iso.datetime({ offset: true }),
2222
2151
  event_source: z__namespace.enum([
2223
2152
  "WEB",
2224
2153
  "APP",
@@ -2301,7 +2230,6 @@ var zGoogleAdsConversionStatusReason = z__namespace.object({
2301
2230
  "content_missing",
2302
2231
  "content_conflict",
2303
2232
  "content_incomplete",
2304
- "content_kind_mismatch",
2305
2233
  "media_type_mismatch",
2306
2234
  "tag_limit_exceeded",
2307
2235
  "reel_field_on_non_reel",
@@ -2808,9 +2736,9 @@ var zPostsListQuery = z__namespace.object({
2808
2736
  z__namespace.number(),
2809
2737
  z__namespace.boolean()
2810
2738
  ])).optional(),
2811
- scheduled_after: z__namespace.iso.datetime().optional(),
2812
- scheduled_before: z__namespace.iso.datetime().optional(),
2813
- updated_after: z__namespace.iso.datetime().optional(),
2739
+ scheduled_after: z__namespace.iso.datetime({ offset: true }).optional(),
2740
+ scheduled_before: z__namespace.iso.datetime({ offset: true }).optional(),
2741
+ updated_after: z__namespace.iso.datetime({ offset: true }).optional(),
2814
2742
  status: z__namespace.array(zPostStatus).optional()
2815
2743
  });
2816
2744
  var zPostsListResponse = z__namespace.object({
@@ -2870,7 +2798,7 @@ var zPostsUpdateBody = z__namespace.object({
2870
2798
  "schedule",
2871
2799
  "draft"
2872
2800
  ]).optional(),
2873
- schedule_at: z__namespace.iso.datetime().nullish(),
2801
+ schedule_at: z__namespace.iso.datetime({ offset: true }).nullish(),
2874
2802
  external_id: z__namespace.string().min(1).max(255).nullish(),
2875
2803
  metadata: z__namespace.record(z__namespace.string(), z__namespace.union([
2876
2804
  z__namespace.string().max(500),
@@ -2979,7 +2907,6 @@ var zPostsValidateResponse = z__namespace.object({
2979
2907
  "content_missing",
2980
2908
  "content_conflict",
2981
2909
  "content_incomplete",
2982
- "content_kind_mismatch",
2983
2910
  "media_type_mismatch",
2984
2911
  "tag_limit_exceeded",
2985
2912
  "reel_field_on_non_reel",
@@ -4573,8 +4500,8 @@ var zLogsListQuery = z__namespace.object({
4573
4500
  "scheduler"
4574
4501
  ]).optional(),
4575
4502
  action: z__namespace.string().min(1).optional(),
4576
- created_after: z__namespace.iso.datetime().optional(),
4577
- created_before: z__namespace.iso.datetime().optional()
4503
+ created_after: z__namespace.iso.datetime({ offset: true }).optional(),
4504
+ created_before: z__namespace.iso.datetime({ offset: true }).optional()
4578
4505
  });
4579
4506
  var zLogsListResponse = z__namespace.object({
4580
4507
  object: z__namespace.literal("list"),
@@ -4664,7 +4591,6 @@ var zLogsListResponse = z__namespace.object({
4664
4591
  "content_missing",
4665
4592
  "content_conflict",
4666
4593
  "content_incomplete",
4667
- "content_kind_mismatch",
4668
4594
  "media_type_mismatch",
4669
4595
  "tag_limit_exceeded",
4670
4596
  "reel_field_on_non_reel",
@@ -4824,7 +4750,6 @@ var zLogsListResponse = z__namespace.object({
4824
4750
  "content_missing",
4825
4751
  "content_conflict",
4826
4752
  "content_incomplete",
4827
- "content_kind_mismatch",
4828
4753
  "media_type_mismatch",
4829
4754
  "tag_limit_exceeded",
4830
4755
  "reel_field_on_non_reel",
@@ -5005,7 +4930,6 @@ var zLogsGetResponse = z__namespace.object({
5005
4930
  "content_missing",
5006
4931
  "content_conflict",
5007
4932
  "content_incomplete",
5008
- "content_kind_mismatch",
5009
4933
  "media_type_mismatch",
5010
4934
  "tag_limit_exceeded",
5011
4935
  "reel_field_on_non_reel",
@@ -5165,7 +5089,6 @@ var zLogsGetResponse = z__namespace.object({
5165
5089
  "content_missing",
5166
5090
  "content_conflict",
5167
5091
  "content_incomplete",
5168
- "content_kind_mismatch",
5169
5092
  "media_type_mismatch",
5170
5093
  "tag_limit_exceeded",
5171
5094
  "reel_field_on_non_reel",
@@ -5384,6 +5307,30 @@ var zTokensMintResponse = z__namespace.object({
5384
5307
  expires_at: z__namespace.string()
5385
5308
  });
5386
5309
 
5310
+ // src/schemas/conversions.ts
5311
+ var conversionEventSchema = zGoogleAdsConversionEvent.superRefine(
5312
+ (event, ctx) => {
5313
+ const hasMatchSignal = event.gclid != null || event.gbraid != null || event.wbraid != null || event.user_data != null && event.user_data.length > 0;
5314
+ if (!hasMatchSignal) {
5315
+ ctx.addIssue({
5316
+ code: "custom",
5317
+ message: "Each conversion needs at least one match signal: a gclid, gbraid, wbraid, or user_data."
5318
+ });
5319
+ }
5320
+ event.user_data?.forEach((identifier, index) => {
5321
+ const hasIdentifier = identifier.email_address != null || identifier.phone_number != null || identifier.address != null;
5322
+ if (!hasIdentifier) {
5323
+ ctx.addIssue({
5324
+ code: "custom",
5325
+ path: ["user_data", index],
5326
+ message: "Provide an email_address, phone_number, or address."
5327
+ });
5328
+ }
5329
+ });
5330
+ }
5331
+ );
5332
+
5333
+ exports.conversionEventSchema = conversionEventSchema;
5387
5334
  exports.zConnectSession = zConnectSession;
5388
5335
  exports.zConnection = zConnection;
5389
5336
  exports.zConnectionKind = zConnectionKind;