@getlatedev/node 0.2.474 → 0.2.475

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.d.mts CHANGED
@@ -24698,13 +24698,13 @@ type CreateAdCampaignData = {
24698
24698
  goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales';
24699
24699
  specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
24700
24700
  /**
24701
- * Campaign-level (CBO) budget in whole currency units. Requires budgetType.
24701
+ * Campaign-level (CBO) budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Requires budgetType.
24702
24702
  */
24703
24703
  budgetAmount?: number;
24704
24704
  budgetType?: 'daily' | 'lifetime';
24705
24705
  status?: 'ACTIVE' | 'PAUSED';
24706
24706
  /**
24707
- * Campaign bid strategy. Meta puts `bid_strategy` where the budget lives, so this applies only alongside a campaign budget (CBO). Previously settable only via `PUT /v1/ads/campaigns/{campaignId}`.
24707
+ * Campaign bid strategy. Meta stores `bid_strategy` alongside the budget, so this REQUIRES `budgetAmount` + `budgetType` on the same request; sending it without a campaign budget is a 400. A campaign carrying a strategy without its `bid_amount` makes every ad set created under it fail with an error that names the ad set (code 100, subcode 1815857), so the bad state is rejected up front rather than accepted. To bid at ad-set level, set the strategy there instead.
24708
24708
  */
24709
24709
  bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
24710
24710
  /**
@@ -24821,6 +24821,10 @@ type UpdateAdCampaignError = (unknown | {
24821
24821
  type DeleteAdCampaignData = {
24822
24822
  body: {
24823
24823
  platform: 'facebook' | 'instagram';
24824
+ /**
24825
+ * Zernio SocialAccount id owning the ad account. Required only to delete an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
24826
+ */
24827
+ accountId?: string;
24824
24828
  };
24825
24829
  path: {
24826
24830
  /**
@@ -27061,7 +27065,7 @@ type CreateStandaloneAdData = {
27061
27065
  */
27062
27066
  validateOnly?: boolean;
27063
27067
  /**
27064
- * Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
27068
+ * Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
27065
27069
  */
27066
27070
  budgetAmount?: number;
27067
27071
  /**
@@ -27499,7 +27503,7 @@ type CreateStandaloneAdData = {
27499
27503
  callToAction?: string;
27500
27504
  }>;
27501
27505
  /**
27502
- * Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own.
27506
+ * Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own. Must NOT also appear as an entry in `translations`.
27503
27507
  */
27504
27508
  defaultLocale?: string;
27505
27509
  /**
@@ -27508,9 +27512,28 @@ type CreateStandaloneAdData = {
27508
27512
  * Manager. Keeps social proof (likes/comments/shares) on a SINGLE post instead of
27509
27513
  * splitting it across one ad per language.
27510
27514
  *
27511
- * The ad's top-level copy and media are the DEFAULT every unlisted locale falls back
27512
- * to, and a variant inherits any field it omits, so send only what differs per
27513
- * language. Media shared across languages is uploaded once.
27515
+ * The ad's top-level copy is the DEFAULT shown to every locale you do NOT list,
27516
+ * and it counts as one of the language variants.
27517
+ *
27518
+ * IMPORTANT, and the opposite of what you might expect: text does NOT inherit.
27519
+ * Every entry must carry its own `headline`, `body` AND `description`, and all of
27520
+ * them must be DISTINCT from each other and from the ad's top-level copy. Meta
27521
+ * deduplicates identical strings inside the asset feed, so two locales sharing a
27522
+ * string collapse into one asset and the create fails with a misleading "Too few
27523
+ * ... texts provided in asset creation" (subcode 1885817) that names a field which
27524
+ * is actually present. We validate this before calling Meta and return a 400
27525
+ * naming the offending locale and field. `description` is therefore effectively
27526
+ * required on the ad whenever `translations` is present, even though it is
27527
+ * optional otherwise.
27528
+ *
27529
+ * Do NOT list `defaultLocale` inside `translations`: Meta rejects the duplicate
27530
+ * with "The language asset feed includes an unsupported targeting field"
27531
+ * (subcode 1885985).
27532
+ *
27533
+ * Media DOES inherit and is uploaded once when shared. Note that Meta enforces
27534
+ * Dynamic Creative image dimensions on language feeds, so an `imageUrl` that
27535
+ * works on a normal ad may be rejected with "The following images have invalid
27536
+ * dimensions for Dynamic Creative" (subcode 1885558). Video is not affected.
27514
27537
  *
27515
27538
  * Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards` and
27516
27539
  * `existingCreativeId` — Meta allows one `asset_feed_spec` shape per creative.
@@ -27522,17 +27545,17 @@ type CreateStandaloneAdData = {
27522
27545
  */
27523
27546
  locale: string;
27524
27547
  /**
27525
- * Headline for this language. Inherits the top-level `headline` when omitted.
27548
+ * Headline for this language. REQUIRED, and must differ from every other locale and from the ad's top-level headline.
27526
27549
  */
27527
- headline?: string;
27550
+ headline: string;
27528
27551
  /**
27529
- * Primary text for this language. Inherits the top-level `body` when omitted.
27552
+ * Primary text for this language. REQUIRED, and must differ from every other locale and from the ad's top-level body.
27530
27553
  */
27531
- body?: string;
27554
+ body: string;
27532
27555
  /**
27533
- * Link description for this language. Inherits the top-level `description` when omitted.
27556
+ * Link description for this language. REQUIRED, and must differ from every other locale and from the ad's top-level description.
27534
27557
  */
27535
- description?: string;
27558
+ description: string;
27536
27559
  /**
27537
27560
  * Image for this language. Inherits the ad's `imageUrl` when omitted. The feed is all-image OR all-video.
27538
27561
  */
package/dist/index.d.ts CHANGED
@@ -24698,13 +24698,13 @@ type CreateAdCampaignData = {
24698
24698
  goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales';
24699
24699
  specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
24700
24700
  /**
24701
- * Campaign-level (CBO) budget in whole currency units. Requires budgetType.
24701
+ * Campaign-level (CBO) budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Requires budgetType.
24702
24702
  */
24703
24703
  budgetAmount?: number;
24704
24704
  budgetType?: 'daily' | 'lifetime';
24705
24705
  status?: 'ACTIVE' | 'PAUSED';
24706
24706
  /**
24707
- * Campaign bid strategy. Meta puts `bid_strategy` where the budget lives, so this applies only alongside a campaign budget (CBO). Previously settable only via `PUT /v1/ads/campaigns/{campaignId}`.
24707
+ * Campaign bid strategy. Meta stores `bid_strategy` alongside the budget, so this REQUIRES `budgetAmount` + `budgetType` on the same request; sending it without a campaign budget is a 400. A campaign carrying a strategy without its `bid_amount` makes every ad set created under it fail with an error that names the ad set (code 100, subcode 1815857), so the bad state is rejected up front rather than accepted. To bid at ad-set level, set the strategy there instead.
24708
24708
  */
24709
24709
  bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
24710
24710
  /**
@@ -24821,6 +24821,10 @@ type UpdateAdCampaignError = (unknown | {
24821
24821
  type DeleteAdCampaignData = {
24822
24822
  body: {
24823
24823
  platform: 'facebook' | 'instagram';
24824
+ /**
24825
+ * Zernio SocialAccount id owning the ad account. Required only to delete an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
24826
+ */
24827
+ accountId?: string;
24824
24828
  };
24825
24829
  path: {
24826
24830
  /**
@@ -27061,7 +27065,7 @@ type CreateStandaloneAdData = {
27061
27065
  */
27062
27066
  validateOnly?: boolean;
27063
27067
  /**
27064
- * Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
27068
+ * Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
27065
27069
  */
27066
27070
  budgetAmount?: number;
27067
27071
  /**
@@ -27499,7 +27503,7 @@ type CreateStandaloneAdData = {
27499
27503
  callToAction?: string;
27500
27504
  }>;
27501
27505
  /**
27502
- * Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own.
27506
+ * Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own. Must NOT also appear as an entry in `translations`.
27503
27507
  */
27504
27508
  defaultLocale?: string;
27505
27509
  /**
@@ -27508,9 +27512,28 @@ type CreateStandaloneAdData = {
27508
27512
  * Manager. Keeps social proof (likes/comments/shares) on a SINGLE post instead of
27509
27513
  * splitting it across one ad per language.
27510
27514
  *
27511
- * The ad's top-level copy and media are the DEFAULT every unlisted locale falls back
27512
- * to, and a variant inherits any field it omits, so send only what differs per
27513
- * language. Media shared across languages is uploaded once.
27515
+ * The ad's top-level copy is the DEFAULT shown to every locale you do NOT list,
27516
+ * and it counts as one of the language variants.
27517
+ *
27518
+ * IMPORTANT, and the opposite of what you might expect: text does NOT inherit.
27519
+ * Every entry must carry its own `headline`, `body` AND `description`, and all of
27520
+ * them must be DISTINCT from each other and from the ad's top-level copy. Meta
27521
+ * deduplicates identical strings inside the asset feed, so two locales sharing a
27522
+ * string collapse into one asset and the create fails with a misleading "Too few
27523
+ * ... texts provided in asset creation" (subcode 1885817) that names a field which
27524
+ * is actually present. We validate this before calling Meta and return a 400
27525
+ * naming the offending locale and field. `description` is therefore effectively
27526
+ * required on the ad whenever `translations` is present, even though it is
27527
+ * optional otherwise.
27528
+ *
27529
+ * Do NOT list `defaultLocale` inside `translations`: Meta rejects the duplicate
27530
+ * with "The language asset feed includes an unsupported targeting field"
27531
+ * (subcode 1885985).
27532
+ *
27533
+ * Media DOES inherit and is uploaded once when shared. Note that Meta enforces
27534
+ * Dynamic Creative image dimensions on language feeds, so an `imageUrl` that
27535
+ * works on a normal ad may be rejected with "The following images have invalid
27536
+ * dimensions for Dynamic Creative" (subcode 1885558). Video is not affected.
27514
27537
  *
27515
27538
  * Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards` and
27516
27539
  * `existingCreativeId` — Meta allows one `asset_feed_spec` shape per creative.
@@ -27522,17 +27545,17 @@ type CreateStandaloneAdData = {
27522
27545
  */
27523
27546
  locale: string;
27524
27547
  /**
27525
- * Headline for this language. Inherits the top-level `headline` when omitted.
27548
+ * Headline for this language. REQUIRED, and must differ from every other locale and from the ad's top-level headline.
27526
27549
  */
27527
- headline?: string;
27550
+ headline: string;
27528
27551
  /**
27529
- * Primary text for this language. Inherits the top-level `body` when omitted.
27552
+ * Primary text for this language. REQUIRED, and must differ from every other locale and from the ad's top-level body.
27530
27553
  */
27531
- body?: string;
27554
+ body: string;
27532
27555
  /**
27533
- * Link description for this language. Inherits the top-level `description` when omitted.
27556
+ * Link description for this language. REQUIRED, and must differ from every other locale and from the ad's top-level description.
27534
27557
  */
27535
- description?: string;
27558
+ description: string;
27536
27559
  /**
27537
27560
  * Image for this language. Inherits the ad's `imageUrl` when omitted. The feed is all-image OR all-video.
27538
27561
  */
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@getlatedev/node",
39
- version: "0.2.474",
39
+ version: "0.2.475",
40
40
  description: "The official Node.js library for the Zernio API",
41
41
  main: "dist/index.js",
42
42
  module: "dist/index.mjs",
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@getlatedev/node",
8
- version: "0.2.474",
8
+ version: "0.2.475",
9
9
  description: "The official Node.js library for the Zernio API",
10
10
  main: "dist/index.js",
11
11
  module: "dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlatedev/node",
3
- "version": "0.2.474",
3
+ "version": "0.2.475",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -6724,6 +6724,14 @@ export const updateAdCampaign = <ThrowOnError extends boolean = false>(options:
6724
6724
  * Meta-only for now. Other platforms return 501 Not Implemented — fall
6725
6725
  * back to DELETE /v1/ads/{adId} per ad in the meantime.
6726
6726
  *
6727
+ * **Empty campaigns.** A campaign with zero ads has no local Ad documents
6728
+ * to resolve, so it is invisible to `/v1/ads/tree` and this endpoint would
6729
+ * 404. That state is produced by the two-step create flow (campaign, then
6730
+ * ads via `existingCampaignId`) whenever Meta rejects the ad step. To
6731
+ * delete such a shell, send `accountId` in the body: we skip the local
6732
+ * lookup entirely and forward the delete to Meta. `accountId` is ignored
6733
+ * when the campaign does have ads.
6734
+ *
6727
6735
  */
6728
6736
  export const deleteAdCampaign = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteAdCampaignData, ThrowOnError>) => {
6729
6737
  return (options?.client ?? client).delete<DeleteAdCampaignResponse, DeleteAdCampaignError, ThrowOnError>({
@@ -25077,13 +25077,13 @@ export type CreateAdCampaignData = {
25077
25077
  goal: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'lead_conversion' | 'job_applicants' | 'conversions' | 'app_promotion' | 'catalog_sales';
25078
25078
  specialAdCategories?: Array<('HOUSING' | 'EMPLOYMENT' | 'CREDIT' | 'ISSUES_ELECTIONS_POLITICS' | 'FINANCIAL_PRODUCTS_SERVICES' | 'ONLINE_GAMBLING_AND_GAMING')>;
25079
25079
  /**
25080
- * Campaign-level (CBO) budget in whole currency units. Requires budgetType.
25080
+ * Campaign-level (CBO) budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Requires budgetType.
25081
25081
  */
25082
25082
  budgetAmount?: number;
25083
25083
  budgetType?: 'daily' | 'lifetime';
25084
25084
  status?: 'ACTIVE' | 'PAUSED';
25085
25085
  /**
25086
- * Campaign bid strategy. Meta puts `bid_strategy` where the budget lives, so this applies only alongside a campaign budget (CBO). Previously settable only via `PUT /v1/ads/campaigns/{campaignId}`.
25086
+ * Campaign bid strategy. Meta stores `bid_strategy` alongside the budget, so this REQUIRES `budgetAmount` + `budgetType` on the same request; sending it without a campaign budget is a 400. A campaign carrying a strategy without its `bid_amount` makes every ad set created under it fail with an error that names the ad set (code 100, subcode 1815857), so the bad state is rejected up front rather than accepted. To bid at ad-set level, set the strategy there instead.
25087
25087
  */
25088
25088
  bidStrategy?: 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS';
25089
25089
  /**
@@ -25209,6 +25209,10 @@ export type UpdateAdCampaignError = (unknown | {
25209
25209
  export type DeleteAdCampaignData = {
25210
25210
  body: {
25211
25211
  platform: 'facebook' | 'instagram';
25212
+ /**
25213
+ * Zernio SocialAccount id owning the ad account. Required only to delete an EMPTY campaign (zero ads), which has no local Ad documents to resolve a token from.
25214
+ */
25215
+ accountId?: string;
25212
25216
  };
25213
25217
  path: {
25214
25218
  /**
@@ -27590,7 +27594,7 @@ export type CreateStandaloneAdData = {
27590
27594
  */
27591
27595
  validateOnly?: boolean;
27592
27596
  /**
27593
- * Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
27597
+ * Budget in WHOLE currency units (USD: 50 = $50.00), NOT cents — Meta's own Marketing API takes this same number in minor units, so it is an easy and expensive mix-up. Required on legacy + multi-creative shapes. Inherited on attach. OpenAI Ads requires a $1 minimum (its budget is lifetime-only, see budgetType).
27594
27598
  */
27595
27599
  budgetAmount?: number;
27596
27600
  /**
@@ -28028,7 +28032,7 @@ export type CreateStandaloneAdData = {
28028
28032
  callToAction?: string;
28029
28033
  }>;
28030
28034
  /**
28031
- * Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own.
28035
+ * Meta only. Language the top-level copy is written in (e.g. `en`, `pt_BR`), used by the `translations` default rule. Defaults to `en`. Meta rejects a language asset feed whose default rule carries no locales of its own. Must NOT also appear as an entry in `translations`.
28032
28036
  */
28033
28037
  defaultLocale?: string;
28034
28038
  /**
@@ -28037,9 +28041,28 @@ export type CreateStandaloneAdData = {
28037
28041
  * Manager. Keeps social proof (likes/comments/shares) on a SINGLE post instead of
28038
28042
  * splitting it across one ad per language.
28039
28043
  *
28040
- * The ad's top-level copy and media are the DEFAULT every unlisted locale falls back
28041
- * to, and a variant inherits any field it omits, so send only what differs per
28042
- * language. Media shared across languages is uploaded once.
28044
+ * The ad's top-level copy is the DEFAULT shown to every locale you do NOT list,
28045
+ * and it counts as one of the language variants.
28046
+ *
28047
+ * IMPORTANT, and the opposite of what you might expect: text does NOT inherit.
28048
+ * Every entry must carry its own `headline`, `body` AND `description`, and all of
28049
+ * them must be DISTINCT from each other and from the ad's top-level copy. Meta
28050
+ * deduplicates identical strings inside the asset feed, so two locales sharing a
28051
+ * string collapse into one asset and the create fails with a misleading "Too few
28052
+ * ... texts provided in asset creation" (subcode 1885817) that names a field which
28053
+ * is actually present. We validate this before calling Meta and return a 400
28054
+ * naming the offending locale and field. `description` is therefore effectively
28055
+ * required on the ad whenever `translations` is present, even though it is
28056
+ * optional otherwise.
28057
+ *
28058
+ * Do NOT list `defaultLocale` inside `translations`: Meta rejects the duplicate
28059
+ * with "The language asset feed includes an unsupported targeting field"
28060
+ * (subcode 1885985).
28061
+ *
28062
+ * Media DOES inherit and is uploaded once when shared. Note that Meta enforces
28063
+ * Dynamic Creative image dimensions on language feeds, so an `imageUrl` that
28064
+ * works on a normal ad may be rejected with "The following images have invalid
28065
+ * dimensions for Dynamic Creative" (subcode 1885558). Video is not affected.
28043
28066
  *
28044
28067
  * Mutually exclusive with `dynamicCreative`, `placementAssets`, `carouselCards` and
28045
28068
  * `existingCreativeId` — Meta allows one `asset_feed_spec` shape per creative.
@@ -28051,17 +28074,17 @@ export type CreateStandaloneAdData = {
28051
28074
  */
28052
28075
  locale: string;
28053
28076
  /**
28054
- * Headline for this language. Inherits the top-level `headline` when omitted.
28077
+ * Headline for this language. REQUIRED, and must differ from every other locale and from the ad's top-level headline.
28055
28078
  */
28056
- headline?: string;
28079
+ headline: string;
28057
28080
  /**
28058
- * Primary text for this language. Inherits the top-level `body` when omitted.
28081
+ * Primary text for this language. REQUIRED, and must differ from every other locale and from the ad's top-level body.
28059
28082
  */
28060
- body?: string;
28083
+ body: string;
28061
28084
  /**
28062
- * Link description for this language. Inherits the top-level `description` when omitted.
28085
+ * Link description for this language. REQUIRED, and must differ from every other locale and from the ad's top-level description.
28063
28086
  */
28064
- description?: string;
28087
+ description: string;
28065
28088
  /**
28066
28089
  * Image for this language. Inherits the ad's `imageUrl` when omitted. The feed is all-image OR all-video.
28067
28090
  */