@zernio/node 0.2.80 → 0.2.82

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
@@ -12179,15 +12179,15 @@ type CreateStandaloneAdData = {
12179
12179
  budgetType?: 'daily' | 'lifetime';
12180
12180
  currency?: string;
12181
12181
  /**
12182
- * Required on legacy + attach shapes (skip for multi-creative — use `creatives[].headline`). Max: Meta=255, Google=30, Pinterest=100
12182
+ * Required for Meta, Google, and Pinterest on legacy + attach shapes (skip for multi-creative — use `creatives[].headline`). Ignored for TikTok and X/Twitter. Max: Meta=255, Google=30, Pinterest=100.
12183
12183
  */
12184
12184
  headline?: string;
12185
12185
  /**
12186
- * Google Display only
12186
+ * Google Display only. Defaults to `headline` if omitted.
12187
12187
  */
12188
12188
  longHeadline?: string;
12189
12189
  /**
12190
- * Required on legacy + attach shapes. Max: Google=90, Pinterest=500
12190
+ * Required on legacy + attach shapes. For X/Twitter this is the tweet text (max 280 chars including a ~24-char URL when `linkUrl` is set). Max: Google=90, Pinterest=500.
12191
12191
  */
12192
12192
  body?: string;
12193
12193
  /**
@@ -12199,9 +12199,22 @@ type CreateStandaloneAdData = {
12199
12199
  */
12200
12200
  linkUrl?: string;
12201
12201
  /**
12202
- * Required on legacy + attach shapes. Not required for Google Search campaigns.
12202
+ * Image creative for Meta/Google/Pinterest on legacy + attach shapes (mutually exclusive with `video`). Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the `imageUrl` name for cross-platform consistency). Ignored for X/Twitter.
12203
12203
  */
12204
12204
  imageUrl?: string;
12205
+ /**
12206
+ * Meta only (facebook, instagram). When set, creates a VIDEO ad on the legacy or attach shape. Mutually exclusive with `imageUrl`. For multi-creative, set `video` per entry inside `creatives[]` instead.
12207
+ */
12208
+ video?: {
12209
+ /**
12210
+ * Public URL of the video. Uploaded to Meta via chunked transfer on /act_X/advideos; then the request blocks on Meta's transcoding until status.video_status === 'ready'.
12211
+ */
12212
+ url: string;
12213
+ /**
12214
+ * Public URL of a still-image thumbnail for the video. Required by Meta on every video creative. Uploaded to Meta as an ad image and referenced as the thumbnail in object_story_spec.video_data.
12215
+ */
12216
+ thumbnailUrl: string;
12217
+ };
12205
12218
  /**
12206
12219
  * Meta-only. When present, switches to the multi-creative shape:
12207
12220
  * creates 1 campaign + 1 ad set + N ads (one per entry here).
@@ -12212,7 +12225,17 @@ type CreateStandaloneAdData = {
12212
12225
  creatives?: Array<{
12213
12226
  headline: string;
12214
12227
  body: string;
12215
- imageUrl: string;
12228
+ /**
12229
+ * Image creative. Mutually exclusive with `video`.
12230
+ */
12231
+ imageUrl?: string;
12232
+ /**
12233
+ * Video creative for this entry. Mutually exclusive with `imageUrl`.
12234
+ */
12235
+ video?: {
12236
+ url: string;
12237
+ thumbnailUrl: string;
12238
+ };
12216
12239
  linkUrl: string;
12217
12240
  callToAction: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE';
12218
12241
  }>;
package/dist/index.d.ts CHANGED
@@ -12179,15 +12179,15 @@ type CreateStandaloneAdData = {
12179
12179
  budgetType?: 'daily' | 'lifetime';
12180
12180
  currency?: string;
12181
12181
  /**
12182
- * Required on legacy + attach shapes (skip for multi-creative — use `creatives[].headline`). Max: Meta=255, Google=30, Pinterest=100
12182
+ * Required for Meta, Google, and Pinterest on legacy + attach shapes (skip for multi-creative — use `creatives[].headline`). Ignored for TikTok and X/Twitter. Max: Meta=255, Google=30, Pinterest=100.
12183
12183
  */
12184
12184
  headline?: string;
12185
12185
  /**
12186
- * Google Display only
12186
+ * Google Display only. Defaults to `headline` if omitted.
12187
12187
  */
12188
12188
  longHeadline?: string;
12189
12189
  /**
12190
- * Required on legacy + attach shapes. Max: Google=90, Pinterest=500
12190
+ * Required on legacy + attach shapes. For X/Twitter this is the tweet text (max 280 chars including a ~24-char URL when `linkUrl` is set). Max: Google=90, Pinterest=500.
12191
12191
  */
12192
12192
  body?: string;
12193
12193
  /**
@@ -12199,9 +12199,22 @@ type CreateStandaloneAdData = {
12199
12199
  */
12200
12200
  linkUrl?: string;
12201
12201
  /**
12202
- * Required on legacy + attach shapes. Not required for Google Search campaigns.
12202
+ * Image creative for Meta/Google/Pinterest on legacy + attach shapes (mutually exclusive with `video`). Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the `imageUrl` name for cross-platform consistency). Ignored for X/Twitter.
12203
12203
  */
12204
12204
  imageUrl?: string;
12205
+ /**
12206
+ * Meta only (facebook, instagram). When set, creates a VIDEO ad on the legacy or attach shape. Mutually exclusive with `imageUrl`. For multi-creative, set `video` per entry inside `creatives[]` instead.
12207
+ */
12208
+ video?: {
12209
+ /**
12210
+ * Public URL of the video. Uploaded to Meta via chunked transfer on /act_X/advideos; then the request blocks on Meta's transcoding until status.video_status === 'ready'.
12211
+ */
12212
+ url: string;
12213
+ /**
12214
+ * Public URL of a still-image thumbnail for the video. Required by Meta on every video creative. Uploaded to Meta as an ad image and referenced as the thumbnail in object_story_spec.video_data.
12215
+ */
12216
+ thumbnailUrl: string;
12217
+ };
12205
12218
  /**
12206
12219
  * Meta-only. When present, switches to the multi-creative shape:
12207
12220
  * creates 1 campaign + 1 ad set + N ads (one per entry here).
@@ -12212,7 +12225,17 @@ type CreateStandaloneAdData = {
12212
12225
  creatives?: Array<{
12213
12226
  headline: string;
12214
12227
  body: string;
12215
- imageUrl: string;
12228
+ /**
12229
+ * Image creative. Mutually exclusive with `video`.
12230
+ */
12231
+ imageUrl?: string;
12232
+ /**
12233
+ * Video creative for this entry. Mutually exclusive with `imageUrl`.
12234
+ */
12235
+ video?: {
12236
+ url: string;
12237
+ thumbnailUrl: string;
12238
+ };
12216
12239
  linkUrl: string;
12217
12240
  callToAction: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE';
12218
12241
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.80",
3
+ "version": "0.2.82",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -2238,6 +2238,8 @@ export const releaseWhatsAppPhoneNumber = <ThrowOnError extends boolean = false>
2238
2238
  * List active WhatsApp group chats for a business phone number.
2239
2239
  * These are actual WhatsApp group conversations on the platform.
2240
2240
  *
2241
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2242
+ *
2241
2243
  */
2242
2244
  export const listWhatsAppGroupChats = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListWhatsAppGroupChatsData, ThrowOnError>) => {
2243
2245
  return (options?.client ?? client).get<ListWhatsAppGroupChatsResponse, ListWhatsAppGroupChatsError, ThrowOnError>({
@@ -2250,6 +2252,8 @@ export const listWhatsAppGroupChats = <ThrowOnError extends boolean = false>(opt
2250
2252
  * Create group
2251
2253
  * Create a new WhatsApp group chat. Returns the group ID and optionally an invite link.
2252
2254
  *
2255
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2256
+ *
2253
2257
  */
2254
2258
  export const createWhatsAppGroupChat = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWhatsAppGroupChatData, ThrowOnError>) => {
2255
2259
  return (options?.client ?? client).post<CreateWhatsAppGroupChatResponse, CreateWhatsAppGroupChatError, ThrowOnError>({
@@ -2263,6 +2267,8 @@ export const createWhatsAppGroupChat = <ThrowOnError extends boolean = false>(op
2263
2267
  * Retrieve metadata about a WhatsApp group including subject, description,
2264
2268
  * participants, and settings.
2265
2269
  *
2270
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2271
+ *
2266
2272
  */
2267
2273
  export const getWhatsAppGroupChat = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetWhatsAppGroupChatData, ThrowOnError>) => {
2268
2274
  return (options?.client ?? client).get<GetWhatsAppGroupChatResponse, GetWhatsAppGroupChatError, ThrowOnError>({
@@ -2275,6 +2281,8 @@ export const getWhatsAppGroupChat = <ThrowOnError extends boolean = false>(optio
2275
2281
  * Update group settings
2276
2282
  * Update the subject, description, or join approval mode of a WhatsApp group.
2277
2283
  *
2284
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2285
+ *
2278
2286
  */
2279
2287
  export const updateWhatsAppGroupChat = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateWhatsAppGroupChatData, ThrowOnError>) => {
2280
2288
  return (options?.client ?? client).post<UpdateWhatsAppGroupChatResponse, UpdateWhatsAppGroupChatError, ThrowOnError>({
@@ -2287,6 +2295,8 @@ export const updateWhatsAppGroupChat = <ThrowOnError extends boolean = false>(op
2287
2295
  * Delete group
2288
2296
  * Delete a WhatsApp group and remove all participants.
2289
2297
  *
2298
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2299
+ *
2290
2300
  */
2291
2301
  export const deleteWhatsAppGroupChat = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DeleteWhatsAppGroupChatData, ThrowOnError>) => {
2292
2302
  return (options?.client ?? client).delete<DeleteWhatsAppGroupChatResponse, DeleteWhatsAppGroupChatError, ThrowOnError>({
@@ -2299,6 +2309,8 @@ export const deleteWhatsAppGroupChat = <ThrowOnError extends boolean = false>(op
2299
2309
  * Add participants
2300
2310
  * Add participants to a WhatsApp group. Maximum 8 participants per request.
2301
2311
  *
2312
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2313
+ *
2302
2314
  */
2303
2315
  export const addWhatsAppGroupParticipants = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<AddWhatsAppGroupParticipantsData, ThrowOnError>) => {
2304
2316
  return (options?.client ?? client).post<AddWhatsAppGroupParticipantsResponse, AddWhatsAppGroupParticipantsError, ThrowOnError>({
@@ -2311,6 +2323,8 @@ export const addWhatsAppGroupParticipants = <ThrowOnError extends boolean = fals
2311
2323
  * Remove participants
2312
2324
  * Remove participants from a WhatsApp group.
2313
2325
  *
2326
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2327
+ *
2314
2328
  */
2315
2329
  export const removeWhatsAppGroupParticipants = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RemoveWhatsAppGroupParticipantsData, ThrowOnError>) => {
2316
2330
  return (options?.client ?? client).delete<RemoveWhatsAppGroupParticipantsResponse, RemoveWhatsAppGroupParticipantsError, ThrowOnError>({
@@ -2323,6 +2337,8 @@ export const removeWhatsAppGroupParticipants = <ThrowOnError extends boolean = f
2323
2337
  * Create invite link
2324
2338
  * Create a new invite link for a WhatsApp group. The previous link is revoked.
2325
2339
  *
2340
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2341
+ *
2326
2342
  */
2327
2343
  export const createWhatsAppGroupInviteLink = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateWhatsAppGroupInviteLinkData, ThrowOnError>) => {
2328
2344
  return (options?.client ?? client).post<CreateWhatsAppGroupInviteLinkResponse, CreateWhatsAppGroupInviteLinkError, ThrowOnError>({
@@ -2335,6 +2351,8 @@ export const createWhatsAppGroupInviteLink = <ThrowOnError extends boolean = fal
2335
2351
  * List join requests
2336
2352
  * List pending join requests for a WhatsApp group (only for groups with approval_required mode).
2337
2353
  *
2354
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2355
+ *
2338
2356
  */
2339
2357
  export const listWhatsAppGroupJoinRequests = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListWhatsAppGroupJoinRequestsData, ThrowOnError>) => {
2340
2358
  return (options?.client ?? client).get<ListWhatsAppGroupJoinRequestsResponse, ListWhatsAppGroupJoinRequestsError, ThrowOnError>({
@@ -2347,6 +2365,8 @@ export const listWhatsAppGroupJoinRequests = <ThrowOnError extends boolean = fal
2347
2365
  * Approve join requests
2348
2366
  * Approve pending join requests for a WhatsApp group.
2349
2367
  *
2368
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2369
+ *
2350
2370
  */
2351
2371
  export const approveWhatsAppGroupJoinRequests = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ApproveWhatsAppGroupJoinRequestsData, ThrowOnError>) => {
2352
2372
  return (options?.client ?? client).post<ApproveWhatsAppGroupJoinRequestsResponse, ApproveWhatsAppGroupJoinRequestsError, ThrowOnError>({
@@ -2359,6 +2379,8 @@ export const approveWhatsAppGroupJoinRequests = <ThrowOnError extends boolean =
2359
2379
  * Reject join requests
2360
2380
  * Reject pending join requests for a WhatsApp group.
2361
2381
  *
2382
+ * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number.
2383
+ *
2362
2384
  */
2363
2385
  export const rejectWhatsAppGroupJoinRequests = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RejectWhatsAppGroupJoinRequestsData, ThrowOnError>) => {
2364
2386
  return (options?.client ?? client).delete<RejectWhatsAppGroupJoinRequestsResponse, RejectWhatsAppGroupJoinRequestsError, ThrowOnError>({
@@ -3166,6 +3188,18 @@ export const boostPost = <ThrowOnError extends boolean = false>(options: Options
3166
3188
  *
3167
3189
  * `creatives[]` and `adSetId` are mutually exclusive; specifying both returns 400.
3168
3190
  *
3191
+ * **Per-platform required fields** (the platform is inferred from `accountId`):
3192
+ * - **Meta (facebook, instagram)**: `accountId`, `adAccountId`, `name`, `goal`, `budgetAmount`, `budgetType`, `headline`, `body`, `imageUrl`, `linkUrl`, `callToAction`.
3193
+ * - **Google Ads (Display)**: `accountId`, `adAccountId`, `name`, `goal`, `budgetAmount`, `budgetType`, `headline`, `body`, `linkUrl`, `imageUrl`, `businessName`. `longHeadline` defaults to `headline` if omitted (max 90 chars).
3194
+ * - **Google Ads (Search)**: `accountId`, `adAccountId`, `name`, `goal`, `budgetAmount`, `budgetType`, `headline`, `body`, `linkUrl`, `businessName`. `imageUrl` is NOT required for Search. Set `campaignType: "search"`.
3195
+ * - **TikTok**: `accountId`, `adAccountId`, `name`, `goal`, `budgetAmount`, `budgetType`, `body`, `linkUrl`, `imageUrl` (this field **carries the VIDEO URL** for TikTok; the TikTok ads endpoint is video-only and the field is named `imageUrl` for cross-platform consistency).
3196
+ * - **Pinterest**: `accountId`, `adAccountId`, `name`, `goal`, `budgetAmount`, `budgetType`, `headline`, `body`, `imageUrl`, `linkUrl`. Optional `boardId` (auto-creates "Zernio Ads" board if omitted).
3197
+ * - **X / Twitter**: `accountId` (the posting account, internally resolved to the linked X Ads credential), `adAccountId`, `name`, `goal`, `budgetAmount`, `budgetType`, `body` (the tweet text, max 280 chars with `linkUrl` adding ~24). `headline`, `imageUrl`, `callToAction`, and targeting fields are ignored. Requires a connected X Ads account (`/v1/connect/twitter/ads`); otherwise 422.
3198
+ *
3199
+ * **Budget minimums** are enforced per platform in USD: TikTok=$20, Pinterest=$5, all others=$1. If you pass `currency` other than USD, this minimum is currently still evaluated as USD. Pass the ad account's native currency on every request so Meta-side amount conversion is correct.
3200
+ *
3201
+ * **Video ads (Meta only).** Meta (facebook, instagram) supports video creatives on all three shapes (legacy, multi-creative via `creatives[].video`, attach). Set `video: { url, thumbnailUrl }` at the request root (for legacy/attach) or per-entry inside `creatives[]` (for multi-creative). `video` and `imageUrl` are mutually exclusive per creative; supply exactly one. `video.thumbnailUrl` is required because Meta requires a thumbnail on every video creative. The video is uploaded to Meta via chunked transfer and the request blocks on Meta's transcoding (`status.video_status === 'ready'`). This path can take several minutes for longer videos; this endpoint is configured with `maxDuration = 800` on Vercel (13 min) to cover it, but your HTTP client should allow for the same. If transcoding hasn't finished within 10 minutes, the request fails with a `platform_error`. Video on non-Meta platforms is NOT supported here: TikTok uses its own flow (pass the video URL via `imageUrl`); other platforms are image-only.
3202
+ *
3169
3203
  */
3170
3204
  export const createStandaloneAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateStandaloneAdData, ThrowOnError>) => {
3171
3205
  return (options?.client ?? client).post<CreateStandaloneAdResponse, CreateStandaloneAdError, ThrowOnError>({
@@ -12489,15 +12489,15 @@ export type CreateStandaloneAdData = {
12489
12489
  budgetType?: 'daily' | 'lifetime';
12490
12490
  currency?: string;
12491
12491
  /**
12492
- * Required on legacy + attach shapes (skip for multi-creative — use `creatives[].headline`). Max: Meta=255, Google=30, Pinterest=100
12492
+ * Required for Meta, Google, and Pinterest on legacy + attach shapes (skip for multi-creative — use `creatives[].headline`). Ignored for TikTok and X/Twitter. Max: Meta=255, Google=30, Pinterest=100.
12493
12493
  */
12494
12494
  headline?: string;
12495
12495
  /**
12496
- * Google Display only
12496
+ * Google Display only. Defaults to `headline` if omitted.
12497
12497
  */
12498
12498
  longHeadline?: string;
12499
12499
  /**
12500
- * Required on legacy + attach shapes. Max: Google=90, Pinterest=500
12500
+ * Required on legacy + attach shapes. For X/Twitter this is the tweet text (max 280 chars including a ~24-char URL when `linkUrl` is set). Max: Google=90, Pinterest=500.
12501
12501
  */
12502
12502
  body?: string;
12503
12503
  /**
@@ -12509,9 +12509,22 @@ export type CreateStandaloneAdData = {
12509
12509
  */
12510
12510
  linkUrl?: string;
12511
12511
  /**
12512
- * Required on legacy + attach shapes. Not required for Google Search campaigns.
12512
+ * Image creative for Meta/Google/Pinterest on legacy + attach shapes (mutually exclusive with `video`). Not required for Google Search campaigns. For TikTok, this field carries the VIDEO URL (the TikTok ads endpoint is video-only; the field retains the `imageUrl` name for cross-platform consistency). Ignored for X/Twitter.
12513
12513
  */
12514
12514
  imageUrl?: string;
12515
+ /**
12516
+ * Meta only (facebook, instagram). When set, creates a VIDEO ad on the legacy or attach shape. Mutually exclusive with `imageUrl`. For multi-creative, set `video` per entry inside `creatives[]` instead.
12517
+ */
12518
+ video?: {
12519
+ /**
12520
+ * Public URL of the video. Uploaded to Meta via chunked transfer on /act_X/advideos; then the request blocks on Meta's transcoding until status.video_status === 'ready'.
12521
+ */
12522
+ url: string;
12523
+ /**
12524
+ * Public URL of a still-image thumbnail for the video. Required by Meta on every video creative. Uploaded to Meta as an ad image and referenced as the thumbnail in object_story_spec.video_data.
12525
+ */
12526
+ thumbnailUrl: string;
12527
+ };
12515
12528
  /**
12516
12529
  * Meta-only. When present, switches to the multi-creative shape:
12517
12530
  * creates 1 campaign + 1 ad set + N ads (one per entry here).
@@ -12522,7 +12535,17 @@ export type CreateStandaloneAdData = {
12522
12535
  creatives?: Array<{
12523
12536
  headline: string;
12524
12537
  body: string;
12525
- imageUrl: string;
12538
+ /**
12539
+ * Image creative. Mutually exclusive with `video`.
12540
+ */
12541
+ imageUrl?: string;
12542
+ /**
12543
+ * Video creative for this entry. Mutually exclusive with `imageUrl`.
12544
+ */
12545
+ video?: {
12546
+ url: string;
12547
+ thumbnailUrl: string;
12548
+ };
12526
12549
  linkUrl: string;
12527
12550
  callToAction: 'LEARN_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'BOOK_TRAVEL' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'SUBSCRIBE' | 'WATCH_MORE';
12528
12551
  }>;