@adkit/cli 1.13.19 → 1.13.20
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/cli.js +16 -10
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1165,7 +1165,7 @@ function isCreateProjectResponse(value) {
|
|
|
1165
1165
|
if (!value || typeof value !== "object") return false;
|
|
1166
1166
|
if (!("projectId" in value) || typeof value.projectId !== "string") return false;
|
|
1167
1167
|
if (!("name" in value) || typeof value.name !== "string") return false;
|
|
1168
|
-
return "website" in value
|
|
1168
|
+
return !("website" in value) || typeof value.website === "string";
|
|
1169
1169
|
}
|
|
1170
1170
|
function mapProjectEntry(project, selectedProject) {
|
|
1171
1171
|
const entry = {
|
|
@@ -1895,7 +1895,7 @@ var ACCOUNT_CONNECT_FLAGS = ["manager"];
|
|
|
1895
1895
|
var ASSET_LIST_FLAGS = ["type", "scope", "scope-id", "raw"];
|
|
1896
1896
|
var ASSET_CREATE_FLAGS = ["type", "text", "sitelink", "header", "value", "description-1", "description-2", "start-date", "end-date", "tracking-url-template", "final-url-suffix", "country-code", "phone-number", "call-conversion-reporting"];
|
|
1897
1897
|
var ASSET_LINK_FLAGS = ["type", "scope", "scope-id", "status"];
|
|
1898
|
-
var MEDIA_UPLOAD_FLAGS = ["file", "url", "base64", "adkit-media", "filename", "content-type", "name"];
|
|
1898
|
+
var MEDIA_UPLOAD_FLAGS = ["file", "url", "base64", "adkit-media", "video-id", "filename", "content-type", "name"];
|
|
1899
1899
|
var CAMPAIGN_LIST_FLAGS = ["status", "limit", "offset"];
|
|
1900
1900
|
var CAMPAIGN_CREATE_FLAGS = ["name", "status", "budget-daily", "campaign-type", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
1901
1901
|
var CAMPAIGN_UPDATE_FLAGS = ["name", "status", "budget-daily", "bid-strategy", "target-cpa", "target-roas", "search-partners", "display-network", "tracking-url-suffix", "countries"];
|
|
@@ -2007,13 +2007,15 @@ function buildGoogleMediaUploadSource(flags) {
|
|
|
2007
2007
|
const url = readSingleFlagValue(flags, "url", "Use one media source per command, or switch to --data for batch upload");
|
|
2008
2008
|
const base64 = readSingleFlagValue(flags, "base64", "Use one media source per command, or switch to --data for batch upload");
|
|
2009
2009
|
const adkitMediaId = readSingleFlagValue(flags, "adkit-media", "Use one media source per command, or switch to --data for batch upload");
|
|
2010
|
+
const videoId = readSingleFlagValue(flags, "video-id", "Use one media source per command, or switch to --data for batch upload");
|
|
2010
2011
|
let sourceCount = 0;
|
|
2011
2012
|
if (filePath) sourceCount += 1;
|
|
2012
2013
|
if (url) sourceCount += 1;
|
|
2013
2014
|
if (base64) sourceCount += 1;
|
|
2014
2015
|
if (adkitMediaId) sourceCount += 1;
|
|
2015
|
-
if (
|
|
2016
|
-
if (sourceCount
|
|
2016
|
+
if (videoId) sourceCount += 1;
|
|
2017
|
+
if (sourceCount === 0) throw new CliError("MISSING_FLAG", "Missing required media source flag", "Use --file, --url, --base64, --adkit-media, or --video-id");
|
|
2018
|
+
if (sourceCount > 1) throw new CliError("INVALID_VALUE", "Use exactly one media source flag", "Use one of --file, --url, --base64, --adkit-media, or --video-id");
|
|
2017
2019
|
const filename = readSingleFlagValue(flags, "filename", "Use one --filename value");
|
|
2018
2020
|
const contentType = readSingleFlagValue(flags, "content-type", "Use one --content-type value");
|
|
2019
2021
|
const name = readSingleFlagValue(flags, "name", "Use one --name value");
|
|
@@ -2041,6 +2043,7 @@ function buildGoogleMediaUploadSource(flags) {
|
|
|
2041
2043
|
if (name) source2.name = name;
|
|
2042
2044
|
return source2;
|
|
2043
2045
|
}
|
|
2046
|
+
if (videoId) return { source: "youtube", videoId, ...name ? { name } : {} };
|
|
2044
2047
|
if (!adkitMediaId) throw new CliError("MISSING_FLAG", "Missing required flag: `--adkit-media`", "Use --adkit-media <studio-media-id>");
|
|
2045
2048
|
const source = { source: "adkit_media", mediaId: adkitMediaId };
|
|
2046
2049
|
if (name) source.name = name;
|
|
@@ -5929,15 +5932,16 @@ Examples:
|
|
|
5929
5932
|
Supported results contain type; unmapped Google categories contain platformType.
|
|
5930
5933
|
Pass type and the bare code into campaign targeting. For country, use {"type":"country","country":"US"}.
|
|
5931
5934
|
AdKit builds the Google resource name.`;
|
|
5932
|
-
var GOOGLE_MEDIA_HELP = `adkit manage google media \u2014 Upload creative media
|
|
5935
|
+
var GOOGLE_MEDIA_HELP = `adkit manage google media \u2014 Upload or register creative media with Google Ads
|
|
5933
5936
|
|
|
5934
|
-
upload Upload an image
|
|
5937
|
+
upload Upload an image or register a YouTube video
|
|
5935
5938
|
|
|
5936
5939
|
Flags:
|
|
5937
5940
|
--file <path> Local image file
|
|
5938
5941
|
--url <url> Public image URL
|
|
5939
5942
|
--base64 <data> Base64 image data
|
|
5940
5943
|
--adkit-media <id> Existing AdKit Studio media ID
|
|
5944
|
+
--video-id <id> Existing YouTube video ID
|
|
5941
5945
|
--filename <name> Required with --base64, optional with --url
|
|
5942
5946
|
--content-type <t> image/jpeg, image/png, or image/gif
|
|
5943
5947
|
--name <name> Google asset name
|
|
@@ -5948,11 +5952,13 @@ Examples:
|
|
|
5948
5952
|
adkit manage google media upload --file ./hero.png --account 1234567890
|
|
5949
5953
|
adkit manage google media upload --url https://example.com/hero.png --account 1234567890
|
|
5950
5954
|
adkit manage google media upload --adkit-media media_123 --account 1234567890
|
|
5955
|
+
adkit manage google media upload --video-id abcdefghijk --name "Product demo" --account 1234567890
|
|
5951
5956
|
|
|
5952
5957
|
Notes:
|
|
5953
|
-
|
|
5958
|
+
videoId: 11-character ID from the YouTube URL.
|
|
5959
|
+
Upload returns assets[].id and assets[].resourceName. Use either value when creating an ad.
|
|
5954
5960
|
Display media roles: marketing_image, square_marketing_image, logo, square_logo.
|
|
5955
|
-
|
|
5961
|
+
YouTube registration does not upload, copy, or re-host the video.`;
|
|
5956
5962
|
var GOOGLE_CONVERSIONS_HELP = `adkit manage google conversions \u2014 Google Ads conversion tracking
|
|
5957
5963
|
|
|
5958
5964
|
upload Upload offline click conversion events
|
|
@@ -8773,8 +8779,8 @@ ${pageInfo}`);
|
|
|
8773
8779
|
break;
|
|
8774
8780
|
}
|
|
8775
8781
|
case "create": {
|
|
8776
|
-
const name =
|
|
8777
|
-
const website =
|
|
8782
|
+
const name = typeof flags.name === "string" ? flags.name : void 0;
|
|
8783
|
+
const website = typeof flags.website === "string" ? flags.website : void 0;
|
|
8778
8784
|
const descriptionValues = collectFlagValues(flags, "description");
|
|
8779
8785
|
const description = descriptionValues.length > 0 ? descriptionValues.join(" ") : void 0;
|
|
8780
8786
|
const tagsFlag = typeof flags.tags === "string" ? flags.tags : void 0;
|
package/package.json
CHANGED