@zernio/node 0.2.1506 → 0.2.1508
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 +61 -4
- package/dist/index.d.ts +61 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/generated/types.gen.ts +61 -3
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.
|
|
39
|
+
version: "0.2.1508",
|
|
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.
|
|
8
|
+
version: "0.2.1508",
|
|
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
|
@@ -7292,6 +7292,13 @@ export type CreatorPortalSubmission = {
|
|
|
7292
7292
|
*
|
|
7293
7293
|
*/
|
|
7294
7294
|
export type CtwaAdRequestBody = {
|
|
7295
|
+
/**
|
|
7296
|
+
* When Meta answers a create with a 5xx and reading the parent back by name finds no such object, Zernio sends the create again (at most 3 POSTs per object, never for an object created ACTIVE) and reports it in `recoveredWrites`.
|
|
7297
|
+
*
|
|
7298
|
+
* `false` never sends it again: the request fails with 502 and `details.unconfirmedWrite`, so you can check the parent yourself. One object found by name is still reused.
|
|
7299
|
+
*
|
|
7300
|
+
*/
|
|
7301
|
+
retryOnServerError?: boolean;
|
|
7295
7302
|
/**
|
|
7296
7303
|
* Meta enhancement settings for single or attached ads, and defaults for creatives[]. An item replaces the entire map, including with an empty object.
|
|
7297
7304
|
*/
|
|
@@ -8024,6 +8031,7 @@ export type CtwaMultiResponse = {
|
|
|
8024
8031
|
platformCampaignId: string;
|
|
8025
8032
|
platformAdSetId: string;
|
|
8026
8033
|
message: string;
|
|
8034
|
+
recoveredWrites?: MetaRecoveredWrites;
|
|
8027
8035
|
/**
|
|
8028
8036
|
* Present when Meta created the ad set differently from the request:
|
|
8029
8037
|
*
|
|
@@ -8052,6 +8060,7 @@ export type CtwaSingleResponse = {
|
|
|
8052
8060
|
[key: string]: unknown;
|
|
8053
8061
|
};
|
|
8054
8062
|
message: string;
|
|
8063
|
+
recoveredWrites?: MetaRecoveredWrites;
|
|
8055
8064
|
/**
|
|
8056
8065
|
* Present when Meta created the ad set differently from the request:
|
|
8057
8066
|
*
|
|
@@ -8601,7 +8610,7 @@ export type ErrorResponse = {
|
|
|
8601
8610
|
* **Failed Meta ad create** (`POST /v1/ads/create`, `POST /v1/ads/boost`, `POST /v1/ads/ctwa`). Carries `stage` (where it failed), `adAccountId` (on which ad account) and `createdObjects` (every object this request had already created, with what cleanup did to it).
|
|
8602
8611
|
*
|
|
8603
8612
|
* - `left_behind` objects still exist on the ad account (Meta refused the delete, typically on a held account, or the delete hit a network error). Delete them yourself or reuse them.
|
|
8604
|
-
* - `unconfirmedWrite` is set when Meta answered a create with a 5xx or dropped the connection and Zernio could not confirm whether the object exists. Check that parent before creating it again.
|
|
8613
|
+
* - `unconfirmedWrite` is set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection, and Zernio could not confirm whether the object exists. Check that parent before creating it again.
|
|
8605
8614
|
*
|
|
8606
8615
|
* **Ineligible ad account: 422 `ad_account_unusable`.** When Meta refuses a write because the ad account's status is ineligible to manage ads (Meta subcode 2490592 or 4841021, on the write itself or on a cleanup delete), any Meta ads write answers it.
|
|
8607
8616
|
*
|
|
@@ -8648,12 +8657,22 @@ export type ErrorResponse = {
|
|
|
8648
8657
|
*/
|
|
8649
8658
|
id?: string;
|
|
8650
8659
|
/**
|
|
8651
|
-
* `deleted`: Zernio deleted it.
|
|
8660
|
+
* - `deleted`: Zernio deleted it.
|
|
8661
|
+
* - `left_behind`: cleanup could not delete it (Meta refused the delete, or the delete hit a network error), so it still exists.
|
|
8662
|
+
* - `kept`: deliberately not deleted. Either an image (hashes are shared by every upload of the same file), or an object Zernio found by name after Meta lost its answer to the create, which may belong to another request with the same name.
|
|
8663
|
+
*
|
|
8652
8664
|
*/
|
|
8653
8665
|
cleanup?: 'deleted' | 'left_behind' | 'kept';
|
|
8654
8666
|
}>;
|
|
8655
8667
|
/**
|
|
8656
|
-
* Meta ad create failures only
|
|
8668
|
+
* Meta ad create failures only. Set when Meta answered a create with a 5xx or a non-JSON body, or dropped the connection after the request was sent, and reading the parent back by name did not settle it. Zernio did not retry it.
|
|
8669
|
+
*
|
|
8670
|
+
* One of these left it open:
|
|
8671
|
+
*
|
|
8672
|
+
* - The read-back found several objects of the same name.
|
|
8673
|
+
* - The parent could not be read, or the object is a creative, which has no reliable read-back.
|
|
8674
|
+
* - The read-back found no such object, after a dropped connection, a non-JSON body, a 5xx with `retryOnServerError: false`, or a 5xx on a create whose own body is `status: ACTIVE`.
|
|
8675
|
+
*
|
|
8657
8676
|
*/
|
|
8658
8677
|
unconfirmedWrite?: {
|
|
8659
8678
|
type?: 'campaign' | 'adset' | 'creative' | 'ad';
|
|
@@ -12846,6 +12865,28 @@ export type MetaPromotion = {
|
|
|
12846
12865
|
[key: string]: unknown;
|
|
12847
12866
|
} | null;
|
|
12848
12867
|
|
|
12868
|
+
/**
|
|
12869
|
+
* Meta only, present only when needed. Every object this request did not get confirmed by its first POST: found by name after Meta lost or failed its answer (`adopted`), or created by a second POST after a Meta 5xx (`repostedAfter`).
|
|
12870
|
+
*
|
|
12871
|
+
* A re-POSTed object may have a twin from the first POST that Meta wrote late: check its parent for a duplicate name. Send `retryOnServerError: false` to never re-POST.
|
|
12872
|
+
*
|
|
12873
|
+
*/
|
|
12874
|
+
export type MetaRecoveredWrites = Array<{
|
|
12875
|
+
type: 'campaign' | 'adset' | 'ad';
|
|
12876
|
+
/**
|
|
12877
|
+
* The Meta object id this response uses.
|
|
12878
|
+
*/
|
|
12879
|
+
id: string;
|
|
12880
|
+
/**
|
|
12881
|
+
* Always true when present. Zernio found this object by name under its parent and reused it instead of creating it again.
|
|
12882
|
+
*/
|
|
12883
|
+
adopted?: boolean;
|
|
12884
|
+
/**
|
|
12885
|
+
* Zernio sent the create again after Meta answered a 5xx and the read-back found no such object.
|
|
12886
|
+
*/
|
|
12887
|
+
repostedAfter?: 'server_error';
|
|
12888
|
+
}>;
|
|
12889
|
+
|
|
12849
12890
|
export type Money = {
|
|
12850
12891
|
/**
|
|
12851
12892
|
* ISO 4217 currency code (e.g. USD, EUR)
|
|
@@ -60688,6 +60729,13 @@ export type BoostPostData = {
|
|
|
60688
60729
|
*
|
|
60689
60730
|
*/
|
|
60690
60731
|
bodies?: Array<(string)>;
|
|
60732
|
+
/**
|
|
60733
|
+
* Meta only (a 400 elsewhere). When Meta answers a create with a 5xx and reading the parent back by name finds no such object, Zernio sends the create again (at most 3 POSTs per object, never for an object created ACTIVE) and reports it in `recoveredWrites`.
|
|
60734
|
+
*
|
|
60735
|
+
* `false` never sends it again: the request fails with 502 and `details.unconfirmedWrite`, so you can check the parent yourself. One object found by name is still reused.
|
|
60736
|
+
*
|
|
60737
|
+
*/
|
|
60738
|
+
retryOnServerError?: boolean;
|
|
60691
60739
|
/**
|
|
60692
60740
|
* Meta only (a 400 elsewhere). Controls the fallback when Meta refuses an existing Instagram video as the ad (subcode 1815279).
|
|
60693
60741
|
*
|
|
@@ -60797,6 +60845,7 @@ export type BoostPostResponse = ({
|
|
|
60797
60845
|
ad?: Ad;
|
|
60798
60846
|
message?: string;
|
|
60799
60847
|
instagramVideoFallback?: InstagramVideoFallback;
|
|
60848
|
+
recoveredWrites?: MetaRecoveredWrites;
|
|
60800
60849
|
/**
|
|
60801
60850
|
* Human-readable notes about the boost.
|
|
60802
60851
|
*
|
|
@@ -61170,6 +61219,13 @@ export type CreateStandaloneAdData = {
|
|
|
61170
61219
|
*
|
|
61171
61220
|
*/
|
|
61172
61221
|
aiDisclosure?: 'OPT_IN' | 'OPT_OUT';
|
|
61222
|
+
/**
|
|
61223
|
+
* Meta only (a 400 elsewhere). When Meta answers a create with a 5xx and reading the parent back by name finds no such object, Zernio sends the create again (at most 3 POSTs per object, never for an object created ACTIVE) and reports it in `recoveredWrites`.
|
|
61224
|
+
*
|
|
61225
|
+
* `false` never sends it again: the request fails with 502 and `details.unconfirmedWrite`, so you can check the parent yourself. One object found by name is still reused.
|
|
61226
|
+
*
|
|
61227
|
+
*/
|
|
61228
|
+
retryOnServerError?: boolean;
|
|
61173
61229
|
/**
|
|
61174
61230
|
* Validate the request without creating anything. Supported on Meta, TikTok, ChatGPT (OpenAI) and Google Performance Max / Demand Gen. Any other platform, or a Google campaignType other than pmax or demand_gen, returns 501 `feature_not_available`.
|
|
61175
61231
|
*
|
|
@@ -62360,6 +62416,7 @@ export type CreateStandaloneAdResponse = ({
|
|
|
62360
62416
|
ad?: Ad;
|
|
62361
62417
|
appliedDefaults?: AdAppliedDefaults;
|
|
62362
62418
|
message?: string;
|
|
62419
|
+
recoveredWrites?: MetaRecoveredWrites;
|
|
62363
62420
|
/**
|
|
62364
62421
|
* Meta only, present only when needed.
|
|
62365
62422
|
*
|
|
@@ -62373,6 +62430,7 @@ export type CreateStandaloneAdResponse = ({
|
|
|
62373
62430
|
platformAdSetId?: string;
|
|
62374
62431
|
appliedDefaults?: AdAppliedDefaults;
|
|
62375
62432
|
message?: string;
|
|
62433
|
+
recoveredWrites?: MetaRecoveredWrites;
|
|
62376
62434
|
/**
|
|
62377
62435
|
* Meta only, present only when needed.
|
|
62378
62436
|
*
|