@getlatedev/node 0.2.903 → 0.2.905

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.
@@ -4121,8 +4121,49 @@ export type ErrorResponse = {
4121
4121
  * every other customer, so only waiting for the reset clears it. The two
4122
4122
  * scopes are separate axes from `quotaScope`, not the same pool named twice.
4123
4123
  *
4124
+ * A failed Meta ad create (`POST /v1/ads/create`, `POST /v1/ads/boost`,
4125
+ * `POST /v1/ads/ctwa`) carries `stage`, `adAccountId` and `createdObjects`: where
4126
+ * it failed, on which ad account, and every object this request had already
4127
+ * created with what cleanup did to it. `left_behind` objects still exist on the
4128
+ * ad account (Meta refused the delete, typically on a held account), so delete
4129
+ * them yourself or reuse them. `unconfirmedWrite` is set when Meta answered a
4130
+ * create with a 5xx or dropped the connection and Zernio could not confirm
4131
+ * whether the object exists: check that parent before creating it again.
4132
+ *
4124
4133
  */
4125
4134
  details?: {
4135
+ /**
4136
+ * Meta ad create failures only. The step that failed: `media` (image/video download or upload), `campaign`, `adset`, `creative`, `ad` (the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land), `activation` (switching the created objects on), or `other` (a read or check before any write).
4137
+ */
4138
+ stage?: 'media' | 'campaign' | 'adset' | 'creative' | 'ad' | 'activation' | 'other';
4139
+ /**
4140
+ * Meta ad create failures only. The ad account the request wrote to (`act_...`).
4141
+ */
4142
+ adAccountId?: string;
4143
+ /**
4144
+ * Meta ad create failures only. Every object this request created before failing, in creation order. Objects you referenced (an existing campaign, ad set, creative or video) are never listed and never deleted.
4145
+ */
4146
+ createdObjects?: Array<{
4147
+ type?: 'campaign' | 'adset' | 'creative' | 'ad' | 'video' | 'image';
4148
+ /**
4149
+ * Meta object id; for `image` the image hash.
4150
+ */
4151
+ id?: string;
4152
+ /**
4153
+ * `deleted`: Zernio deleted it. `left_behind`: Meta refused the delete, so it still exists. `kept`: deliberately not deleted (image hashes are shared by every upload of the same file).
4154
+ */
4155
+ cleanup?: 'deleted' | 'left_behind' | 'kept';
4156
+ }>;
4157
+ /**
4158
+ * Meta ad create failures only, when Meta answered a create with a 5xx or dropped the connection and the object could not be looked up. Zernio did not retry it.
4159
+ */
4160
+ unconfirmedWrite?: {
4161
+ type?: 'campaign' | 'adset' | 'creative' | 'ad';
4162
+ /**
4163
+ * Where to look for it: the ad set for an ad, the campaign for an ad set, the ad account otherwise.
4164
+ */
4165
+ parentId?: string;
4166
+ };
4126
4167
  /**
4127
4168
  * Google Ads 429 only. True when the upstream Google Ads quota is spent rather than a Zernio limit.
4128
4169
  */
@@ -4135,7 +4176,7 @@ export type ErrorResponse = {
4135
4176
  * Zernio Google Ads operations-budget 429 only (never set alongside `quotaExhausted`). `user` is your own burst/daily allowance; `platform` is the fleet-wide daily budget shared across customers.
4136
4177
  */
4137
4178
  budgetScope?: 'user' | 'platform';
4138
- [key: string]: unknown | boolean | string;
4179
+ [key: string]: unknown | string | boolean;
4139
4180
  };
4140
4181
  };
4141
4182
 
@@ -4144,6 +4185,11 @@ export type ErrorResponse = {
4144
4185
  */
4145
4186
  export type type4 = 'invalid_request_error' | 'authentication_error' | 'permission_error' | 'not_found' | 'rate_limit_error' | 'platform_error' | 'api_error';
4146
4187
 
4188
+ /**
4189
+ * Meta ad create failures only. The step that failed: `media` (image/video download or upload), `campaign`, `adset`, `creative`, `ad` (the ad POST itself, where Meta's code 31 / 3858385 hold and 100 / 1359188 payment rejections land), `activation` (switching the created objects on), or `other` (a read or check before any write).
4190
+ */
4191
+ export type stage = 'media' | 'campaign' | 'adset' | 'creative' | 'ad' | 'activation' | 'other';
4192
+
4147
4193
  /**
4148
4194
  * Google Ads 429 only, when Google names the scope. DEVELOPER is the shared developer-token budget; ACCOUNT is your ad account.
4149
4195
  */
@@ -14058,7 +14104,7 @@ export type GetUsageResponse = ((UsageStats | UsageMetering));
14058
14104
 
14059
14105
  export type GetUsageError = (unknown | {
14060
14106
  error?: string;
14061
- });
14107
+ } | ErrorResponse);
14062
14108
 
14063
14109
  export type GetUsageStatsData = {
14064
14110
  query?: {
@@ -14078,7 +14124,7 @@ export type GetUsageStatsResponse = (UsageStats);
14078
14124
 
14079
14125
  export type GetUsageStatsError = (unknown | {
14080
14126
  error?: string;
14081
- });
14127
+ } | ErrorResponse);
14082
14128
 
14083
14129
  export type GetCallsUsageData = {
14084
14130
  query?: {
@@ -16885,9 +16931,13 @@ export type SelectInstagramAccountData = {
16885
16931
  export type SelectInstagramAccountResponse = ({
16886
16932
  message?: string;
16887
16933
  /**
16888
- * Redirect URL if a custom redirect_url was provided
16934
+ * Redirect URL if a custom redirect_url was provided. On an ads connect it also carries `adsAccountId`.
16889
16935
  */
16890
16936
  redirect_url?: string;
16937
+ /**
16938
+ * Ads connect only (the redirect_url carries adsConnect=true, as it does after GET /v1/connect/{platform}/ads). The metaads SocialAccount ID to use with the /v1/ads endpoints. `account.accountId` is the Instagram posting account. Absent when the ads account could not be created.
16939
+ */
16940
+ adsAccountId?: string;
16891
16941
  account?: {
16892
16942
  /**
16893
16943
  * ID of the created SocialAccount
@@ -39902,15 +39952,14 @@ export type ListAdAccountsResponse = ({
39902
39952
  */
39903
39953
  minimumDailyBudget?: number;
39904
39954
  /**
39905
- * Meta only. Meta's `funding_source` ID for the ad account, forwarded unchanged. ABSENT when this connection's token cannot see billing on the account, which is not the same as the account having no payment method: never read the missing key as `no payment method configured`.
39955
+ * Meta only. Meta's `funding_source` ID for the ad account, forwarded unchanged. ABSENT both when this connection's token cannot see billing and when the account has no payment method; read `billingStatus` to tell the two apart.
39906
39956
  */
39907
39957
  fundingSource?: string;
39908
39958
  /**
39909
39959
  * Meta only. Meta's `funding_source_details` object, forwarded unchanged.
39910
- * ABSENT under exactly the same condition as `fundingSource`: this
39911
- * connection's token cannot see billing on the ad account. It is never
39912
- * sent as null or as an empty object, so treat the missing key as
39913
- * 'unknown', never as 'no payment method configured'.
39960
+ * ABSENT under exactly the same conditions as `fundingSource`, never sent
39961
+ * as null or as an empty object. Read `billingStatus` for what the
39962
+ * absence means.
39914
39963
  *
39915
39964
  */
39916
39965
  fundingSourceDetails?: {
@@ -39927,6 +39976,21 @@ export type ListAdAccountsResponse = ({
39927
39976
  */
39928
39977
  type?: number;
39929
39978
  };
39979
+ /**
39980
+ * Meta only. Whether the ad account has a payment method, derived as follows:
39981
+ * - `missing` when `accountStatus` is `3` (UNSETTLED) or `9` (IN_GRACE_PERIOD),
39982
+ * when `disableReason` is `3` (RISK_PAYMENT), or when the connected person
39983
+ * has the MANAGE task on the account (admin, who always sees billing) and
39984
+ * Meta returns no funding source. Ad creation on such an account fails at
39985
+ * the ad step with Meta code 100 / subcode 1359188: add a payment method in
39986
+ * Meta's Billing & payments center.
39987
+ * - `ok` when Meta returns a funding source. This is presence, not validity:
39988
+ * Meta can still refuse the card or balance at ad creation.
39989
+ * - `unknown` when the connected person is not an admin of the account, or
39990
+ * the token cannot read the billing fields.
39991
+ *
39992
+ */
39993
+ billingStatus?: 'ok' | 'missing' | 'unknown';
39930
39994
  /**
39931
39995
  * Meta and X only. Whether the account can create/run ads now. Absent (treat as true) on other platforms.
39932
39996
  */