@zernio/node 0.2.717 → 0.2.718
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/README.md +9 -0
- package/dist/index.d.mts +391 -4
- package/dist/index.d.ts +391 -4
- package/dist/index.js +82 -1
- package/dist/index.mjs +82 -1
- package/package.json +1 -1
- package/src/client.ts +36 -0
- package/src/generated/sdk.gen.ts +164 -6
- package/src/generated/types.gen.ts +391 -3
|
@@ -1992,6 +1992,55 @@ export type ConnectedApp = {
|
|
|
1992
1992
|
tokenCount?: number;
|
|
1993
1993
|
};
|
|
1994
1994
|
|
|
1995
|
+
/**
|
|
1996
|
+
* A Google Ads conversion action, e.g. a WEBPAGE conversion created via
|
|
1997
|
+
* `createConversionAction`. Returned by `listConversionActions` and
|
|
1998
|
+
* `createConversionAction`.
|
|
1999
|
+
*
|
|
2000
|
+
*/
|
|
2001
|
+
export type ConversionAction = {
|
|
2002
|
+
/**
|
|
2003
|
+
* Google Ads conversion action id.
|
|
2004
|
+
*/
|
|
2005
|
+
id: string;
|
|
2006
|
+
name: string;
|
|
2007
|
+
/**
|
|
2008
|
+
* Google's ConversionActionType, e.g. WEBPAGE, UPLOAD_CLICKS.
|
|
2009
|
+
*/
|
|
2010
|
+
type: string;
|
|
2011
|
+
/**
|
|
2012
|
+
* Google's ConversionActionStatus, e.g. ENABLED, REMOVED, HIDDEN.
|
|
2013
|
+
*/
|
|
2014
|
+
status: string;
|
|
2015
|
+
/**
|
|
2016
|
+
* Google's ConversionActionCategory, e.g. DEFAULT, PURCHASE, LEAD.
|
|
2017
|
+
*/
|
|
2018
|
+
category: string;
|
|
2019
|
+
/**
|
|
2020
|
+
* The code a customer pastes onto their site. Present for types
|
|
2021
|
+
* Google generates a snippet for (e.g. WEBPAGE); empty otherwise.
|
|
2022
|
+
*
|
|
2023
|
+
*/
|
|
2024
|
+
tagSnippets: Array<{
|
|
2025
|
+
/**
|
|
2026
|
+
* Google's TrackingCodeType, e.g. WEBPAGE.
|
|
2027
|
+
*/
|
|
2028
|
+
type: string;
|
|
2029
|
+
/**
|
|
2030
|
+
* Google's TrackingCodePageFormat, e.g. HTML, AMP.
|
|
2031
|
+
*/
|
|
2032
|
+
pageFormat?: string;
|
|
2033
|
+
/**
|
|
2034
|
+
* The gtag.js snippet to install once per site.
|
|
2035
|
+
*/
|
|
2036
|
+
globalSiteTag?: string;
|
|
2037
|
+
/**
|
|
2038
|
+
* The per-conversion-page snippet that fires the event.
|
|
2039
|
+
*/
|
|
2040
|
+
eventSnippet?: string;
|
|
2041
|
+
}>;
|
|
2042
|
+
};
|
|
2043
|
+
|
|
1995
2044
|
/**
|
|
1996
2045
|
* A discoverable conversion destination on an ad platform — a Meta pixel,
|
|
1997
2046
|
* Google conversion action, or LinkedIn conversion rule. Returned by
|
|
@@ -31055,6 +31104,198 @@ export type DuplicateAdCampaignError = (unknown | {
|
|
|
31055
31104
|
error?: string;
|
|
31056
31105
|
});
|
|
31057
31106
|
|
|
31107
|
+
export type GetCampaignTargetingData = {
|
|
31108
|
+
path: {
|
|
31109
|
+
/**
|
|
31110
|
+
* Google platform campaign ID
|
|
31111
|
+
*/
|
|
31112
|
+
campaignId: string;
|
|
31113
|
+
};
|
|
31114
|
+
query?: {
|
|
31115
|
+
/**
|
|
31116
|
+
* Disambiguates when the same campaignId string exists on more than one connected platform.
|
|
31117
|
+
*/
|
|
31118
|
+
platform?: 'google';
|
|
31119
|
+
};
|
|
31120
|
+
};
|
|
31121
|
+
|
|
31122
|
+
export type GetCampaignTargetingResponse = ({
|
|
31123
|
+
devices?: Array<{
|
|
31124
|
+
device?: 'MOBILE' | 'DESKTOP' | 'TABLET' | 'CONNECTED_TV';
|
|
31125
|
+
included?: boolean;
|
|
31126
|
+
/**
|
|
31127
|
+
* Always null on this read (see description).
|
|
31128
|
+
*/
|
|
31129
|
+
bidModifier?: (number) | null;
|
|
31130
|
+
}>;
|
|
31131
|
+
locations?: Array<{
|
|
31132
|
+
/**
|
|
31133
|
+
* Numeric id from Google's geoTargetConstants/{id}.
|
|
31134
|
+
*/
|
|
31135
|
+
geoTargetId?: string;
|
|
31136
|
+
/**
|
|
31137
|
+
* true = excluded location.
|
|
31138
|
+
*/
|
|
31139
|
+
negative?: boolean;
|
|
31140
|
+
}>;
|
|
31141
|
+
languages?: Array<{
|
|
31142
|
+
/**
|
|
31143
|
+
* Google's language code (ISO 639-1, plus variants such as `zh_CN`). Empty when the campaign's language_constant id is not in Zernio's checked-in table.
|
|
31144
|
+
*/
|
|
31145
|
+
code?: string;
|
|
31146
|
+
/**
|
|
31147
|
+
* Google's languageConstants/{id} numeric id.
|
|
31148
|
+
*/
|
|
31149
|
+
id?: string;
|
|
31150
|
+
name?: string;
|
|
31151
|
+
}>;
|
|
31152
|
+
});
|
|
31153
|
+
|
|
31154
|
+
export type GetCampaignTargetingError = (ErrorResponse | {
|
|
31155
|
+
error?: string;
|
|
31156
|
+
} | unknown);
|
|
31157
|
+
|
|
31158
|
+
export type UpdateCampaignTargetingData = {
|
|
31159
|
+
body: {
|
|
31160
|
+
platform: 'google';
|
|
31161
|
+
targeting: {
|
|
31162
|
+
/**
|
|
31163
|
+
* Devices to include. Devices not listed become excluded (negative) criteria, same contract as the existing devices-only edit.
|
|
31164
|
+
*/
|
|
31165
|
+
devices?: Array<('MOBILE' | 'DESKTOP' | 'TABLET' | 'CONNECTED_TV' | {
|
|
31166
|
+
device: 'MOBILE' | 'DESKTOP' | 'TABLET' | 'CONNECTED_TV';
|
|
31167
|
+
/**
|
|
31168
|
+
* Bid modifier for this device; devices without one use the campaign's base bid.
|
|
31169
|
+
*/
|
|
31170
|
+
bidModifier: number;
|
|
31171
|
+
})>;
|
|
31172
|
+
/**
|
|
31173
|
+
* Bare country-code array, or the nested creation-time shape (countries/regions/cities/zips/metros).
|
|
31174
|
+
*/
|
|
31175
|
+
locations?: (Array<(string)> | {
|
|
31176
|
+
countries?: Array<(string)>;
|
|
31177
|
+
regions?: Array<{
|
|
31178
|
+
key: string;
|
|
31179
|
+
name?: string;
|
|
31180
|
+
}>;
|
|
31181
|
+
cities?: Array<{
|
|
31182
|
+
key: string;
|
|
31183
|
+
name?: string;
|
|
31184
|
+
}>;
|
|
31185
|
+
zips?: Array<{
|
|
31186
|
+
key: string;
|
|
31187
|
+
name?: string;
|
|
31188
|
+
}>;
|
|
31189
|
+
metros?: Array<{
|
|
31190
|
+
key: string;
|
|
31191
|
+
name?: string;
|
|
31192
|
+
}>;
|
|
31193
|
+
});
|
|
31194
|
+
/**
|
|
31195
|
+
* Google's language codes (ISO 639-1, plus variants such as `zh_CN`), e.g. ["en", "de"].
|
|
31196
|
+
*/
|
|
31197
|
+
languages?: Array<(string)>;
|
|
31198
|
+
};
|
|
31199
|
+
};
|
|
31200
|
+
path: {
|
|
31201
|
+
/**
|
|
31202
|
+
* Google platform campaign ID
|
|
31203
|
+
*/
|
|
31204
|
+
campaignId: string;
|
|
31205
|
+
};
|
|
31206
|
+
};
|
|
31207
|
+
|
|
31208
|
+
export type UpdateCampaignTargetingResponse = ({
|
|
31209
|
+
campaignId?: string;
|
|
31210
|
+
/**
|
|
31211
|
+
* Which targeting fields were applied.
|
|
31212
|
+
*/
|
|
31213
|
+
updated?: Array<('devices' | 'locations' | 'languages')>;
|
|
31214
|
+
});
|
|
31215
|
+
|
|
31216
|
+
export type UpdateCampaignTargetingError = (ErrorResponse | {
|
|
31217
|
+
error?: string;
|
|
31218
|
+
} | unknown);
|
|
31219
|
+
|
|
31220
|
+
export type ListAdSetsData = {
|
|
31221
|
+
query?: {
|
|
31222
|
+
/**
|
|
31223
|
+
* Social account ID
|
|
31224
|
+
*/
|
|
31225
|
+
accountId?: string;
|
|
31226
|
+
/**
|
|
31227
|
+
* Platform campaign ID
|
|
31228
|
+
*/
|
|
31229
|
+
campaignId?: string;
|
|
31230
|
+
platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai';
|
|
31231
|
+
};
|
|
31232
|
+
};
|
|
31233
|
+
|
|
31234
|
+
export type ListAdSetsResponse = ({
|
|
31235
|
+
adSets?: Array<{
|
|
31236
|
+
platformAdSetId?: string;
|
|
31237
|
+
platform?: string;
|
|
31238
|
+
adSetName?: (string) | null;
|
|
31239
|
+
status?: (string) | null;
|
|
31240
|
+
platformAdSetStatus?: (string) | null;
|
|
31241
|
+
platformCampaignId?: (string) | null;
|
|
31242
|
+
platformAdAccountId?: string;
|
|
31243
|
+
accountId?: (string) | null;
|
|
31244
|
+
profileId?: string;
|
|
31245
|
+
currency?: (string) | null;
|
|
31246
|
+
budget?: {
|
|
31247
|
+
[key: string]: unknown;
|
|
31248
|
+
} | null;
|
|
31249
|
+
isExternal?: (boolean) | null;
|
|
31250
|
+
platformCreatedAt?: (string) | null;
|
|
31251
|
+
}>;
|
|
31252
|
+
});
|
|
31253
|
+
|
|
31254
|
+
export type ListAdSetsError = (ErrorResponse | {
|
|
31255
|
+
error?: string;
|
|
31256
|
+
} | unknown);
|
|
31257
|
+
|
|
31258
|
+
export type CreateAdSetData = {
|
|
31259
|
+
body: {
|
|
31260
|
+
/**
|
|
31261
|
+
* Zernio SocialAccount id owning the Google Ads connection.
|
|
31262
|
+
*/
|
|
31263
|
+
accountId: string;
|
|
31264
|
+
/**
|
|
31265
|
+
* Only "google" is implemented today; every other value returns 501.
|
|
31266
|
+
*/
|
|
31267
|
+
platform: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter' | 'openai';
|
|
31268
|
+
/**
|
|
31269
|
+
* Google platform campaign ID (numeric) the ad group is created under.
|
|
31270
|
+
*/
|
|
31271
|
+
campaignId: string;
|
|
31272
|
+
name: string;
|
|
31273
|
+
status?: 'ACTIVE' | 'PAUSED';
|
|
31274
|
+
/**
|
|
31275
|
+
* Numeric Google Ads customer id. Only required when the connection has more than one.
|
|
31276
|
+
*/
|
|
31277
|
+
customerId?: string;
|
|
31278
|
+
};
|
|
31279
|
+
headers?: {
|
|
31280
|
+
/**
|
|
31281
|
+
* 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. Only 2xx responses are stored, so a request that failed with a 4xx can be retried with a corrected body under the SAME key.
|
|
31282
|
+
*/
|
|
31283
|
+
'Idempotency-Key'?: string;
|
|
31284
|
+
};
|
|
31285
|
+
};
|
|
31286
|
+
|
|
31287
|
+
export type CreateAdSetResponse = ({
|
|
31288
|
+
/**
|
|
31289
|
+
* Platform id of the new ad group
|
|
31290
|
+
*/
|
|
31291
|
+
adSetId?: string;
|
|
31292
|
+
campaignId?: string;
|
|
31293
|
+
});
|
|
31294
|
+
|
|
31295
|
+
export type CreateAdSetError = (ErrorResponse | {
|
|
31296
|
+
error?: string;
|
|
31297
|
+
} | unknown);
|
|
31298
|
+
|
|
31058
31299
|
export type DuplicateAdSetData = {
|
|
31059
31300
|
body: {
|
|
31060
31301
|
platform: 'facebook' | 'instagram';
|
|
@@ -33171,6 +33412,90 @@ export type DeleteValueRuleSetError = (unknown | {
|
|
|
33171
33412
|
error?: string;
|
|
33172
33413
|
});
|
|
33173
33414
|
|
|
33415
|
+
export type ListAccountCalloutsData = {
|
|
33416
|
+
query: {
|
|
33417
|
+
/**
|
|
33418
|
+
* Google ads SocialAccount id.
|
|
33419
|
+
*/
|
|
33420
|
+
accountId: string;
|
|
33421
|
+
/**
|
|
33422
|
+
* Numeric Google Ads customer id (no dashes). Defaults to the account's connected customer.
|
|
33423
|
+
*/
|
|
33424
|
+
customerId?: string;
|
|
33425
|
+
};
|
|
33426
|
+
};
|
|
33427
|
+
|
|
33428
|
+
export type ListAccountCalloutsResponse = ({
|
|
33429
|
+
customerId?: string;
|
|
33430
|
+
callouts?: Array<{
|
|
33431
|
+
assetId?: string;
|
|
33432
|
+
text?: string;
|
|
33433
|
+
/**
|
|
33434
|
+
* customer_asset.status, e.g. ENABLED, REMOVED, PAUSED.
|
|
33435
|
+
*/
|
|
33436
|
+
status?: string;
|
|
33437
|
+
}>;
|
|
33438
|
+
});
|
|
33439
|
+
|
|
33440
|
+
export type ListAccountCalloutsError = (ErrorResponse | {
|
|
33441
|
+
error?: string;
|
|
33442
|
+
} | unknown);
|
|
33443
|
+
|
|
33444
|
+
export type AddAccountCalloutsData = {
|
|
33445
|
+
body: {
|
|
33446
|
+
/**
|
|
33447
|
+
* Zernio SocialAccount id owning the Google Ads connection.
|
|
33448
|
+
*/
|
|
33449
|
+
accountId: string;
|
|
33450
|
+
/**
|
|
33451
|
+
* Numeric Google Ads customer id. Only required when the connection has more than one.
|
|
33452
|
+
*/
|
|
33453
|
+
customerId?: string;
|
|
33454
|
+
/**
|
|
33455
|
+
* Callout text, 1-25 characters each; up to 20 per request (Google's CalloutAsset limits).
|
|
33456
|
+
*/
|
|
33457
|
+
callouts: Array<(string)>;
|
|
33458
|
+
};
|
|
33459
|
+
};
|
|
33460
|
+
|
|
33461
|
+
export type AddAccountCalloutsResponse = ({
|
|
33462
|
+
customerId?: string;
|
|
33463
|
+
callouts?: Array<{
|
|
33464
|
+
assetId?: string;
|
|
33465
|
+
text?: string;
|
|
33466
|
+
}>;
|
|
33467
|
+
});
|
|
33468
|
+
|
|
33469
|
+
export type AddAccountCalloutsError = (ErrorResponse | {
|
|
33470
|
+
error?: string;
|
|
33471
|
+
} | unknown);
|
|
33472
|
+
|
|
33473
|
+
export type RemoveAccountCalloutData = {
|
|
33474
|
+
body: {
|
|
33475
|
+
/**
|
|
33476
|
+
* Zernio SocialAccount id owning the Google Ads connection.
|
|
33477
|
+
*/
|
|
33478
|
+
accountId: string;
|
|
33479
|
+
/**
|
|
33480
|
+
* Numeric Google Ads customer id. Only required when the connection has more than one.
|
|
33481
|
+
*/
|
|
33482
|
+
customerId?: string;
|
|
33483
|
+
/**
|
|
33484
|
+
* Numeric asset id from GET /v1/ads/accounts/callouts.
|
|
33485
|
+
*/
|
|
33486
|
+
assetId: string;
|
|
33487
|
+
};
|
|
33488
|
+
};
|
|
33489
|
+
|
|
33490
|
+
export type RemoveAccountCalloutResponse = ({
|
|
33491
|
+
removed?: boolean;
|
|
33492
|
+
customerId?: string;
|
|
33493
|
+
});
|
|
33494
|
+
|
|
33495
|
+
export type RemoveAccountCalloutError = (ErrorResponse | {
|
|
33496
|
+
error?: string;
|
|
33497
|
+
} | unknown);
|
|
33498
|
+
|
|
33174
33499
|
export type GetAdAccountFinanceData = {
|
|
33175
33500
|
query: {
|
|
33176
33501
|
/**
|
|
@@ -34138,7 +34463,7 @@ export type CreateStandaloneAdData = {
|
|
|
34138
34463
|
*/
|
|
34139
34464
|
incomeTier?: 'top_5' | 'top_10' | 'top_10_25' | 'top_25_50';
|
|
34140
34465
|
/**
|
|
34141
|
-
*
|
|
34466
|
+
* e.g. ["en","es"]. Google: campaign language targeting (language_constant) using Google's language codes (ISO 639-1, plus variants such as `zh_CN`); unknown codes return 400. On Meta, a bare code targets all regional variants ("en" = all English), or use a region-qualified code for a specific one ("en_GB", "pt_BR", "zh_TW"); unknown codes are rejected. Other ad platforms use their own language-code systems.
|
|
34142
34467
|
*/
|
|
34143
34468
|
languages?: Array<(string)>;
|
|
34144
34469
|
/**
|
|
@@ -35514,9 +35839,9 @@ export type SearchAdTargetingData = {
|
|
|
35514
35839
|
*/
|
|
35515
35840
|
countryCode?: string;
|
|
35516
35841
|
/**
|
|
35517
|
-
* What to search. `geo` resolves locations (scope further with `geoType`), `interest`/`behavior` resolve audience entities, `income` resolves income-tier options, `workPosition`/`workEmployer`/`workIndustry` resolve Meta work demographics. Defaults to `interest` for backward compatibility with the deprecated /v1/ads/interests alias.
|
|
35842
|
+
* What to search. `geo` resolves locations (scope further with `geoType`), `interest`/`behavior` resolve audience entities, `income` resolves income-tier options, `language` resolves Google's targetable language_constant table (Google only), `workPosition`/`workEmployer`/`workIndustry` resolve Meta work demographics. Defaults to `interest` for backward compatibility with the deprecated /v1/ads/interests alias.
|
|
35518
35843
|
*/
|
|
35519
|
-
dimension?: 'geo' | 'interest' | 'behavior' | 'income' | 'workPosition' | 'workEmployer' | 'workIndustry';
|
|
35844
|
+
dimension?: 'geo' | 'interest' | 'behavior' | 'income' | 'language' | 'workPosition' | 'workEmployer' | 'workIndustry';
|
|
35520
35845
|
/**
|
|
35521
35846
|
* Only used when `dimension=geo`. The kind of location to resolve. `all` searches every type in one relevance-ranked call. Defaults to `city`.
|
|
35522
35847
|
*/
|
|
@@ -36420,6 +36745,69 @@ export type AdjustConversionsError = (unknown | {
|
|
|
36420
36745
|
error?: string;
|
|
36421
36746
|
});
|
|
36422
36747
|
|
|
36748
|
+
export type ListConversionActionsData = {
|
|
36749
|
+
query: {
|
|
36750
|
+
/**
|
|
36751
|
+
* SocialAccount _id (must be a googleads account).
|
|
36752
|
+
*/
|
|
36753
|
+
accountId: string;
|
|
36754
|
+
/**
|
|
36755
|
+
* Google Ads customer id (digits only). Resolved automatically when the connection has exactly one accessible customer.
|
|
36756
|
+
*/
|
|
36757
|
+
customerId?: string;
|
|
36758
|
+
/**
|
|
36759
|
+
* Filter by Google's ConversionActionType enum (e.g. WEBPAGE, UPLOAD_CLICKS).
|
|
36760
|
+
*/
|
|
36761
|
+
type?: string;
|
|
36762
|
+
};
|
|
36763
|
+
};
|
|
36764
|
+
|
|
36765
|
+
export type ListConversionActionsResponse = ({
|
|
36766
|
+
/**
|
|
36767
|
+
* The Google Ads customer id the actions were read from.
|
|
36768
|
+
*/
|
|
36769
|
+
customerId?: string;
|
|
36770
|
+
actions?: Array<ConversionAction>;
|
|
36771
|
+
});
|
|
36772
|
+
|
|
36773
|
+
export type ListConversionActionsError = (ErrorResponse | {
|
|
36774
|
+
error?: string;
|
|
36775
|
+
} | unknown);
|
|
36776
|
+
|
|
36777
|
+
export type CreateConversionActionData = {
|
|
36778
|
+
body: {
|
|
36779
|
+
/**
|
|
36780
|
+
* SocialAccount ID. Must be a `googleads` account.
|
|
36781
|
+
*/
|
|
36782
|
+
accountId: string;
|
|
36783
|
+
/**
|
|
36784
|
+
* Google Ads customer id (digits only). Resolved automatically when the connection has exactly one accessible customer.
|
|
36785
|
+
*/
|
|
36786
|
+
customerId?: string;
|
|
36787
|
+
name: string;
|
|
36788
|
+
/**
|
|
36789
|
+
* Only WEBPAGE is supported for creation today.
|
|
36790
|
+
*/
|
|
36791
|
+
type: 'WEBPAGE';
|
|
36792
|
+
/**
|
|
36793
|
+
* Default conversion value used when an event doesn't carry its own value.
|
|
36794
|
+
*/
|
|
36795
|
+
defaultValue?: number;
|
|
36796
|
+
/**
|
|
36797
|
+
* When true, always use defaultValue and ignore any value sent with the event. Defaults to true when defaultValue is set.
|
|
36798
|
+
*/
|
|
36799
|
+
alwaysUseDefaultValue?: boolean;
|
|
36800
|
+
};
|
|
36801
|
+
};
|
|
36802
|
+
|
|
36803
|
+
export type CreateConversionActionResponse = ({
|
|
36804
|
+
action?: ConversionAction;
|
|
36805
|
+
});
|
|
36806
|
+
|
|
36807
|
+
export type CreateConversionActionError = (ErrorResponse | {
|
|
36808
|
+
error?: string;
|
|
36809
|
+
} | unknown);
|
|
36810
|
+
|
|
36423
36811
|
export type ListConversionDestinationsData = {
|
|
36424
36812
|
path: {
|
|
36425
36813
|
/**
|