@optima-chat/browser-cli 0.12.0 → 0.13.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.
Files changed (2) hide show
  1. package/dist/index.js +32 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1136,10 +1136,39 @@ function registerRecipeCommands(program2) {
1136
1136
  process.exit(1);
1137
1137
  }
1138
1138
  });
1139
+ program2.command("publish-video-global").description("Publish one shoppable video to a TikTok Shop CROSS-BORDER store (one region per run)").requiredOption("--ziniao-profile <id>", "ZiNiao browser profile ID").requiredOption("--video <name>", "Video file name (from list-videos)").requiredOption("--account <username>", "Publishing account username; it also picks the region (one region per run)").requiredOption("--product-query <keyword>", "Product search keyword or product ID, narrow enough to hit exactly one product (ask the user)").requiredOption(
1140
+ "--product-name <text>",
1141
+ "Display name on the video: max 30 chars, letters/digits/spaces only (ask the user)"
1142
+ ).requiredOption("--caption <text>", "Video caption").option("--dry-run", "Fill everything, run the pre-publish checks, then STOP before clicking publish (nothing is published; the browser window stays open for you to inspect)").option("--hashtags <text>", "Comma-separated hashtags, bare words (the page adds the # itself)").option("--publish-url <url>", "Video publish page URL (include the right ?shop_region=)").action(async (opts) => {
1143
+ try {
1144
+ const params = {
1145
+ ziniao_profile_id: opts.ziniaoProfile,
1146
+ video: opts.video,
1147
+ account: opts.account,
1148
+ product_query: opts.productQuery,
1149
+ product_name: opts.productName,
1150
+ caption: opts.caption
1151
+ };
1152
+ if (opts.dryRun) params.dry_run = "1";
1153
+ if (opts.hashtags) params.hashtags = opts.hashtags;
1154
+ if (opts.publishUrl) params.publish_url = opts.publishUrl;
1155
+ const result = await api.runRecipeScript(
1156
+ "tiktok_video_publish_global",
1157
+ params,
1158
+ 2e3,
1159
+ PUBLISH_TIMEOUT_MS,
1160
+ PUBLISH_TIMEOUT_HINT
1161
+ );
1162
+ console.log(result.detail);
1163
+ } catch (err) {
1164
+ console.error(formatError(err));
1165
+ process.exit(1);
1166
+ }
1167
+ });
1139
1168
  program2.command("publish-video").description("Publish one shoppable video to TikTok Shop").requiredOption("--ziniao-profile <id>", "ZiNiao browser profile ID").requiredOption("--video <name>", "Video file name (from list-videos)").requiredOption("--product-query <keyword>", "Product search keyword, narrow enough to hit exactly one product (ask the user)").requiredOption(
1140
1169
  "--product-name <text>",
1141
1170
  "Display name on the video: max 30 chars, letters/digits/spaces only (ask the user)"
1142
- ).requiredOption("--caption <text>", "Video caption").option("--hashtags <text>", "Comma-separated hashtags").option("--publish-url <url>", "Video publish page URL").action(async (opts) => {
1171
+ ).requiredOption("--caption <text>", "Video caption").option("--account <username>", "Publishing account username (default: the shop's official account; pass a marketing sub-account to post as it)").option("--dry-run", "Fill everything, run the pre-publish checks, then STOP before clicking publish (nothing is published; the browser window stays open for you to inspect)").option("--hashtags <text>", "Comma-separated hashtags, bare words (the page adds the # itself)").option("--publish-url <url>", "Video publish page URL").action(async (opts) => {
1143
1172
  try {
1144
1173
  const params = {
1145
1174
  ziniao_profile_id: opts.ziniaoProfile,
@@ -1148,6 +1177,8 @@ function registerRecipeCommands(program2) {
1148
1177
  product_name: opts.productName,
1149
1178
  caption: opts.caption
1150
1179
  };
1180
+ if (opts.account) params.account = opts.account;
1181
+ if (opts.dryRun) params.dry_run = "1";
1151
1182
  if (opts.hashtags) params.hashtags = opts.hashtags;
1152
1183
  if (opts.publishUrl) params.publish_url = opts.publishUrl;
1153
1184
  const result = await api.runRecipeScript(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/browser-cli",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {