@zernio/node 0.2.745 → 0.2.746

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
@@ -342,7 +342,7 @@ declare class Zernio {
342
342
  getRedditFlairs: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetRedditFlairsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetRedditFlairsResponse, unknown, ThrowOnError>;
343
343
  setRedditPostFlair: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SetRedditPostFlairData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SetRedditPostFlairResponse, unknown, ThrowOnError>;
344
344
  facebook: {
345
- listFacebookPages: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
345
+ listFacebookPages: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
346
346
  selectFacebookPage: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SelectFacebookPageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SelectFacebookPageResponse, unknown, ThrowOnError>;
347
347
  };
348
348
  googleBusiness: {
@@ -15985,15 +15985,19 @@ type ConfigureTikTokAdsBrandIdentityError = (unknown | {
15985
15985
  error?: string;
15986
15986
  });
15987
15987
  type ListFacebookPagesData = {
15988
- query: {
15988
+ query?: {
15989
15989
  /**
15990
- * Profile ID from your connection flow
15990
+ * Profile ID from your classic connection flow. Required with tempToken.
15991
15991
  */
15992
- profileId: string;
15992
+ profileId?: string;
15993
15993
  /**
15994
- * Temporary Facebook access token from the OAuth callback redirect
15994
+ * Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
15995
15995
  */
15996
- tempToken: string;
15996
+ selectionToken?: string;
15997
+ /**
15998
+ * Temporary Facebook access token from the classic OAuth callback. Required with profileId.
15999
+ */
16000
+ tempToken?: string;
15997
16001
  };
15998
16002
  };
15999
16003
  type ListFacebookPagesResponse = ({
@@ -16028,21 +16032,21 @@ type ListFacebookPagesError = (unknown | {
16028
16032
  error?: string;
16029
16033
  });
16030
16034
  type SelectFacebookPageData = {
16031
- body: {
16035
+ body: ({
16032
16036
  /**
16033
- * Profile ID from your connection flow
16037
+ * Profile ID from your classic connection flow.
16034
16038
  */
16035
16039
  profileId: string;
16036
16040
  /**
16037
- * The Facebook Page ID selected by the user
16041
+ * The Facebook Page ID selected by the user.
16038
16042
  */
16039
16043
  pageId: string;
16040
16044
  /**
16041
- * Temporary Facebook access token from OAuth
16045
+ * Temporary Facebook access token from OAuth.
16042
16046
  */
16043
16047
  tempToken: string;
16044
16048
  /**
16045
- * Decoded user profile object from the OAuth callback
16049
+ * Decoded user profile object from the OAuth callback.
16046
16050
  */
16047
16051
  userProfile: {
16048
16052
  id?: string;
@@ -16050,15 +16054,24 @@ type SelectFacebookPageData = {
16050
16054
  profilePicture?: string;
16051
16055
  };
16052
16056
  /**
16053
- * Optional custom redirect URL to return to after selection
16057
+ * Optional custom redirect URL to return to after selection.
16054
16058
  */
16055
16059
  redirect_url?: string;
16056
- };
16060
+ } | {
16061
+ /**
16062
+ * Encrypted dashboard business-login grant. Expires after ten minutes.
16063
+ */
16064
+ selectionToken: string;
16065
+ /**
16066
+ * A Page ID from the granted Pages returned by listFacebookPages.
16067
+ */
16068
+ pageId: string;
16069
+ });
16057
16070
  };
16058
16071
  type SelectFacebookPageResponse = ({
16059
16072
  message?: string;
16060
16073
  /**
16061
- * Redirect URL if custom redirect_url was provided
16074
+ * Redirect URL when a custom redirect_url was provided or a business Page was selected.
16062
16075
  */
16063
16076
  redirect_url?: string;
16064
16077
  account?: {
package/dist/index.d.ts CHANGED
@@ -342,7 +342,7 @@ declare class Zernio {
342
342
  getRedditFlairs: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<GetRedditFlairsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetRedditFlairsResponse, unknown, ThrowOnError>;
343
343
  setRedditPostFlair: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SetRedditPostFlairData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SetRedditPostFlairResponse, unknown, ThrowOnError>;
344
344
  facebook: {
345
- listFacebookPages: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
345
+ listFacebookPages: <ThrowOnError extends boolean = false>(options?: _hey_api_client_fetch.OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListFacebookPagesResponse, unknown, ThrowOnError>;
346
346
  selectFacebookPage: <ThrowOnError extends boolean = false>(options: _hey_api_client_fetch.OptionsLegacyParser<SelectFacebookPageData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SelectFacebookPageResponse, unknown, ThrowOnError>;
347
347
  };
348
348
  googleBusiness: {
@@ -15985,15 +15985,19 @@ type ConfigureTikTokAdsBrandIdentityError = (unknown | {
15985
15985
  error?: string;
15986
15986
  });
15987
15987
  type ListFacebookPagesData = {
15988
- query: {
15988
+ query?: {
15989
15989
  /**
15990
- * Profile ID from your connection flow
15990
+ * Profile ID from your classic connection flow. Required with tempToken.
15991
15991
  */
15992
- profileId: string;
15992
+ profileId?: string;
15993
15993
  /**
15994
- * Temporary Facebook access token from the OAuth callback redirect
15994
+ * Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
15995
15995
  */
15996
- tempToken: string;
15996
+ selectionToken?: string;
15997
+ /**
15998
+ * Temporary Facebook access token from the classic OAuth callback. Required with profileId.
15999
+ */
16000
+ tempToken?: string;
15997
16001
  };
15998
16002
  };
15999
16003
  type ListFacebookPagesResponse = ({
@@ -16028,21 +16032,21 @@ type ListFacebookPagesError = (unknown | {
16028
16032
  error?: string;
16029
16033
  });
16030
16034
  type SelectFacebookPageData = {
16031
- body: {
16035
+ body: ({
16032
16036
  /**
16033
- * Profile ID from your connection flow
16037
+ * Profile ID from your classic connection flow.
16034
16038
  */
16035
16039
  profileId: string;
16036
16040
  /**
16037
- * The Facebook Page ID selected by the user
16041
+ * The Facebook Page ID selected by the user.
16038
16042
  */
16039
16043
  pageId: string;
16040
16044
  /**
16041
- * Temporary Facebook access token from OAuth
16045
+ * Temporary Facebook access token from OAuth.
16042
16046
  */
16043
16047
  tempToken: string;
16044
16048
  /**
16045
- * Decoded user profile object from the OAuth callback
16049
+ * Decoded user profile object from the OAuth callback.
16046
16050
  */
16047
16051
  userProfile: {
16048
16052
  id?: string;
@@ -16050,15 +16054,24 @@ type SelectFacebookPageData = {
16050
16054
  profilePicture?: string;
16051
16055
  };
16052
16056
  /**
16053
- * Optional custom redirect URL to return to after selection
16057
+ * Optional custom redirect URL to return to after selection.
16054
16058
  */
16055
16059
  redirect_url?: string;
16056
- };
16060
+ } | {
16061
+ /**
16062
+ * Encrypted dashboard business-login grant. Expires after ten minutes.
16063
+ */
16064
+ selectionToken: string;
16065
+ /**
16066
+ * A Page ID from the granted Pages returned by listFacebookPages.
16067
+ */
16068
+ pageId: string;
16069
+ });
16057
16070
  };
16058
16071
  type SelectFacebookPageResponse = ({
16059
16072
  message?: string;
16060
16073
  /**
16061
- * Redirect URL if custom redirect_url was provided
16074
+ * Redirect URL when a custom redirect_url was provided or a business Page was selected.
16062
16075
  */
16063
16076
  redirect_url?: string;
16064
16077
  account?: {
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.745",
39
+ version: "0.2.746",
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.745",
8
+ version: "0.2.746",
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.745",
3
+ "version": "0.2.746",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1603,11 +1603,14 @@ export const handleOAuthCallback = <ThrowOnError extends boolean = false>(option
1603
1603
  * every previously scoped ad account (or every previous grant for an unscoped connection).
1604
1604
  * Missing or unverifiable grants return 409 before changing the account.
1605
1605
  *
1606
- * Pass `pageId` to select a granted Page for creatives and lead forms. Otherwise the
1607
- * previous Page or sole granted Page is selected. Multiple Pages without a selection
1608
- * return 400 with available Page IDs; restart with pageId. With no Pages granted the
1609
- * account can manage campaigns and sync insights but cannot create Page-based creatives
1610
- * or list Page forms. Success redirects with connected=metaads, profileId and accountId.
1606
+ * Pass `pageId` to select a granted Page for creatives and lead forms. API integrations
1607
+ * otherwise reuse the previous Page or sole granted Page. Multiple Pages without a selection
1608
+ * return 400 with available Page IDs for API integrations; restart with pageId.
1609
+ * Dashboard session logins use the sole current grant automatically or open the existing
1610
+ * Facebook Page picker for several grants, including reconnects. Selection completes
1611
+ * the Meta Ads connection. With no Pages granted the callback returns
1612
+ * 400 with instructions to connect again and grant a Page.
1613
+ * Success redirects with connected=metaads, profileId and accountId.
1611
1614
  * Business login reports metadata.tokenType=system-user in GET /v1/accounts. An absent
1612
1615
  * Meta expires_in leaves tokenExpiresAt absent; no personal-token re-exchange occurs.
1613
1616
  * Subsequent classic requests can change the ad-account scope using the business token;
@@ -1655,7 +1658,7 @@ export const connectAds = <ThrowOnError extends boolean = false>(options: Option
1655
1658
 
1656
1659
  /**
1657
1660
  * Complete Meta business login
1658
- * Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. No token is returned to the browser.
1661
+ * Facebook Login for Business redirect target. Meta supplies the single-use authorization code and the authenticated state returned by connectAds. The state expires after 30 minutes and binds the user, profile, Page selection and ad-account scope. No bearer token is sent by the browser. Success reconnects only metaads and redirects to the original redirect_url. Invalid state returns 400; inaccessible profiles or missing ads access cannot connect. Dashboard logins with several Pages redirect to the Facebook Page picker with an encrypted selectionToken valid for ten minutes. Listing and selecting require the initiating user and current profile access. No plaintext platform token is returned to the browser.
1659
1662
  */
1660
1663
  export const completeMetaAdsBusinessLogin = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CompleteMetaAdsBusinessLoginData, ThrowOnError>) => {
1661
1664
  return (options?.client ?? client).get<void, unknown, ThrowOnError>({
@@ -1739,9 +1742,9 @@ export const configureTikTokAdsBrandIdentity = <ThrowOnError extends boolean = f
1739
1742
 
1740
1743
  /**
1741
1744
  * List Facebook pages
1742
- * Returns the list of Facebook Pages the user can manage after OAuth. Extract tempToken and userProfile from the OAuth redirect params and pass them here. Use the X-Connect-Token header if connecting via API key.
1745
+ * Returns Facebook Pages after OAuth. Classic connections require profileId and tempToken from the OAuth redirect. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken, an encrypted grant valid for ten minutes. This requires the initiating user and current profile access and returns only Page IDs and names. X-Connect-Token cannot authorize business selection.
1743
1746
  */
1744
- export const listFacebookPages = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => {
1747
+ export const listFacebookPages = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<ListFacebookPagesData, ThrowOnError>) => {
1745
1748
  return (options?.client ?? client).get<ListFacebookPagesResponse, ListFacebookPagesError, ThrowOnError>({
1746
1749
  ...options,
1747
1750
  url: '/v1/connect/facebook/select-page'
@@ -1750,7 +1753,7 @@ export const listFacebookPages = <ThrowOnError extends boolean = false>(options:
1750
1753
 
1751
1754
  /**
1752
1755
  * Select Facebook page
1753
- * Complete the headless flow by saving the user's selected Facebook page. Pass the userProfile from the OAuth redirect and use X-Connect-Token if connecting via API key.
1756
+ * Complete a classic Facebook Page connection with profileId, pageId, tempToken and userProfile. Use X-Connect-Token for headless connections. The dashboard business-login picker instead sends only selectionToken and pageId to complete a Meta Ads connection. The server verifies the initiating user, profile access, current grants and connection eligibility. The profile, platform token, ad-account scope and return URL come only from the encrypted grant. Business selection requires a session or bearer authentication for the initiating user; X-Connect-Token is not accepted. It returns redirect_url with connected=metaads on success or an eligibility error redirect.
1754
1757
  */
1755
1758
  export const selectFacebookPage = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SelectFacebookPageData, ThrowOnError>) => {
1756
1759
  return (options?.client ?? client).post<SelectFacebookPageResponse, SelectFacebookPageError, ThrowOnError>({
@@ -15103,15 +15103,19 @@ export type ConfigureTikTokAdsBrandIdentityError = (unknown | {
15103
15103
  });
15104
15104
 
15105
15105
  export type ListFacebookPagesData = {
15106
- query: {
15106
+ query?: {
15107
15107
  /**
15108
- * Profile ID from your connection flow
15108
+ * Profile ID from your classic connection flow. Required with tempToken.
15109
15109
  */
15110
- profileId: string;
15110
+ profileId?: string;
15111
15111
  /**
15112
- * Temporary Facebook access token from the OAuth callback redirect
15112
+ * Encrypted dashboard business-login grant. Send alone instead of profileId and tempToken. Expires after ten minutes.
15113
15113
  */
15114
- tempToken: string;
15114
+ selectionToken?: string;
15115
+ /**
15116
+ * Temporary Facebook access token from the classic OAuth callback. Required with profileId.
15117
+ */
15118
+ tempToken?: string;
15115
15119
  };
15116
15120
  };
15117
15121
 
@@ -15149,38 +15153,47 @@ export type ListFacebookPagesError = (unknown | {
15149
15153
  });
15150
15154
 
15151
15155
  export type SelectFacebookPageData = {
15152
- body: {
15153
- /**
15154
- * Profile ID from your connection flow
15155
- */
15156
- profileId: string;
15157
- /**
15158
- * The Facebook Page ID selected by the user
15159
- */
15160
- pageId: string;
15161
- /**
15162
- * Temporary Facebook access token from OAuth
15163
- */
15164
- tempToken: string;
15165
- /**
15166
- * Decoded user profile object from the OAuth callback
15167
- */
15168
- userProfile: {
15169
- id?: string;
15170
- name?: string;
15171
- profilePicture?: string;
15172
- };
15173
- /**
15174
- * Optional custom redirect URL to return to after selection
15175
- */
15176
- redirect_url?: string;
15156
+ body: ({
15157
+ /**
15158
+ * Profile ID from your classic connection flow.
15159
+ */
15160
+ profileId: string;
15161
+ /**
15162
+ * The Facebook Page ID selected by the user.
15163
+ */
15164
+ pageId: string;
15165
+ /**
15166
+ * Temporary Facebook access token from OAuth.
15167
+ */
15168
+ tempToken: string;
15169
+ /**
15170
+ * Decoded user profile object from the OAuth callback.
15171
+ */
15172
+ userProfile: {
15173
+ id?: string;
15174
+ name?: string;
15175
+ profilePicture?: string;
15177
15176
  };
15177
+ /**
15178
+ * Optional custom redirect URL to return to after selection.
15179
+ */
15180
+ redirect_url?: string;
15181
+ } | {
15182
+ /**
15183
+ * Encrypted dashboard business-login grant. Expires after ten minutes.
15184
+ */
15185
+ selectionToken: string;
15186
+ /**
15187
+ * A Page ID from the granted Pages returned by listFacebookPages.
15188
+ */
15189
+ pageId: string;
15190
+ });
15178
15191
  };
15179
15192
 
15180
15193
  export type SelectFacebookPageResponse = ({
15181
15194
  message?: string;
15182
15195
  /**
15183
- * Redirect URL if custom redirect_url was provided
15196
+ * Redirect URL when a custom redirect_url was provided or a business Page was selected.
15184
15197
  */
15185
15198
  redirect_url?: string;
15186
15199
  account?: {