@postrun/js 2.3.0 → 2.4.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/index.cjs CHANGED
@@ -1156,6 +1156,7 @@ z__namespace.object({
1156
1156
  "x",
1157
1157
  "linkedin",
1158
1158
  "facebook_page",
1159
+ "instagram",
1159
1160
  "tiktok"
1160
1161
  ])
1161
1162
  });
@@ -2948,6 +2949,13 @@ z__namespace.object({
2948
2949
  got: z__namespace.string().optional(),
2949
2950
  variant_index: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2950
2951
  path: z__namespace.array(z__namespace.union([z__namespace.string(), z__namespace.number()])),
2952
+ platform: z__namespace.enum([
2953
+ "x",
2954
+ "linkedin",
2955
+ "facebook_page",
2956
+ "instagram",
2957
+ "tiktok"
2958
+ ]).optional(),
2951
2959
  display_error: z__namespace.string()
2952
2960
  }))
2953
2961
  });
@@ -6057,6 +6065,10 @@ function tiktokPrivacyLabel(value) {
6057
6065
  }
6058
6066
 
6059
6067
  // src/tiktok-options.ts
6068
+ var TIKTOK_CAPTION_MAX = { video: 2200, photo: 4e3 };
6069
+ function captionMaxFor(postType) {
6070
+ return postType === "video" ? TIKTOK_CAPTION_MAX.video : TIKTOK_CAPTION_MAX.photo;
6071
+ }
6060
6072
  var TIKTOK_MUSIC_CONFIRMATION_URL = "https://www.tiktok.com/legal/page/global/music-usage-confirmation/en";
6061
6073
  var TIKTOK_BRANDED_CONTENT_POLICY_URL = "https://www.tiktok.com/legal/page/global/bc-policy/en";
6062
6074
  var TIKTOK_DISCLOSURE_REQUIRED_HINT = "You need to indicate if your content promotes yourself, a third party, or both.";
@@ -6113,11 +6125,12 @@ function setCommercialDisclosure(value, on) {
6113
6125
  };
6114
6126
  }
6115
6127
  function setBrandKind(value, kind, on) {
6116
- const next = { ...value, [kind]: on };
6117
- if (kind === "branded_content" && on && value.privacy_level === "SELF_ONLY") {
6118
- next.privacy_level = void 0;
6119
- }
6120
- return next;
6128
+ const clearPrivacy = kind === "branded_content" && on && value.privacy_level === "SELF_ONLY";
6129
+ return {
6130
+ ...value,
6131
+ [kind]: on,
6132
+ ...clearPrivacy ? { privacy_level: void 0 } : {}
6133
+ };
6121
6134
  }
6122
6135
  function isInteractionForbidden(info, key) {
6123
6136
  return !info.interaction[key];
@@ -6167,7 +6180,8 @@ function tiktokSettings(value, isVideo) {
6167
6180
  } : base;
6168
6181
  }
6169
6182
  function tiktokOptionsReady(value) {
6170
- return !audienceUnselected(value) && !commercialDisclosureIncomplete(value);
6183
+ const brandedPrivate = discloses(value, "branded_content") && value.privacy_level === "SELF_ONLY";
6184
+ return !audienceUnselected(value) && !commercialDisclosureIncomplete(value) && !brandedPrivate;
6171
6185
  }
6172
6186
 
6173
6187
  // src/compose.ts
@@ -6364,6 +6378,7 @@ exports.POST_PLATFORMS = POST_PLATFORMS;
6364
6378
  exports.PostrunError = PostrunError;
6365
6379
  exports.TIKTOK_AUDIENCE_REQUIRED_HINT = TIKTOK_AUDIENCE_REQUIRED_HINT;
6366
6380
  exports.TIKTOK_BRANDED_CONTENT_POLICY_URL = TIKTOK_BRANDED_CONTENT_POLICY_URL;
6381
+ exports.TIKTOK_CAPTION_MAX = TIKTOK_CAPTION_MAX;
6367
6382
  exports.TIKTOK_DISCLOSURE_REQUIRED_HINT = TIKTOK_DISCLOSURE_REQUIRED_HINT;
6368
6383
  exports.TIKTOK_MUSIC_CONFIRMATION_URL = TIKTOK_MUSIC_CONFIRMATION_URL;
6369
6384
  exports.TIKTOK_PROCESSING_NOTICE = TIKTOK_PROCESSING_NOTICE;
@@ -6372,6 +6387,7 @@ exports.audienceUnselected = audienceUnselected;
6372
6387
  exports.brandedContentDeclared = brandedContentDeclared;
6373
6388
  exports.buildCreatePost = buildCreatePost;
6374
6389
  exports.buildUpdatePost = buildUpdatePost;
6390
+ exports.captionMaxFor = captionMaxFor;
6375
6391
  exports.commercialDisclosureIncomplete = commercialDisclosureIncomplete;
6376
6392
  exports.commercialLabelNotice = commercialLabelNotice;
6377
6393
  exports.connectionsConnect = connectionsConnect;