@zernio/node 0.2.925 → 0.2.927

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
@@ -40228,7 +40228,7 @@ type BoostPostData = {
40228
40228
  */
40229
40229
  leadGenFormId?: string;
40230
40230
  /**
40231
- * Meta, TikTok, and LinkedIn. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On Meta a new campaign stays paused until explicitly activated; an attached ad is itself paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40231
+ * Meta, TikTok, LinkedIn, and Google. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On Meta a new campaign stays paused until explicitly activated; an attached ad is itself paused. On Google the pause is held on the campaign the boost creates (ad group and ad switched on), so PUT /v1/ads/campaigns/{campaignId}/status with `active` brings it live. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40232
40232
  */
40233
40233
  status?: 'ACTIVE' | 'PAUSED';
40234
40234
  /**
@@ -40381,11 +40381,11 @@ type CreateStandaloneAdData = {
40381
40381
  */
40382
40382
  budgetType?: 'daily' | 'lifetime';
40383
40383
  /**
40384
- * Google Performance Max accepts PAUSED only and always creates a paused campaign. Google Search and Display, Meta, TikTok, and LinkedIn: publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. Google Search and Display follow the same rule, and because Google keeps an independent switch at campaign, ad group and ad level, a PAUSED create leaves the campaign it creates PAUSED at Google. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40384
+ * Google Performance Max accepts PAUSED only and always creates a paused campaign. Google Search and Display, Meta, TikTok, LinkedIn, and ChatGPT (OpenAI): publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. Google Search and Display follow the same rule, and because Google keeps an independent switch at campaign, ad group and ad level, a PAUSED create leaves the campaign it creates PAUSED at Google. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each). ChatGPT (OpenAI) follows the Meta rule: the pause is held on the campaign this call creates.
40385
40385
  */
40386
40386
  status?: 'ACTIVE' | 'PAUSED';
40387
40387
  /**
40388
- * Meta and Google. Overrides `status` for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows `status`.
40388
+ * Meta, Google, and ChatGPT (OpenAI). Overrides `status` for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows `status`.
40389
40389
  */
40390
40390
  campaignStatus?: 'ACTIVE' | 'PAUSED';
40391
40391
  /**
@@ -43980,6 +43980,12 @@ type CreateMessagingAdData = {
43980
43980
  */
43981
43981
  destinations?: Array<('whatsapp' | 'messenger' | 'instagram_direct')>;
43982
43982
  });
43983
+ headers?: {
43984
+ /**
43985
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
43986
+ */
43987
+ 'Idempotency-Key'?: string;
43988
+ };
43983
43989
  };
43984
43990
  type CreateMessagingAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
43985
43991
  type CreateMessagingAdError = (unknown | {
@@ -43996,6 +44002,12 @@ type CreateCallAdData = {
43996
44002
  */
43997
44003
  linkUrl: string;
43998
44004
  });
44005
+ headers?: {
44006
+ /**
44007
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
44008
+ */
44009
+ 'Idempotency-Key'?: string;
44010
+ };
43999
44011
  };
44000
44012
  type CreateCallAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
44001
44013
  type CreateCallAdError = (unknown | {
@@ -44003,6 +44015,12 @@ type CreateCallAdError = (unknown | {
44003
44015
  } | ErrorResponse);
44004
44016
  type CreateCtwaAdData = {
44005
44017
  body: CtwaAdRequestBody;
44018
+ headers?: {
44019
+ /**
44020
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
44021
+ */
44022
+ 'Idempotency-Key'?: string;
44023
+ };
44006
44024
  };
44007
44025
  type CreateCtwaAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
44008
44026
  type CreateCtwaAdError = (unknown | {
package/dist/index.d.ts CHANGED
@@ -40228,7 +40228,7 @@ type BoostPostData = {
40228
40228
  */
40229
40229
  leadGenFormId?: string;
40230
40230
  /**
40231
- * Meta, TikTok, and LinkedIn. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On Meta a new campaign stays paused until explicitly activated; an attached ad is itself paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40231
+ * Meta, TikTok, LinkedIn, and Google. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On Meta a new campaign stays paused until explicitly activated; an attached ad is itself paused. On Google the pause is held on the campaign the boost creates (ad group and ad switched on), so PUT /v1/ads/campaigns/{campaignId}/status with `active` brings it live. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40232
40232
  */
40233
40233
  status?: 'ACTIVE' | 'PAUSED';
40234
40234
  /**
@@ -40381,11 +40381,11 @@ type CreateStandaloneAdData = {
40381
40381
  */
40382
40382
  budgetType?: 'daily' | 'lifetime';
40383
40383
  /**
40384
- * Google Performance Max accepts PAUSED only and always creates a paused campaign. Google Search and Display, Meta, TikTok, and LinkedIn: publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. Google Search and Display follow the same rule, and because Google keeps an independent switch at campaign, ad group and ad level, a PAUSED create leaves the campaign it creates PAUSED at Google. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40384
+ * Google Performance Max accepts PAUSED only and always creates a paused campaign. Google Search and Display, Meta, TikTok, LinkedIn, and ChatGPT (OpenAI): publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. Google Search and Display follow the same rule, and because Google keeps an independent switch at campaign, ad group and ad level, a PAUSED create leaves the campaign it creates PAUSED at Google. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each). ChatGPT (OpenAI) follows the Meta rule: the pause is held on the campaign this call creates.
40385
40385
  */
40386
40386
  status?: 'ACTIVE' | 'PAUSED';
40387
40387
  /**
40388
- * Meta and Google. Overrides `status` for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows `status`.
40388
+ * Meta, Google, and ChatGPT (OpenAI). Overrides `status` for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows `status`.
40389
40389
  */
40390
40390
  campaignStatus?: 'ACTIVE' | 'PAUSED';
40391
40391
  /**
@@ -43980,6 +43980,12 @@ type CreateMessagingAdData = {
43980
43980
  */
43981
43981
  destinations?: Array<('whatsapp' | 'messenger' | 'instagram_direct')>;
43982
43982
  });
43983
+ headers?: {
43984
+ /**
43985
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
43986
+ */
43987
+ 'Idempotency-Key'?: string;
43988
+ };
43983
43989
  };
43984
43990
  type CreateMessagingAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
43985
43991
  type CreateMessagingAdError = (unknown | {
@@ -43996,6 +44002,12 @@ type CreateCallAdData = {
43996
44002
  */
43997
44003
  linkUrl: string;
43998
44004
  });
44005
+ headers?: {
44006
+ /**
44007
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
44008
+ */
44009
+ 'Idempotency-Key'?: string;
44010
+ };
43999
44011
  };
44000
44012
  type CreateCallAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
44001
44013
  type CreateCallAdError = (unknown | {
@@ -44003,6 +44015,12 @@ type CreateCallAdError = (unknown | {
44003
44015
  } | ErrorResponse);
44004
44016
  type CreateCtwaAdData = {
44005
44017
  body: CtwaAdRequestBody;
44018
+ headers?: {
44019
+ /**
44020
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
44021
+ */
44022
+ 'Idempotency-Key'?: string;
44023
+ };
44006
44024
  };
44007
44025
  type CreateCtwaAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
44008
44026
  type CreateCtwaAdError = (unknown | {
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.925",
39
+ version: "0.2.927",
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.925",
8
+ version: "0.2.927",
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.925",
3
+ "version": "0.2.927",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -11944,6 +11944,8 @@ export const sendWhatsAppConversion = <ThrowOnError extends boolean = false>(opt
11944
11944
  * a number already paired with the Page (WhatsApp destination only).
11945
11945
  * `accountId` is a Facebook, Instagram or Meta ads (business login) connection;
11946
11946
  * `pageId` picks the Page when that connection was granted several.
11947
+ *
11948
+ * **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
11947
11949
  */
11948
11950
  export const createMessagingAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateMessagingAdData, ThrowOnError>) => {
11949
11951
  return (options?.client ?? client).post<CreateMessagingAdResponse, CreateMessagingAdError, ThrowOnError>({
@@ -11958,6 +11960,8 @@ export const createMessagingAd = <ThrowOnError extends boolean = false>(options:
11958
11960
  * via a tel: link. The ad set is destination_type PHONE_CALL optimizing QUALITY_CALL
11959
11961
  * and the campaign objective defaults to OUTCOME_LEADS.
11960
11962
  * Supports the same single-creative and multi-creative shapes as CTWA.
11963
+ *
11964
+ * **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
11961
11965
  */
11962
11966
  export const createCallAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateCallAdData, ThrowOnError>) => {
11963
11967
  return (options?.client ?? client).post<CreateCallAdResponse, CreateCallAdError, ThrowOnError>({
@@ -11986,6 +11990,8 @@ export const createCallAd = <ThrowOnError extends boolean = false>(options: Opti
11986
11990
  * `existingPostId`) or `objectStoryId`, either per creative or at the top level. Omit fresh
11987
11991
  * media and copy for that creative. Optional `whatsappPhoneNumber` selects
11988
11992
  * a number already paired with the Page (WhatsApp destination only).
11993
+ *
11994
+ * **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
11989
11995
  */
11990
11996
  export const createCtwaAd = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateCtwaAdData, ThrowOnError>) => {
11991
11997
  return (options?.client ?? client).post<CreateCtwaAdResponse, CreateCtwaAdError, ThrowOnError>({
@@ -40880,7 +40880,7 @@ export type BoostPostData = {
40880
40880
  */
40881
40881
  leadGenFormId?: string;
40882
40882
  /**
40883
- * Meta, TikTok, and LinkedIn. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On Meta a new campaign stays paused until explicitly activated; an attached ad is itself paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40883
+ * Meta, TikTok, LinkedIn, and Google. Publish state of the created entities. Omitted or ACTIVE publishes live (default); PAUSED creates them paused so you can review before they spend. On Meta a new campaign stays paused until explicitly activated; an attached ad is itself paused. On Google the pause is held on the campaign the boost creates (ad group and ad switched on), so PUT /v1/ads/campaigns/{campaignId}/status with `active` brings it live. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
40884
40884
  */
40885
40885
  status?: 'ACTIVE' | 'PAUSED';
40886
40886
  /**
@@ -41039,11 +41039,11 @@ export type CreateStandaloneAdData = {
41039
41039
  */
41040
41040
  budgetType?: 'daily' | 'lifetime';
41041
41041
  /**
41042
- * Google Performance Max accepts PAUSED only and always creates a paused campaign. Google Search and Display, Meta, TikTok, and LinkedIn: publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. Google Search and Display follow the same rule, and because Google keeps an independent switch at campaign, ad group and ad level, a PAUSED create leaves the campaign it creates PAUSED at Google. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each).
41042
+ * Google Performance Max accepts PAUSED only and always creates a paused campaign. Google Search and Display, Meta, TikTok, LinkedIn, and ChatGPT (OpenAI): publish state of the created entities. Omitted or ACTIVE publishes live (default, back-compat); PAUSED creates them paused so you can review before they spend. On Meta the pause is held on the campaign this call creates, leaving the ad set and ad switched on, so a single PUT /v1/ads/campaigns/{campaignId}/status with `active` brings the whole thing live. It is held at every level instead when the pause cannot rely on the campaign: `existingCampaignId` (that campaign may be running and is never touched) or `campaignStatus: ACTIVE`. Google Search and Display follow the same rule, and because Google keeps an independent switch at campaign, ad group and ad level, a PAUSED create leaves the campaign it creates PAUSED at Google. On TikTok the whole campaign > ad group > ad hierarchy stays paused. On LinkedIn the whole campaign group, campaign, and creative hierarchy stays PAUSED (intendedStatus PAUSED on each). ChatGPT (OpenAI) follows the Meta rule: the pause is held on the campaign this call creates.
41043
41043
  */
41044
41044
  status?: 'ACTIVE' | 'PAUSED';
41045
41045
  /**
41046
- * Meta and Google. Overrides `status` for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows `status`.
41046
+ * Meta, Google, and ChatGPT (OpenAI). Overrides `status` for the campaign level alone, so you can create a live campaign whose ad set and ad stay paused, or the reverse. Omitted, it follows `status`.
41047
41047
  */
41048
41048
  campaignStatus?: 'ACTIVE' | 'PAUSED';
41049
41049
  /**
@@ -44824,6 +44824,12 @@ export type CreateMessagingAdData = {
44824
44824
  */
44825
44825
  destinations?: Array<('whatsapp' | 'messenger' | 'instagram_direct')>;
44826
44826
  });
44827
+ headers?: {
44828
+ /**
44829
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
44830
+ */
44831
+ 'Idempotency-Key'?: string;
44832
+ };
44827
44833
  };
44828
44834
 
44829
44835
  export type CreateMessagingAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
@@ -44843,6 +44849,12 @@ export type CreateCallAdData = {
44843
44849
  */
44844
44850
  linkUrl: string;
44845
44851
  });
44852
+ headers?: {
44853
+ /**
44854
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
44855
+ */
44856
+ 'Idempotency-Key'?: string;
44857
+ };
44846
44858
  };
44847
44859
 
44848
44860
  export type CreateCallAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));
@@ -44853,6 +44865,12 @@ export type CreateCallAdError = (unknown | {
44853
44865
 
44854
44866
  export type CreateCtwaAdData = {
44855
44867
  body: CtwaAdRequestBody;
44868
+ headers?: {
44869
+ /**
44870
+ * Optional client-generated unique key (e.g. a UUID) that makes retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
44871
+ */
44872
+ 'Idempotency-Key'?: string;
44873
+ };
44856
44874
  };
44857
44875
 
44858
44876
  export type CreateCtwaAdResponse = ((CtwaSingleResponse | CtwaMultiResponse));