@zernio/node 0.2.957 → 0.2.958

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.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@zernio/node",
39
- version: "0.2.957",
39
+ version: "0.2.958",
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: "@zernio/node",
8
- version: "0.2.957",
8
+ version: "0.2.958",
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": "@zernio/node",
3
- "version": "0.2.957",
3
+ "version": "0.2.958",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -3390,6 +3390,7 @@ export type actionSource = 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 's
3390
3390
  *
3391
3391
  * - Single-creative: `headline`, `body`, and one of `imageUrl` / `video`,
3392
3392
  * OR `platformPostId` / `objectStoryId` to reuse an organic post.
3393
+ * On POST /v1/ads/messaging, `placementAssets` can replace `imageUrl` / `video`.
3393
3394
  * - Multi-creative: a non-empty `creatives[]` array. Top-level
3394
3395
  * creative fields must NOT be set on this shape.
3395
3396
  *
@@ -7268,6 +7269,83 @@ export type MetaLeadForm = {
7268
7269
 
7269
7270
  export type style = 'LIST_STYLE' | 'PARAGRAPH_STYLE';
7270
7271
 
7272
+ /**
7273
+ * Meta placement asset customization: pin a SPECIFIC asset (image OR video) to each
7274
+ * placement group on a SINGLE ad (e.g. a 4:5 image on Feed and a 9:16 image on
7275
+ * Stories/Reels), the same thing Meta Ads Manager produces with "different creative per
7276
+ * placement". Mapped to the creative's `asset_feed_spec` (`optimization_type: PLACEMENT`)
7277
+ * + `asset_customization_rules`. Each rule can pin one `headline`, `body` and `description`;
7278
+ * omitted fields and unmatched placements use the request's top-level copy. Each rule's
7279
+ * `placements` accepts the same fields as the top-level `placements` object; Meta enforces
7280
+ * co-selection rules and returns an actionable error.
7281
+ *
7282
+ * A block is all-image OR all-video, never mixed (Meta's asset_feed_spec carries one ad
7283
+ * format). Image mode: `defaultImageUrl` + `rules[].imageUrl`. Video mode:
7284
+ * `defaultVideoUrl` + `rules[].videoUrl` (optional `thumbnailUrl`/`defaultThumbnailUrl`
7285
+ * posters; Meta auto-generates when omitted). Exactly one catch-all default is required.
7286
+ *
7287
+ * Meta controls text rendering by placement and format. Validation accepts these fields
7288
+ * but does not prove that every field appears in delivery. Preview the ad; put copy that
7289
+ * must always be visible into the image or video itself.
7290
+ *
7291
+ */
7292
+ export type MetaPlacementAssets = {
7293
+ /**
7294
+ * Image mode. Catch-all image for any placement no rule matches. Required in image mode (Meta mandates a default rule).
7295
+ */
7296
+ defaultImageUrl?: string;
7297
+ /**
7298
+ * Video mode. Catch-all video for any placement no rule matches. Required in video mode.
7299
+ */
7300
+ defaultVideoUrl?: string;
7301
+ /**
7302
+ * Video mode (optional). Poster image for the default video; Meta auto-generates one when omitted.
7303
+ */
7304
+ defaultThumbnailUrl?: string;
7305
+ /**
7306
+ * One entry per placement group you want to pin a specific asset to.
7307
+ */
7308
+ rules: Array<{
7309
+ /**
7310
+ * Image mode. The image to deliver for this rule's placements.
7311
+ */
7312
+ imageUrl?: string;
7313
+ /**
7314
+ * Video mode. The video to deliver for this rule's placements.
7315
+ */
7316
+ videoUrl?: string;
7317
+ /**
7318
+ * Video mode (optional). Poster image for this rule's video; auto-generated when omitted.
7319
+ */
7320
+ thumbnailUrl?: string;
7321
+ /**
7322
+ * One headline pinned to this rule. Omit to inherit the top-level headline.
7323
+ */
7324
+ headline?: string;
7325
+ /**
7326
+ * One primary text pinned to this rule. Omit to inherit the top-level body.
7327
+ */
7328
+ body?: string;
7329
+ /**
7330
+ * One link description pinned to this rule. Omit to inherit the top-level description.
7331
+ */
7332
+ description?: string;
7333
+ /**
7334
+ * Placements this asset is pinned to. At least one field must be set (an empty rule is invalid; that role is served by the default asset). Same enums as the top-level `placements` object.
7335
+ */
7336
+ placements: {
7337
+ publisherPlatforms?: Array<('facebook' | 'instagram' | 'threads' | 'messenger' | 'audience_network' | 'whatsapp')>;
7338
+ facebookPositions?: Array<('feed' | 'right_hand_column' | 'marketplace' | 'video_feeds' | 'story' | 'search' | 'instream_video' | 'facebook_reels' | 'facebook_reels_overlay' | 'profile_feed' | 'notification')>;
7339
+ instagramPositions?: Array<('stream' | 'story' | 'explore' | 'explore_home' | 'reels' | 'profile_feed' | 'ig_search' | 'profile_reels')>;
7340
+ messengerPositions?: Array<('messenger_home' | 'sponsored_messages' | 'story')>;
7341
+ audienceNetworkPositions?: Array<('classic' | 'rewarded_video')>;
7342
+ threadsPositions?: Array<('threads_stream')>;
7343
+ whatsappPositions?: Array<('status')>;
7344
+ devicePlatforms?: Array<('mobile' | 'desktop')>;
7345
+ };
7346
+ }>;
7347
+ };
7348
+
7271
7349
  export type MetaProductCatalog = {
7272
7350
  id?: string;
7273
7351
  name?: string;
@@ -43649,62 +43727,7 @@ export type CreateStandaloneAdData = {
43649
43727
  * posters; Meta auto-generates when omitted). Exactly one catch-all default is required.
43650
43728
  *
43651
43729
  */
43652
- placementAssets?: {
43653
- /**
43654
- * Image mode. Catch-all image for any placement no rule matches. Required in image mode (Meta mandates a default rule).
43655
- */
43656
- defaultImageUrl?: string;
43657
- /**
43658
- * Video mode. Catch-all video for any placement no rule matches. Required in video mode.
43659
- */
43660
- defaultVideoUrl?: string;
43661
- /**
43662
- * Video mode (optional). Poster image for the default video; Meta auto-generates one when omitted.
43663
- */
43664
- defaultThumbnailUrl?: string;
43665
- /**
43666
- * One entry per placement group you want to pin a specific asset to.
43667
- */
43668
- rules: Array<{
43669
- /**
43670
- * Image mode. The image to deliver for this rule's placements.
43671
- */
43672
- imageUrl?: string;
43673
- /**
43674
- * Video mode. The video to deliver for this rule's placements.
43675
- */
43676
- videoUrl?: string;
43677
- /**
43678
- * Video mode (optional). Poster image for this rule's video; auto-generated when omitted.
43679
- */
43680
- thumbnailUrl?: string;
43681
- /**
43682
- * One headline pinned to this rule. Omit to inherit the top-level headline.
43683
- */
43684
- headline?: string;
43685
- /**
43686
- * One primary text pinned to this rule. Omit to inherit the top-level body.
43687
- */
43688
- body?: string;
43689
- /**
43690
- * One link description pinned to this rule. Omit to inherit the top-level description.
43691
- */
43692
- description?: string;
43693
- /**
43694
- * Placements this asset is pinned to. At least one field must be set (an empty rule is invalid; that role is served by the default asset). Same enums as the top-level `placements` object.
43695
- */
43696
- placements: {
43697
- publisherPlatforms?: Array<('facebook' | 'instagram' | 'threads' | 'messenger' | 'audience_network' | 'whatsapp')>;
43698
- facebookPositions?: Array<('feed' | 'right_hand_column' | 'marketplace' | 'video_feeds' | 'story' | 'search' | 'instream_video' | 'facebook_reels' | 'facebook_reels_overlay' | 'profile_feed' | 'notification')>;
43699
- instagramPositions?: Array<('stream' | 'story' | 'explore' | 'explore_home' | 'reels' | 'profile_feed' | 'ig_search' | 'profile_reels')>;
43700
- messengerPositions?: Array<('messenger_home' | 'sponsored_messages' | 'story')>;
43701
- audienceNetworkPositions?: Array<('classic' | 'rewarded_video')>;
43702
- threadsPositions?: Array<('threads_stream')>;
43703
- whatsappPositions?: Array<('status')>;
43704
- devicePlatforms?: Array<('mobile' | 'desktop')>;
43705
- };
43706
- }>;
43707
- };
43730
+ placementAssets?: (MetaPlacementAssets);
43708
43731
  /**
43709
43732
  * Custom audience ID for targeting
43710
43733
  */
@@ -47056,6 +47079,25 @@ export type CreateMessagingAdData = {
47056
47079
  * Two or three messaging apps on ONE ad set, like Ads Manager's "all messaging apps": the ad set gets Meta's combined destination_type (e.g. MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP) and the creative one CTA per app, so Meta opens the app each viewer is likeliest to answer from. WhatsApp in the list still needs the Page paired with a WhatsApp Business number. With `adSetId`, the existing ad set must already use that combined destination_type. Set this OR `destination`, not both.
47057
47080
  */
47058
47081
  destinations?: Array<('whatsapp' | 'messenger' | 'instagram_direct')>;
47082
+ /**
47083
+ * A different image or video per placement on one messaging ad, e.g. a 4:5 image on
47084
+ * Feed and a 9:16 image on Stories/Reels. Replaces top-level `imageUrl` / `video`
47085
+ * (sending either alongside is a 400); `headline` and `body` stay required as the
47086
+ * default copy. The CTA, `welcomeMessage` and `whatsappPhoneNumber` apply to every
47087
+ * placement. Works on the single-creative shape and on attach (`adSetId`).
47088
+ *
47089
+ * Single `destination` only: Meta cannot combine per-placement media with
47090
+ * `destinations` (it drops the placement rules from a multi-destination creative, or
47091
+ * refuses more than one call to action per placement rule with error 1885878), so
47092
+ * that combination is a 400. Also a 400 with `creatives[]`, `platformPostId`,
47093
+ * `existingPostId` or `objectStoryId`, and on POST /v1/ads/call.
47094
+ *
47095
+ */
47096
+ placementAssets?: (MetaPlacementAssets);
47097
+ /**
47098
+ * Dry-runs the ad on Meta with execution_options validate_only as ONE inline campaign + ad set + creative + ad (or creative + ad on the existing ad set with `adSetId`). Nothing is uploaded or created and nothing is stored; media is checked by URL. Supports one creative with `imageUrl`, image `placementAssets`, an existing `video.id`, or an existing post. Several creatives, a new `video.url` and video `placementAssets` need uploads first and return 400. Success returns 200 with per-node results; a Meta rejection returns the Meta error.
47099
+ */
47100
+ validateOnly?: boolean;
47059
47101
  });
47060
47102
  headers?: {
47061
47103
  /**
@@ -47065,7 +47107,18 @@ export type CreateMessagingAdData = {
47065
47107
  };
47066
47108
  };
47067
47109
 
47068
- export type CreateMessagingAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
47110
+ export type CreateMessagingAdResponse = ({
47111
+ /**
47112
+ * Always true.
47113
+ */
47114
+ validateOnly: boolean;
47115
+ results: Array<{
47116
+ node: 'campaign' | 'adSet' | 'creative' | 'ad';
47117
+ status: 'validated' | 'skipped';
47118
+ reason?: string;
47119
+ }>;
47120
+ message: string;
47121
+ } | (CtwaSingleResponse | CtwaMultiResponse));
47069
47122
 
47070
47123
  export type CreateMessagingAdError = (unknown | {
47071
47124
  error?: string;