@getlatedev/node 0.2.1105 → 0.2.1106

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.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: "@getlatedev/node",
8
- version: "0.2.1105",
8
+ version: "0.2.1106",
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": "@getlatedev/node",
3
- "version": "0.2.1105",
3
+ "version": "0.2.1106",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -10334,6 +10334,14 @@ export type SocialAccount = {
10334
10334
  profileId: (string | Profile);
10335
10335
  username?: string;
10336
10336
  displayName?: string;
10337
+ /**
10338
+ * The account's id on its platform as the platform reports it to Zernio; stable across reconnects, so it is the key to match an account against your own records. Instagram: the app-scoped user id on Instagram Login accounts (the professional account id is in `metadata.instagramScopedId`), the professional account id (`17841...`) on Facebook Login accounts. TikTok: the open_id of Zernio's TikTok app, which differs from the open_id any other app sees for the same user. Either value can be passed back as `expectedPlatformUserId` on GET /v1/connect/{platform}.
10339
+ */
10340
+ platformUserId?: string;
10341
+ /**
10342
+ * TikTok accounts only. The account type TikTok reported when the account was connected. `personal` accounts cannot use TikTok direct messages through the API (TikTok limits Business Messaging to Business Accounts): skip the inbox for them and tell the user to switch to a Business Account in the TikTok app, then reconnect. `business` is the prerequisite, not a guarantee; messaging also needs the messaging scopes granted and TikTok's regional availability. `unknown` on accounts connected before this was captured or whose grant left out the account-type scope.
10343
+ */
10344
+ tiktokAccountType?: 'business' | 'personal' | 'unknown';
10337
10345
  /**
10338
10346
  * URL to the account's profile picture on the platform. May be null if the platform does not provide one.
10339
10347
  */
@@ -10402,6 +10410,7 @@ export type SocialAccount = {
10402
10410
  *
10403
10411
  * For Instagram accounts:
10404
10412
  * - loginMethod: "facebook_login" when the account was connected through Facebook Login. Absent on accounts connected with Instagram Login. On facebook_login accounts, comment reads leave hidden comments out entirely instead of returning them with isHidden true.
10413
+ * - instagramScopedId: the Instagram professional account id (`17841...`). On Instagram Login accounts this is the id that is the same whichever app connected the account, while platformUserId is app-scoped; Facebook Login accounts hold this id as platformUserId.
10405
10414
  *
10406
10415
  * For X (Twitter) accounts:
10407
10416
  * - profileData.extraData.isPremium: Whether X reports a paid subscription (Basic, Premium, Premium+, or a blue verified badge), which raises the post length limit from 280 to 25,000 characters. Read live at connect and reconnect and refreshed by the daily follower snapshot; because X intermittently reports no subscription for subscribed accounts, a cancellation is stored on the fourth consecutive daily snapshot that reports it (about four days). Accounts connected before the extraData layout carry the same flag at profileData.isPremium.
@@ -10414,6 +10423,11 @@ export type SocialAccount = {
10414
10423
 
10415
10424
  export type platform11 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'slack' | 'whatsapp' | 'shopify' | 'wordpress' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads' | 'openaiads' | 'sms' | 'phone' | 'rcs' | 'whopads';
10416
10425
 
10426
+ /**
10427
+ * TikTok accounts only. The account type TikTok reported when the account was connected. `personal` accounts cannot use TikTok direct messages through the API (TikTok limits Business Messaging to Business Accounts): skip the inbox for them and tell the user to switch to a Business Account in the TikTok app, then reconnect. `business` is the prerequisite, not a guarantee; messaging also needs the messaging scopes granted and TikTok's regional availability. `unknown` on accounts connected before this was captured or whose grant left out the account-type scope.
10428
+ */
10429
+ export type tiktokAccountType = 'business' | 'personal' | 'unknown';
10430
+
10417
10431
  /**
10418
10432
  * A tracking tag's install on a connected store: a Shopify web pixel, or a Custom HTML widget on a WordPress site. Fields marked Shopify or WordPress are present only for that platform.
10419
10433
  */
@@ -19887,6 +19901,14 @@ export type GetConnectUrlData = {
19887
19901
  * Hosted signup page only (`signup=hosted`, WhatsApp): name shown in the page title ("Connect your WhatsApp number to <brandName>") instead of Zernio. The Zernio logo stays: the page is co-branded, not white-label. Trimmed; 1 to 60 characters. Rejected with 400 `INVALID_FIELD_VALUE` without `signup=hosted`. Stored on the signup session at issue time, so the page URL cannot change it.
19888
19902
  */
19889
19903
  brandName?: string;
19904
+ /**
19905
+ * Only connect if the login lands on this platform account; any other account ends the flow with `error=account_mismatch` (a 409 `account_mismatch` on POST /v1/connect/instagram/select-account) and nothing is written. Compared with every id the platform reports for the authorized account: the `platformUserId` of a Zernio account on this platform, or on Instagram either the app-scoped id or the professional account id (`metadata.instagramScopedId`, the `17841...` id that Facebook Login accounts hold as platformUserId). TikTok open_ids are app-scoped, so an id from your own TikTok app never matches; use expectedUsername there. Honoured by the OAuth callback (every platform that connects without a selection step, Instagram Login included) and by the Instagram selection step; on the other selection endpoints you choose the destination yourself. In headless mode the marker travels in the redirect_url we hand you, so pass that URL back unchanged. On X it counts toward the OAuth state limit described under redirect_url.
19906
+ */
19907
+ expectedPlatformUserId?: string;
19908
+ /**
19909
+ * Only connect if the authorized account's handle is this one (case-insensitive, a leading @ is ignored); otherwise the flow ends with `error=account_mismatch`, `error_message` naming the handle that was authorized, and nothing is written. Same coverage and transport as expectedPlatformUserId; when both are sent both must match. Use this on a first connection, where you hold the handle the user typed but no Zernio id yet.
19910
+ */
19911
+ expectedUsername?: string;
19890
19912
  /**
19891
19913
  * When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Zernio's default account selection UI. Use this to build a custom connect experience.
19892
19914
  */
@@ -19937,7 +19959,7 @@ export type GetConnectUrlData = {
19937
19959
  * `dashboard_url`, `missing_scopes`, `error_reason` and the `platform_error*` params are
19938
19960
  * conditional and must be treated as optional. Your own query params are kept on every
19939
19961
  * redirect, but ours overwrite a param of yours with the same name. On an error redirect the
19940
- * internal `headless`, `adsConnect`, `adsScope` and `reconnectAccountId` markers we add during the flow are removed.
19962
+ * internal `headless`, `adsConnect`, `adsScope`, `reconnectAccountId`, `expectedPlatformUserId` and `expectedUsername` markers we add during the flow are removed.
19941
19963
  *
19942
19964
  * Correlation (every redirect from an OAuth callback, success and failure, and the
19943
19965
  * `redirect_url` returned by the selection endpoints such as POST /v1/connect/facebook/select-page):
@@ -19990,7 +20012,7 @@ export type GetConnectUrlData = {
19990
20012
  * oauth_denied, invalid_callback, invalid_state, unsupported_platform, connection_failed,
19991
20013
  * internal_error, token_exchange_failed, byok_config_error, personal_account_not_supported,
19992
20014
  * missing_google_permissions, missing_tiktok_permissions, platform_requires_destination,
19993
- * reconnect_account_mismatch, instagram_login_method_mismatch, invalid_request,
20015
+ * reconnect_account_mismatch, account_mismatch, instagram_login_method_mismatch, invalid_request,
19994
20016
  * code_already_redeemed
19995
20017
  *
19996
20018
  * Access and limits: