@happyvertical/smrt-social 0.57.39 → 0.57.41

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.js CHANGED
@@ -4,7 +4,7 @@ import { TenantScoped, getCurrentTenant, tenantId, withTenant } from "@happyvert
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { SecretService } from "@happyvertical/smrt-secrets";
6
6
  //#region src/__smrt-register__.ts
7
- ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-social","packageVersion":"0.57.39","objects":{"@happyvertical/smrt-social:OAuthState":{"name":"oauthstate","className":"OAuthState","qualifiedName":"@happyvertical/smrt-social:OAuthState","collection":"oauthstates","description":"Temporary OAuth state for social account connection","filePath":"/home/runner/work/smrt/smrt/packages/social/src/oauth-state.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"platform":{"type":"text","required":false,"default":"youtube","enum":["youtube","threads","x","bluesky","facebook"]},"state":{"type":"text","required":false,"default":""},"codeVerifier":{"type":"text","required":false},"redirectUri":{"type":"text","required":false,"default":""},"scopes":{"type":"json","required":false,"default":[]},"expiresAt":{"type":"datetime","required":false},"createdByUserId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-users:User"},"returnTo":{"type":"text","required":false}},"methods":{"verifyState":{"name":"verifyState","async":false,"parameters":[{"name":"callbackState","type":"string","optional":false}],"returnType":"boolean","isStatic":false,"isPublic":true},"generateState":{"name":"generateState","async":false,"parameters":[],"returnType":"string","isStatic":true,"isPublic":true},"generateCodeVerifier":{"name":"generateCodeVerifier","async":false,"parameters":[],"returnType":"string","isStatic":true,"isPublic":true},"generateCodeChallenge":{"name":"generateCodeChallenge","async":true,"parameters":[{"name":"verifier","type":"string","optional":false}],"returnType":"Promise<string>","isStatic":true,"isPublic":true}},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","delete"]},"mcp":false,"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"OAuthState","collectionExportName":"OAuthStateCollection","schema":{"tableName":"oauth_states","ddl":"CREATE TABLE IF NOT EXISTS \\"oauth_states\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"state\\" TEXT DEFAULT '',\\n \\"code_verifier\\" TEXT,\\n \\"redirect_uri\\" TEXT DEFAULT '',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"expires_at\\" TIMESTAMP,\\n \\"created_by_user_id\\" UUID,\\n \\"return_to\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"state":{"type":"TEXT","notNull":false,"default":""},"code_verifier":{"type":"TEXT","notNull":false},"redirect_uri":{"type":"TEXT","notNull":false,"default":""},"scopes":{"type":"JSON","notNull":false,"default":[]},"expires_at":{"type":"TIMESTAMP","notNull":false},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"return_to":{"type":"TEXT","notNull":false}},"indexes":[{"name":"oauth_states_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"oauth_states_meta_type_idx","columns":["_meta_type"]},{"name":"oauth_states_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"oauth_states_created_by_user_id_idx","columns":["created_by_user_id"]}],"version":"ca0ff7c5"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialAccount":{"name":"socialaccount","className":"SocialAccount","qualifiedName":"@happyvertical/smrt-social:SocialAccount","collection":"socialaccounts","description":"Connected social media account for publishing","filePath":"/home/runner/work/smrt/smrt/packages/social/src/social-account.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"name":{"type":"text","required":false,"default":"","description":"A name you will recognise this account by.","_meta":{"description":"A name you will recognise this account by."}},"platform":{"type":"text","required":false,"default":"youtube","description":"Which platform it is on: YouTube, X, Threads or Bluesky.","_meta":{"description":"Which platform it is on: YouTube, X, Threads or Bluesky."},"enum":["youtube","threads","x","bluesky","facebook"]},"platformUserId":{"type":"text","required":false},"platformUsername":{"type":"text","required":false,"description":"The username or handle you post under.","_meta":{"description":"The username or handle you post under."}},"platformUrl":{"type":"text","required":false,"description":"The web address of your profile on the platform.","_meta":{"description":"The web address of your profile on the platform."}},"accessToken":{"type":"text","required":false},"refreshToken":{"type":"text","required":false},"credentialSecretId":{"type":"text","required":false},"accessTokenSecretName":{"type":"text","required":false},"refreshTokenSecretName":{"type":"text","required":false},"tokenExpiresAt":{"type":"datetime","required":false},"isActive":{"type":"boolean","required":false,"default":true,"description":"Whether posts can still go out from this account.","_meta":{"description":"Whether posts can still go out from this account."}},"defaultHashtags":{"type":"json","required":false,"default":[],"description":"Hashtags added to every post from this account.","_meta":{"description":"Hashtags added to every post from this account."}},"scopes":{"type":"json","required":false,"default":[]},"missingPermissions":{"type":"json","required":false,"default":[]},"linkBehavior":{"type":"text","required":false,"default":"description","description":"Where a shared link goes: in the text, as a reply, or left out.","_meta":{"description":"Where a shared link goes: in the text, as a reply, or left out."},"enum":["description","inline","attachment","reply","none"]},"publishMode":{"type":"text","required":false,"default":"dry_run","enum":["dry_run","stage_remote","private_or_scheduled","public"]},"publicPublishingAllowed":{"type":"boolean","required":false,"default":false},"status":{"type":"text","required":false,"default":"connected","description":"Whether the account is connected, or needs signing in again.","_meta":{"description":"Whether the account is connected, or needs signing in again."},"enum":["connected","disconnected","expired","missing_permissions","error"]},"errorMessage":{"type":"text","required":false}},"methods":{"getSlug":{"name":"getSlug","async":true,"parameters":[],"returnType":"Promise<string | null | undefined>","isStatic":false,"isPublic":true},"setCredentials":{"name":"setCredentials","async":true,"parameters":[{"name":"credentials","type":"Record<string, unknown>","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["string"]}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"getCredentials":{"name":"getCredentials","async":true,"parameters":[],"returnType":"Promise<Record<string, unknown> | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"SocialAccount","collectionExportName":"SocialAccountCollection","displayLabelField":"name","schema":{"tableName":"social_accounts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_accounts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"platform_user_id\\" TEXT,\\n \\"platform_username\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"access_token\\" TEXT,\\n \\"refresh_token\\" TEXT,\\n \\"credential_secret_id\\" TEXT,\\n \\"access_token_secret_name\\" TEXT,\\n \\"refresh_token_secret_name\\" TEXT,\\n \\"token_expires_at\\" TIMESTAMP,\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"default_hashtags\\" JSON DEFAULT '[]',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"missing_permissions\\" JSON DEFAULT '[]',\\n \\"link_behavior\\" TEXT DEFAULT 'description',\\n \\"publish_mode\\" TEXT DEFAULT 'dry_run',\\n \\"public_publishing_allowed\\" BOOLEAN DEFAULT FALSE,\\n \\"status\\" TEXT DEFAULT 'connected',\\n \\"error_message\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"name":{"type":"TEXT","notNull":false,"default":""},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"platform_user_id":{"type":"TEXT","notNull":false},"platform_username":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"access_token":{"type":"TEXT","notNull":false},"refresh_token":{"type":"TEXT","notNull":false},"credential_secret_id":{"type":"TEXT","notNull":false},"access_token_secret_name":{"type":"TEXT","notNull":false},"refresh_token_secret_name":{"type":"TEXT","notNull":false},"token_expires_at":{"type":"TIMESTAMP","notNull":false},"is_active":{"type":"BOOLEAN","notNull":false,"default":true},"default_hashtags":{"type":"JSON","notNull":false,"default":[]},"scopes":{"type":"JSON","notNull":false,"default":[]},"missing_permissions":{"type":"JSON","notNull":false,"default":[]},"link_behavior":{"type":"TEXT","notNull":false,"default":"description"},"publish_mode":{"type":"TEXT","notNull":false,"default":"dry_run"},"public_publishing_allowed":{"type":"BOOLEAN","notNull":false,"default":false},"status":{"type":"TEXT","notNull":false,"default":"connected"},"error_message":{"type":"TEXT","notNull":false}},"indexes":[{"name":"social_accounts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_accounts_meta_type_idx","columns":["_meta_type"]},{"name":"social_accounts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0c175da6"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot":{"name":"socialpostanalyticssnapshot","className":"SocialPostAnalyticsSnapshot","qualifiedName":"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot","collection":"socialpostanalyticssnapshots","filePath":"/home/runner/work/smrt/smrt/packages/social/src/social-post-analytics-snapshot.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"socialPostId":{"type":"foreignKey","required":false,"related":"SocialPost","description":"The post these numbers are for.","_meta":{"description":"The post these numbers are for."}},"platform":{"type":"text","required":true,"description":"The platform that reported the numbers.","_meta":{"required":true,"description":"The platform that reported the numbers."},"enum":["youtube","threads","x","bluesky","facebook"]},"analytics":{"type":"json","required":false,"description":"The views, likes, comments, shares and clicks the platform reported.","_meta":{"description":"The views, likes, comments, shares and clicks the platform reported."}},"raw":{"type":"json","required":false,"_meta":{"nullable":true}},"capturedAt":{"type":"datetime","required":false,"description":"When these numbers were taken from the platform.","_meta":{"description":"When these numbers were taken from the platform."}}},"methods":{},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","delete"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"SocialPostAnalyticsSnapshot","collectionExportName":"SocialPostAnalyticsSnapshotCollection","validationRules":[{"field":"platform","rule":"required","fieldType":"text"}],"schema":{"tableName":"social_post_analytics_snapshots","ddl":"CREATE TABLE IF NOT EXISTS \\"social_post_analytics_snapshots\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_post_id\\" UUID,\\n \\"platform\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"raw\\" JSON,\\n \\"captured_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_post_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_posts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"platform":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"raw":{"type":"JSON","notNull":false},"captured_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_post_analytics_snapshots_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_post_analytics_snapshots_meta_type_idx","columns":["_meta_type"]},{"name":"social_post_analytics_snapshots_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_post_analytics_snapshots_social_post_id_idx","columns":["social_post_id"]}],"version":"bd17983d"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPost":{"name":"socialpost","className":"SocialPost","qualifiedName":"@happyvertical/smrt-social:SocialPost","collection":"socialposts","description":"Social media post for multi-platform publishing","filePath":"/home/runner/work/smrt/smrt/packages/social/src/social-post.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"socialAccountId":{"type":"foreignKey","required":false,"related":"SocialAccount","description":"The connected account this post goes out from.","_meta":{"description":"The connected account this post goes out from."}},"createdByUserId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-users:User"},"videoContentId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-video:VideoContent"},"contentId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-content:Content"},"postType":{"type":"text","required":false,"default":"text","description":"What kind of post it is: text, link, image or video.","_meta":{"description":"What kind of post it is: text, link, image or video."},"enum":["text","link","image","video"]},"mediaUrl":{"type":"text","required":false},"title":{"type":"text","required":false,"description":"A title, for platforms that show one.","_meta":{"description":"A title, for platforms that show one."}},"description":{"type":"text","required":false,"default":"","description":"The words of the post.","_meta":{"description":"The words of the post."}},"hashtags":{"type":"json","required":false,"default":[],"description":"Hashtags added to the end of the post.","_meta":{"description":"Hashtags added to the end of the post."}},"linkUrl":{"type":"text","required":false,"description":"A web address to share with the post.","_meta":{"description":"A web address to share with the post."}},"platformPostId":{"type":"text","required":false},"platformUrl":{"type":"text","required":false,"description":"Where the post can be seen on the platform, once it is out.","_meta":{"description":"Where the post can be seen on the platform, once it is out."}},"scheduledAt":{"type":"datetime","required":false,"description":"The date and time you have in mind for putting the post out. Only a note of the plan: publishing is a separate step your application has to run.","_meta":{"description":"The date and time you have in mind for putting the post out. Only a note of the plan: publishing is a separate step your application has to run."}},"publishedAt":{"type":"datetime","required":false,"description":"When the post actually went out.","_meta":{"description":"When the post actually went out."}},"status":{"type":"text","required":false,"default":"draft","description":"Where the post stands: draft, waiting to go out, published or failed.","_meta":{"description":"Where the post stands: draft, waiting to go out, published or failed."},"enum":["draft","pending_approval","approved","scheduled","publishing","dry_run","staged","published","failed","cancelled"]},"errorMessage":{"type":"text","required":false},"analytics":{"type":"json","required":false},"analyticsLastSyncedAt":{"type":"datetime","required":false}},"methods":{},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"SocialPost","collectionExportName":"SocialPostCollection","displayLabelField":"title","schema":{"tableName":"social_posts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_posts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_account_id\\" UUID,\\n \\"created_by_user_id\\" UUID,\\n \\"video_content_id\\" UUID,\\n \\"content_id\\" UUID,\\n \\"post_type\\" TEXT DEFAULT 'text',\\n \\"media_url\\" TEXT,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT DEFAULT '',\\n \\"hashtags\\" JSON DEFAULT '[]',\\n \\"link_url\\" TEXT,\\n \\"platform_post_id\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"scheduled_at\\" TIMESTAMP,\\n \\"published_at\\" TIMESTAMP,\\n \\"status\\" TEXT DEFAULT 'draft',\\n \\"error_message\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"analytics_last_synced_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_account_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_accounts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"video_content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"post_type":{"type":"TEXT","notNull":false,"default":"text"},"media_url":{"type":"TEXT","notNull":false},"title":{"type":"TEXT","notNull":false},"description":{"type":"TEXT","notNull":false,"default":""},"hashtags":{"type":"JSON","notNull":false,"default":[]},"link_url":{"type":"TEXT","notNull":false},"platform_post_id":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"scheduled_at":{"type":"TIMESTAMP","notNull":false},"published_at":{"type":"TIMESTAMP","notNull":false},"status":{"type":"TEXT","notNull":false,"default":"draft"},"error_message":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"analytics_last_synced_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_posts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_posts_meta_type_idx","columns":["_meta_type"]},{"name":"social_posts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_posts_social_account_id_idx","columns":["social_account_id"]},{"name":"social_posts_created_by_user_id_idx","columns":["created_by_user_id"]},{"name":"social_posts_video_content_id_idx","columns":["video_content_id"]},{"name":"social_posts_content_id_idx","columns":["content_id"]}],"version":"cfb50b15"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:OAuthStateCollection":{"name":"oauthstatecollection","className":"OAuthStateCollection","qualifiedName":"@happyvertical/smrt-social:OAuthStateCollection","collection":"oauthstates","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/oauth-state-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"findByState":{"name":"findByState","async":true,"parameters":[{"name":"state","type":"string","optional":false}],"returnType":"Promise<OAuthState | null>","isStatic":false,"isPublic":true},"consume":{"name":"consume","async":true,"parameters":[{"name":"state","type":"OAuthState","optional":false}],"returnType":"Promise<boolean>","isStatic":false,"isPublic":true},"findExpired":{"name":"findExpired","async":true,"parameters":[{"name":"now","type":"Date","optional":true}],"returnType":"Promise<OAuthState[]>","isStatic":false,"isPublic":true},"deleteExpired":{"name":"deleteExpired","async":true,"parameters":[{"name":"now","type":"Date","optional":true}],"returnType":"Promise<number>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","delete"]},"mcp":false},"extends":"SmrtCollection","extendsTypeArg":"OAuthState","exportName":"OAuthStateCollection","collectionExportName":"OAuthStateCollectionCollection","schema":{"tableName":"oauth_states","ddl":"CREATE TABLE IF NOT EXISTS \\"oauth_states\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"state\\" TEXT DEFAULT '',\\n \\"code_verifier\\" TEXT,\\n \\"redirect_uri\\" TEXT DEFAULT '',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"expires_at\\" TIMESTAMP,\\n \\"created_by_user_id\\" UUID,\\n \\"return_to\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"state":{"type":"TEXT","notNull":false,"default":""},"code_verifier":{"type":"TEXT","notNull":false},"redirect_uri":{"type":"TEXT","notNull":false,"default":""},"scopes":{"type":"JSON","notNull":false,"default":[]},"expires_at":{"type":"TIMESTAMP","notNull":false},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"return_to":{"type":"TEXT","notNull":false}},"indexes":[{"name":"oauth_states_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"oauth_states_meta_type_idx","columns":["_meta_type"]},{"name":"oauth_states_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"oauth_states_created_by_user_id_idx","columns":["created_by_user_id"]}],"version":"ca0ff7c5"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialAccountCollection":{"name":"socialaccountcollection","className":"SocialAccountCollection","qualifiedName":"@happyvertical/smrt-social:SocialAccountCollection","collection":"socialaccounts","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/social-account-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"findActive":{"name":"findActive","async":true,"parameters":[{"name":"platform","type":"SocialPlatformType","optional":true}],"returnType":"Promise<SocialAccount[]>","isStatic":false,"isPublic":true},"findReady":{"name":"findReady","async":true,"parameters":[{"name":"platform","type":"SocialPlatformType","optional":true}],"returnType":"Promise<SocialAccount[]>","isStatic":false,"isPublic":true},"findNeedsAttention":{"name":"findNeedsAttention","async":true,"parameters":[],"returnType":"Promise<SocialAccount[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SocialAccount","exportName":"SocialAccountCollection","collectionExportName":"SocialAccountCollectionCollection","schema":{"tableName":"social_accounts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_accounts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"platform_user_id\\" TEXT,\\n \\"platform_username\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"access_token\\" TEXT,\\n \\"refresh_token\\" TEXT,\\n \\"credential_secret_id\\" TEXT,\\n \\"access_token_secret_name\\" TEXT,\\n \\"refresh_token_secret_name\\" TEXT,\\n \\"token_expires_at\\" TIMESTAMP,\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"default_hashtags\\" JSON DEFAULT '[]',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"missing_permissions\\" JSON DEFAULT '[]',\\n \\"link_behavior\\" TEXT DEFAULT 'description',\\n \\"publish_mode\\" TEXT DEFAULT 'dry_run',\\n \\"public_publishing_allowed\\" BOOLEAN DEFAULT FALSE,\\n \\"status\\" TEXT DEFAULT 'connected',\\n \\"error_message\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"name":{"type":"TEXT","notNull":false,"default":""},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"platform_user_id":{"type":"TEXT","notNull":false},"platform_username":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"access_token":{"type":"TEXT","notNull":false},"refresh_token":{"type":"TEXT","notNull":false},"credential_secret_id":{"type":"TEXT","notNull":false},"access_token_secret_name":{"type":"TEXT","notNull":false},"refresh_token_secret_name":{"type":"TEXT","notNull":false},"token_expires_at":{"type":"TIMESTAMP","notNull":false},"is_active":{"type":"BOOLEAN","notNull":false,"default":true},"default_hashtags":{"type":"JSON","notNull":false,"default":[]},"scopes":{"type":"JSON","notNull":false,"default":[]},"missing_permissions":{"type":"JSON","notNull":false,"default":[]},"link_behavior":{"type":"TEXT","notNull":false,"default":"description"},"publish_mode":{"type":"TEXT","notNull":false,"default":"dry_run"},"public_publishing_allowed":{"type":"BOOLEAN","notNull":false,"default":false},"status":{"type":"TEXT","notNull":false,"default":"connected"},"error_message":{"type":"TEXT","notNull":false}},"indexes":[{"name":"social_accounts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_accounts_meta_type_idx","columns":["_meta_type"]},{"name":"social_accounts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0c175da6"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection":{"name":"socialpostanalyticssnapshotcollection","className":"SocialPostAnalyticsSnapshotCollection","qualifiedName":"@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection","collection":"socialpostanalyticssnapshots","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/social-post-analytics-snapshot-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"recordSnapshot":{"name":"recordSnapshot","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["string","SocialPlatformType","PostAnalytics","RawAnalyticsPayload","Date","string | null"]}],"returnType":"Promise<SocialPostAnalyticsSnapshot>","isStatic":false,"isPublic":true},"findForPost":{"name":"findForPost","async":true,"parameters":[{"name":"socialPostId","type":"string","optional":false}],"returnType":"Promise<SocialPostAnalyticsSnapshot[]>","isStatic":false,"isPublic":true},"findLatestForPost":{"name":"findLatestForPost","async":true,"parameters":[{"name":"socialPostId","type":"string","optional":false}],"returnType":"Promise<SocialPostAnalyticsSnapshot | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","delete"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SocialPostAnalyticsSnapshot","exportName":"SocialPostAnalyticsSnapshotCollection","collectionExportName":"SocialPostAnalyticsSnapshotCollectionCollection","schema":{"tableName":"social_post_analytics_snapshots","ddl":"CREATE TABLE IF NOT EXISTS \\"social_post_analytics_snapshots\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_post_id\\" UUID,\\n \\"platform\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"raw\\" JSON,\\n \\"captured_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_post_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_posts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"platform":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"raw":{"type":"JSON","notNull":false},"captured_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_post_analytics_snapshots_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_post_analytics_snapshots_meta_type_idx","columns":["_meta_type"]},{"name":"social_post_analytics_snapshots_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_post_analytics_snapshots_social_post_id_idx","columns":["social_post_id"]}],"version":"bd17983d"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPostCollection":{"name":"socialpostcollection","className":"SocialPostCollection","qualifiedName":"@happyvertical/smrt-social:SocialPostCollection","collection":"socialposts","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/social-post-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"createDraft":{"name":"createDraft","async":true,"parameters":[{"name":"options","type":"CreateSocialPostDraftOptions","optional":false}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"PostStatus","optional":false}],"returnType":"Promise<SocialPost[]>","isStatic":false,"isPublic":true},"findForAccount":{"name":"findForAccount","async":true,"parameters":[{"name":"socialAccountId","type":"string","optional":false}],"returnType":"Promise<SocialPost[]>","isStatic":false,"isPublic":true},"findDueForPublish":{"name":"findDueForPublish","async":true,"parameters":[{"name":"now","type":"Date","optional":true}],"returnType":"Promise<SocialPost[]>","isStatic":false,"isPublic":true},"recordPublishSuccess":{"name":"recordPublishSuccess","async":true,"parameters":[{"name":"post","type":"SocialPost","optional":false},{"name":"data","type":"PublishSuccessData","optional":false}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true},"recordPublishFailure":{"name":"recordPublishFailure","async":true,"parameters":[{"name":"post","type":"SocialPost","optional":false},{"name":"error","type":"Error | string","optional":false,"unionBranches":[{"type":"Error"},{"type":"string"}]}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true},"updateLatestAnalytics":{"name":"updateLatestAnalytics","async":true,"parameters":[{"name":"post","type":"SocialPost","optional":false},{"name":"analytics","type":"PostAnalytics","optional":false},{"name":"syncedAt","type":"Date","optional":true}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SocialPost","exportName":"SocialPostCollection","collectionExportName":"SocialPostCollectionCollection","schema":{"tableName":"social_posts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_posts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_account_id\\" UUID,\\n \\"created_by_user_id\\" UUID,\\n \\"video_content_id\\" UUID,\\n \\"content_id\\" UUID,\\n \\"post_type\\" TEXT DEFAULT 'text',\\n \\"media_url\\" TEXT,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT DEFAULT '',\\n \\"hashtags\\" JSON DEFAULT '[]',\\n \\"link_url\\" TEXT,\\n \\"platform_post_id\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"scheduled_at\\" TIMESTAMP,\\n \\"published_at\\" TIMESTAMP,\\n \\"status\\" TEXT DEFAULT 'draft',\\n \\"error_message\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"analytics_last_synced_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_account_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_accounts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"video_content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"post_type":{"type":"TEXT","notNull":false,"default":"text"},"media_url":{"type":"TEXT","notNull":false},"title":{"type":"TEXT","notNull":false},"description":{"type":"TEXT","notNull":false,"default":""},"hashtags":{"type":"JSON","notNull":false,"default":[]},"link_url":{"type":"TEXT","notNull":false},"platform_post_id":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"scheduled_at":{"type":"TIMESTAMP","notNull":false},"published_at":{"type":"TIMESTAMP","notNull":false},"status":{"type":"TEXT","notNull":false,"default":"draft"},"error_message":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"analytics_last_synced_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_posts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_posts_meta_type_idx","columns":["_meta_type"]},{"name":"social_posts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_posts_social_account_id_idx","columns":["social_account_id"]},{"name":"social_posts_created_by_user_id_idx","columns":["created_by_user_id"]},{"name":"social_posts_video_content_id_idx","columns":["video_content_id"]},{"name":"social_posts_content_id_idx","columns":["content_id"]}],"version":"cfb50b15"},"importPath":"@happyvertical/smrt-social"}},"moduleType":"smrt","recipes":[{"id":"social.posts","className":"SocialPostsRecipe","label":"Social","summary":"Write posts for your YouTube, X, Threads and Bluesky accounts, plan when they go out and see how each one did.","synonyms":["social media","social posts","social accounts","youtube","bluesky","threads","tweets","post results"],"models":["@happyvertical/smrt-social:SocialPost","@happyvertical/smrt-social:SocialAccount","@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"],"nav":[{"label":"Posts","model":"@happyvertical/smrt-social:SocialPost","icon":"fileText","description":"What you have written for each account and where it stands.","noun":"post"},{"label":"Connected accounts","model":"@happyvertical/smrt-social:SocialAccount","icon":"users","description":"The social accounts you can post to, and their settings.","noun":"account"}],"requires":[],"section":{"id":"publish","label":"Publish","icon":"fileText","description":"What you write, record and put out."},"options":{"@happyvertical/smrt-social:SocialPost":{"fields":{"socialAccountId":{"label":"Account","order":1},"title":{"order":2},"description":{"label":"Text","order":3},"hashtags":{"order":4},"linkUrl":{"label":"Link","order":5},"postType":{"label":"Kind of post","order":6},"scheduledAt":{"label":"Planned for","order":7},"status":{"locked":true,"order":8},"publishedAt":{"label":"Published on","locked":true,"order":9},"platformUrl":{"label":"Link to the post","locked":true,"order":10},"videoContentId":{"label":"Video","visibility":"advanced"},"contentId":{"label":"Content","visibility":"advanced"},"mediaUrl":{"label":"Media link","visibility":"advanced"},"errorMessage":{"label":"What went wrong","visibility":"advanced"},"analyticsLastSyncedAt":{"label":"Results last updated","visibility":"advanced"},"tenantId":{"visibility":"hidden"},"createdByUserId":{"visibility":"hidden"},"platformPostId":{"visibility":"hidden"},"analytics":{"visibility":"hidden"}}},"@happyvertical/smrt-social:SocialAccount":{"fields":{"name":{"order":1},"platform":{"order":2},"platformUsername":{"label":"Username","order":3},"platformUrl":{"label":"Profile link","order":4},"status":{"locked":true,"order":5},"isActive":{"label":"In use","order":6},"defaultHashtags":{"order":7},"linkBehavior":{"label":"Where links go","order":8},"publishMode":{"label":"Publishing mode","visibility":"advanced"},"publicPublishingAllowed":{"label":"Allow public posts","visibility":"advanced"},"platformUserId":{"visibility":"advanced"},"tokenExpiresAt":{"label":"Connection expires","visibility":"advanced"},"scopes":{"label":"Permissions granted","visibility":"advanced"},"missingPermissions":{"visibility":"advanced"},"errorMessage":{"label":"What went wrong","visibility":"advanced"},"tenantId":{"visibility":"hidden"},"accessToken":{"visibility":"hidden"},"refreshToken":{"visibility":"hidden"},"credentialSecretId":{"visibility":"hidden"},"accessTokenSecretName":{"visibility":"hidden"},"refreshTokenSecretName":{"visibility":"hidden"}}},"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot":{"fields":{"socialPostId":{"label":"Post","order":1},"platform":{"order":2},"capturedAt":{"label":"Measured on","order":3},"analytics":{"label":"Numbers","order":4},"tenantId":{"visibility":"hidden"},"raw":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nSocial is where you write what you want to put out on YouTube, X, Threads and\\nBluesky. Each post is written for one connected account, with its text,\\nhashtags and an optional link, and can carry the date you plan to put it out.\\nYour app does the publishing; once a post is out, the platform's numbers for it\\narrive here as post results.\\n\\n## Tasks\\n\\n### Connect an account\\n\\n1. Open the connected accounts and choose **New**.\\n2. Give it a **{field:SocialAccount.name}** you will recognise, such as \\"Acme Corp on Bluesky\\".\\n3. Pick the **{field:SocialAccount.platform}** and type the **{field:SocialAccount.platformUsername}** you post under.\\n4. Add any **{field:SocialAccount.defaultHashtags}** you want on every post from this account.\\n5. Save. Signing in to the platform itself happens from your app, not in this form; the **{field:SocialAccount.status}** shows whether the account is connected.\\n\\n### Write a post\\n\\n1. Open the posts and choose **New**.\\n2. Pick the **{field:SocialPost.socialAccountId}** it is for.\\n3. Write the **{field:SocialPost.description}** and add any **{field:SocialPost.hashtags}**.\\n4. Give it a **{field:SocialPost.title}** if the platform shows one, and a **{field:SocialPost.linkUrl}** if you are sharing a page.\\n5. Save. It stays a draft until your app puts it out.\\n\\n### Note when a post should go out\\n\\n1. Open the post and set **{field:SocialPost.scheduledAt}** to the date and time you have in mind.\\n2. Save. This only records the plan on the post. Nothing here publishes it: a post goes out only when your application's own publishing step approves it and sends it at that time, so check with whoever set up your app that this step is in place.\\n\\n### See where a post stands\\n\\nOpen the post. Its **{field:SocialPost.status}** shows whether it is a draft,\\nwaiting to go out, published or failed. Once it is out, **{field:SocialPost.publishedAt}**\\nand the **{field:SocialPost.platformUrl}** are filled in.\\n\\n### Change or remove a post\\n\\n1. Open the post and change what you need, then save.\\n2. To remove it, open the post and choose **Delete**.\\n\\n### See how a post did\\n\\nPost results are written by the platform sync, not by hand; you can only read\\nthem here.\\n\\n1. Open the post and look at its results, listed under the post.\\n2. Each result names the **{field:SocialPostAnalyticsSnapshot.socialPostId}** it belongs to and the **{field:SocialPostAnalyticsSnapshot.platform}** it ran on.\\n3. Each result shows the **{field:SocialPostAnalyticsSnapshot.analytics}** the platform reported and when they were **{field:SocialPostAnalyticsSnapshot.capturedAt}**, so the newest one is the latest count.\\n\\n### Stop using an account\\n\\n1. Open the account and untick **{field:SocialAccount.isActive}**, then save. Its posts stay, but nothing new goes out from it.\\n2. To remove it entirely, open the account and choose **Delete**.\\n","fieldRefs":["SocialAccount.defaultHashtags","SocialAccount.isActive","SocialAccount.name","SocialAccount.platform","SocialAccount.platformUsername","SocialAccount.status","SocialPost.description","SocialPost.hashtags","SocialPost.linkUrl","SocialPost.platformUrl","SocialPost.publishedAt","SocialPost.scheduledAt","SocialPost.socialAccountId","SocialPost.status","SocialPost.title","SocialPostAnalyticsSnapshot.analytics","SocialPostAnalyticsSnapshot.capturedAt","SocialPostAnalyticsSnapshot.platform","SocialPostAnalyticsSnapshot.socialPostId"]},"demo":{"mode":"server","reasons":["Needs a server because its package does not build for a browser: node:crypto; and its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-chat, @happyvertical/smrt-content, @happyvertical/smrt-images, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-tenancy, @happyvertical/smrt-users, @happyvertical/smrt-video, @happyvertical/smrt-voice, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627, #3628)."]}}],"smrtDependencies":["@happyvertical/smrt-content","@happyvertical/smrt-core","@happyvertical/smrt-secrets","@happyvertical/smrt-tenancy","@happyvertical/smrt-video"],"browser":{"status":"server-only","issues":["#3615","#3617","#3624","#3625","#3626","#3627","#3628"],"reason":"node:crypto","via":["@happyvertical/smrt-agents","@happyvertical/smrt-chat","@happyvertical/smrt-content","@happyvertical/smrt-images","@happyvertical/smrt-jobs","@happyvertical/smrt-profiles","@happyvertical/smrt-reports","@happyvertical/smrt-secrets","@happyvertical/smrt-tenancy","@happyvertical/smrt-users","@happyvertical/smrt-video","@happyvertical/smrt-voice"]},"stampsConstructors":true}`));
7
+ ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-social","packageVersion":"0.57.41","objects":{"@happyvertical/smrt-social:OAuthState":{"name":"oauthstate","className":"OAuthState","qualifiedName":"@happyvertical/smrt-social:OAuthState","collection":"oauthstates","description":"Temporary OAuth state for social account connection","filePath":"/home/runner/work/smrt/smrt/packages/social/src/oauth-state.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"platform":{"type":"text","required":false,"default":"youtube","enum":["youtube","threads","x","bluesky","facebook"]},"state":{"type":"text","required":false,"default":""},"codeVerifier":{"type":"text","required":false},"redirectUri":{"type":"text","required":false,"default":""},"scopes":{"type":"json","required":false,"default":[]},"expiresAt":{"type":"datetime","required":false},"createdByUserId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-users:User"},"returnTo":{"type":"text","required":false}},"methods":{"verifyState":{"name":"verifyState","async":false,"parameters":[{"name":"callbackState","type":"string","optional":false}],"returnType":"boolean","isStatic":false,"isPublic":true},"generateState":{"name":"generateState","async":false,"parameters":[],"returnType":"string","isStatic":true,"isPublic":true},"generateCodeVerifier":{"name":"generateCodeVerifier","async":false,"parameters":[],"returnType":"string","isStatic":true,"isPublic":true},"generateCodeChallenge":{"name":"generateCodeChallenge","async":true,"parameters":[{"name":"verifier","type":"string","optional":false}],"returnType":"Promise<string>","isStatic":true,"isPublic":true}},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","delete"]},"mcp":false,"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"OAuthState","collectionExportName":"OAuthStateCollection","schema":{"tableName":"oauth_states","ddl":"CREATE TABLE IF NOT EXISTS \\"oauth_states\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"state\\" TEXT DEFAULT '',\\n \\"code_verifier\\" TEXT,\\n \\"redirect_uri\\" TEXT DEFAULT '',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"expires_at\\" TIMESTAMP,\\n \\"created_by_user_id\\" UUID,\\n \\"return_to\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"state":{"type":"TEXT","notNull":false,"default":""},"code_verifier":{"type":"TEXT","notNull":false},"redirect_uri":{"type":"TEXT","notNull":false,"default":""},"scopes":{"type":"JSON","notNull":false,"default":[]},"expires_at":{"type":"TIMESTAMP","notNull":false},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"return_to":{"type":"TEXT","notNull":false}},"indexes":[{"name":"oauth_states_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"oauth_states_meta_type_idx","columns":["_meta_type"]},{"name":"oauth_states_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"oauth_states_created_by_user_id_idx","columns":["created_by_user_id"]}],"version":"ca0ff7c5"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialAccount":{"name":"socialaccount","className":"SocialAccount","qualifiedName":"@happyvertical/smrt-social:SocialAccount","collection":"socialaccounts","description":"Connected social media account for publishing","filePath":"/home/runner/work/smrt/smrt/packages/social/src/social-account.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"name":{"type":"text","required":false,"default":"","description":"A name you will recognise this account by.","_meta":{"description":"A name you will recognise this account by."}},"platform":{"type":"text","required":false,"default":"youtube","description":"Which platform it is on: YouTube, X, Threads or Bluesky.","_meta":{"description":"Which platform it is on: YouTube, X, Threads or Bluesky."},"enum":["youtube","threads","x","bluesky","facebook"]},"platformUserId":{"type":"text","required":false},"platformUsername":{"type":"text","required":false,"description":"The username or handle you post under.","_meta":{"description":"The username or handle you post under."}},"platformUrl":{"type":"text","required":false,"description":"The web address of your profile on the platform.","_meta":{"description":"The web address of your profile on the platform."}},"accessToken":{"type":"text","required":false},"refreshToken":{"type":"text","required":false},"credentialSecretId":{"type":"text","required":false},"accessTokenSecretName":{"type":"text","required":false},"refreshTokenSecretName":{"type":"text","required":false},"tokenExpiresAt":{"type":"datetime","required":false},"isActive":{"type":"boolean","required":false,"default":true,"description":"Whether posts can still go out from this account.","_meta":{"description":"Whether posts can still go out from this account."}},"defaultHashtags":{"type":"json","required":false,"default":[],"description":"Hashtags added to every post from this account.","_meta":{"description":"Hashtags added to every post from this account."}},"scopes":{"type":"json","required":false,"default":[]},"missingPermissions":{"type":"json","required":false,"default":[]},"linkBehavior":{"type":"text","required":false,"default":"description","description":"Where a shared link goes: in the text, as a reply, or left out.","_meta":{"description":"Where a shared link goes: in the text, as a reply, or left out."},"enum":["description","inline","attachment","reply","none"]},"publishMode":{"type":"text","required":false,"default":"dry_run","enum":["dry_run","stage_remote","private_or_scheduled","public"]},"publicPublishingAllowed":{"type":"boolean","required":false,"default":false},"status":{"type":"text","required":false,"default":"connected","description":"Whether the account is connected, or needs signing in again.","_meta":{"description":"Whether the account is connected, or needs signing in again."},"enum":["connected","disconnected","expired","missing_permissions","error"]},"errorMessage":{"type":"text","required":false}},"methods":{"getSlug":{"name":"getSlug","async":true,"parameters":[],"returnType":"Promise<string | null | undefined>","isStatic":false,"isPublic":true},"setCredentials":{"name":"setCredentials","async":true,"parameters":[{"name":"credentials","type":"Record<string, unknown>","optional":false},{"name":"options","type":"object","optional":true,"memberTypes":["string"]}],"returnType":"Promise<void>","isStatic":false,"isPublic":true},"getCredentials":{"name":"getCredentials","async":true,"parameters":[],"returnType":"Promise<Record<string, unknown> | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":{"skipApiCheck":true},"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"SocialAccount","collectionExportName":"SocialAccountCollection","displayLabelField":"name","schema":{"tableName":"social_accounts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_accounts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"platform_user_id\\" TEXT,\\n \\"platform_username\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"access_token\\" TEXT,\\n \\"refresh_token\\" TEXT,\\n \\"credential_secret_id\\" TEXT,\\n \\"access_token_secret_name\\" TEXT,\\n \\"refresh_token_secret_name\\" TEXT,\\n \\"token_expires_at\\" TIMESTAMP,\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"default_hashtags\\" JSON DEFAULT '[]',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"missing_permissions\\" JSON DEFAULT '[]',\\n \\"link_behavior\\" TEXT DEFAULT 'description',\\n \\"publish_mode\\" TEXT DEFAULT 'dry_run',\\n \\"public_publishing_allowed\\" BOOLEAN DEFAULT FALSE,\\n \\"status\\" TEXT DEFAULT 'connected',\\n \\"error_message\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"name":{"type":"TEXT","notNull":false,"default":""},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"platform_user_id":{"type":"TEXT","notNull":false},"platform_username":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"access_token":{"type":"TEXT","notNull":false},"refresh_token":{"type":"TEXT","notNull":false},"credential_secret_id":{"type":"TEXT","notNull":false},"access_token_secret_name":{"type":"TEXT","notNull":false},"refresh_token_secret_name":{"type":"TEXT","notNull":false},"token_expires_at":{"type":"TIMESTAMP","notNull":false},"is_active":{"type":"BOOLEAN","notNull":false,"default":true},"default_hashtags":{"type":"JSON","notNull":false,"default":[]},"scopes":{"type":"JSON","notNull":false,"default":[]},"missing_permissions":{"type":"JSON","notNull":false,"default":[]},"link_behavior":{"type":"TEXT","notNull":false,"default":"description"},"publish_mode":{"type":"TEXT","notNull":false,"default":"dry_run"},"public_publishing_allowed":{"type":"BOOLEAN","notNull":false,"default":false},"status":{"type":"TEXT","notNull":false,"default":"connected"},"error_message":{"type":"TEXT","notNull":false}},"indexes":[{"name":"social_accounts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_accounts_meta_type_idx","columns":["_meta_type"]},{"name":"social_accounts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0c175da6"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot":{"name":"socialpostanalyticssnapshot","className":"SocialPostAnalyticsSnapshot","qualifiedName":"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot","collection":"socialpostanalyticssnapshots","filePath":"/home/runner/work/smrt/smrt/packages/social/src/social-post-analytics-snapshot.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"socialPostId":{"type":"foreignKey","required":false,"related":"SocialPost","description":"The post these numbers are for.","_meta":{"description":"The post these numbers are for."}},"platform":{"type":"text","required":true,"description":"The platform that reported the numbers.","_meta":{"required":true,"description":"The platform that reported the numbers."},"enum":["youtube","threads","x","bluesky","facebook"]},"analytics":{"type":"json","required":false,"description":"The views, likes, comments, shares and clicks the platform reported.","_meta":{"description":"The views, likes, comments, shares and clicks the platform reported."}},"raw":{"type":"json","required":false,"_meta":{"nullable":true}},"capturedAt":{"type":"datetime","required":false,"description":"When these numbers were taken from the platform.","_meta":{"description":"When these numbers were taken from the platform."}}},"methods":{},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","delete"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"SocialPostAnalyticsSnapshot","collectionExportName":"SocialPostAnalyticsSnapshotCollection","validationRules":[{"field":"platform","rule":"required","fieldType":"text"}],"schema":{"tableName":"social_post_analytics_snapshots","ddl":"CREATE TABLE IF NOT EXISTS \\"social_post_analytics_snapshots\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_post_id\\" UUID,\\n \\"platform\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"raw\\" JSON,\\n \\"captured_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_post_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_posts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"platform":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"raw":{"type":"JSON","notNull":false},"captured_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_post_analytics_snapshots_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_post_analytics_snapshots_meta_type_idx","columns":["_meta_type"]},{"name":"social_post_analytics_snapshots_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_post_analytics_snapshots_social_post_id_idx","columns":["social_post_id"]}],"version":"bd17983d"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPost":{"name":"socialpost","className":"SocialPost","qualifiedName":"@happyvertical/smrt-social:SocialPost","collection":"socialposts","description":"Social media post for multi-platform publishing","filePath":"/home/runner/work/smrt/smrt/packages/social/src/social-post.ts","packageName":"@happyvertical/smrt-social","fields":{"created_at":{"type":"datetime","required":false},"updated_at":{"type":"datetime","required":false},"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"socialAccountId":{"type":"foreignKey","required":false,"related":"SocialAccount","description":"The connected account this post goes out from.","_meta":{"description":"The connected account this post goes out from."}},"createdByUserId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-users:User"},"videoContentId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-video:VideoContent"},"contentId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-content:Content"},"postType":{"type":"text","required":false,"default":"text","description":"What kind of post it is: text, link, image or video.","_meta":{"description":"What kind of post it is: text, link, image or video."},"enum":["text","link","image","video"]},"mediaUrl":{"type":"text","required":false},"title":{"type":"text","required":false,"description":"A title, for platforms that show one.","_meta":{"description":"A title, for platforms that show one."}},"description":{"type":"text","required":false,"default":"","description":"The words of the post.","_meta":{"description":"The words of the post."}},"hashtags":{"type":"json","required":false,"default":[],"description":"Hashtags added to the end of the post.","_meta":{"description":"Hashtags added to the end of the post."}},"linkUrl":{"type":"text","required":false,"description":"A web address to share with the post.","_meta":{"description":"A web address to share with the post."}},"platformPostId":{"type":"text","required":false},"platformUrl":{"type":"text","required":false,"description":"Where the post can be seen on the platform, once it is out.","_meta":{"description":"Where the post can be seen on the platform, once it is out."}},"scheduledAt":{"type":"datetime","required":false,"description":"The date and time you have in mind for putting the post out. Only a note of the plan: publishing is a separate step your application has to run.","_meta":{"description":"The date and time you have in mind for putting the post out. Only a note of the plan: publishing is a separate step your application has to run."}},"publishedAt":{"type":"datetime","required":false,"description":"When the post actually went out.","_meta":{"description":"When the post actually went out."}},"status":{"type":"text","required":false,"default":"draft","description":"Where the post stands: draft, waiting to go out, published or failed.","_meta":{"description":"Where the post stands: draft, waiting to go out, published or failed."},"enum":["draft","pending_approval","approved","scheduled","publishing","dry_run","staged","published","failed","cancelled"]},"errorMessage":{"type":"text","required":false},"analytics":{"type":"json","required":false},"analyticsLastSyncedAt":{"type":"datetime","required":false}},"methods":{},"decoratorConfig":{"tableStrategy":"sti","api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]},"cli":true,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context","_meta_type"]},"extends":"SmrtObject","exportName":"SocialPost","collectionExportName":"SocialPostCollection","displayLabelField":"title","schema":{"tableName":"social_posts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_posts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_account_id\\" UUID,\\n \\"created_by_user_id\\" UUID,\\n \\"video_content_id\\" UUID,\\n \\"content_id\\" UUID,\\n \\"post_type\\" TEXT DEFAULT 'text',\\n \\"media_url\\" TEXT,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT DEFAULT '',\\n \\"hashtags\\" JSON DEFAULT '[]',\\n \\"link_url\\" TEXT,\\n \\"platform_post_id\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"scheduled_at\\" TIMESTAMP,\\n \\"published_at\\" TIMESTAMP,\\n \\"status\\" TEXT DEFAULT 'draft',\\n \\"error_message\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"analytics_last_synced_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_account_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_accounts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"video_content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"post_type":{"type":"TEXT","notNull":false,"default":"text"},"media_url":{"type":"TEXT","notNull":false},"title":{"type":"TEXT","notNull":false},"description":{"type":"TEXT","notNull":false,"default":""},"hashtags":{"type":"JSON","notNull":false,"default":[]},"link_url":{"type":"TEXT","notNull":false},"platform_post_id":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"scheduled_at":{"type":"TIMESTAMP","notNull":false},"published_at":{"type":"TIMESTAMP","notNull":false},"status":{"type":"TEXT","notNull":false,"default":"draft"},"error_message":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"analytics_last_synced_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_posts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_posts_meta_type_idx","columns":["_meta_type"]},{"name":"social_posts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_posts_social_account_id_idx","columns":["social_account_id"]},{"name":"social_posts_created_by_user_id_idx","columns":["created_by_user_id"]},{"name":"social_posts_video_content_id_idx","columns":["video_content_id"]},{"name":"social_posts_content_id_idx","columns":["content_id"]}],"version":"cfb50b15"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:OAuthStateCollection":{"name":"oauthstatecollection","className":"OAuthStateCollection","qualifiedName":"@happyvertical/smrt-social:OAuthStateCollection","collection":"oauthstates","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/oauth-state-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"findByState":{"name":"findByState","async":true,"parameters":[{"name":"state","type":"string","optional":false}],"returnType":"Promise<OAuthState | null>","isStatic":false,"isPublic":true},"consume":{"name":"consume","async":true,"parameters":[{"name":"state","type":"OAuthState","optional":false}],"returnType":"Promise<boolean>","isStatic":false,"isPublic":true},"findExpired":{"name":"findExpired","async":true,"parameters":[{"name":"now","type":"Date","optional":true}],"returnType":"Promise<OAuthState[]>","isStatic":false,"isPublic":true},"deleteExpired":{"name":"deleteExpired","async":true,"parameters":[{"name":"now","type":"Date","optional":true}],"returnType":"Promise<number>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","delete"]},"mcp":false},"extends":"SmrtCollection","extendsTypeArg":"OAuthState","exportName":"OAuthStateCollection","collectionExportName":"OAuthStateCollectionCollection","schema":{"tableName":"oauth_states","ddl":"CREATE TABLE IF NOT EXISTS \\"oauth_states\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"state\\" TEXT DEFAULT '',\\n \\"code_verifier\\" TEXT,\\n \\"redirect_uri\\" TEXT DEFAULT '',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"expires_at\\" TIMESTAMP,\\n \\"created_by_user_id\\" UUID,\\n \\"return_to\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"state":{"type":"TEXT","notNull":false,"default":""},"code_verifier":{"type":"TEXT","notNull":false},"redirect_uri":{"type":"TEXT","notNull":false,"default":""},"scopes":{"type":"JSON","notNull":false,"default":[]},"expires_at":{"type":"TIMESTAMP","notNull":false},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"return_to":{"type":"TEXT","notNull":false}},"indexes":[{"name":"oauth_states_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"oauth_states_meta_type_idx","columns":["_meta_type"]},{"name":"oauth_states_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"oauth_states_created_by_user_id_idx","columns":["created_by_user_id"]}],"version":"ca0ff7c5"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialAccountCollection":{"name":"socialaccountcollection","className":"SocialAccountCollection","qualifiedName":"@happyvertical/smrt-social:SocialAccountCollection","collection":"socialaccounts","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/social-account-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"findActive":{"name":"findActive","async":true,"parameters":[{"name":"platform","type":"SocialPlatformType","optional":true}],"returnType":"Promise<SocialAccount[]>","isStatic":false,"isPublic":true},"findReady":{"name":"findReady","async":true,"parameters":[{"name":"platform","type":"SocialPlatformType","optional":true}],"returnType":"Promise<SocialAccount[]>","isStatic":false,"isPublic":true},"findNeedsAttention":{"name":"findNeedsAttention","async":true,"parameters":[],"returnType":"Promise<SocialAccount[]>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SocialAccount","exportName":"SocialAccountCollection","collectionExportName":"SocialAccountCollectionCollection","schema":{"tableName":"social_accounts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_accounts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"name\\" TEXT DEFAULT '',\\n \\"platform\\" TEXT DEFAULT 'youtube',\\n \\"platform_user_id\\" TEXT,\\n \\"platform_username\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"access_token\\" TEXT,\\n \\"refresh_token\\" TEXT,\\n \\"credential_secret_id\\" TEXT,\\n \\"access_token_secret_name\\" TEXT,\\n \\"refresh_token_secret_name\\" TEXT,\\n \\"token_expires_at\\" TIMESTAMP,\\n \\"is_active\\" BOOLEAN DEFAULT TRUE,\\n \\"default_hashtags\\" JSON DEFAULT '[]',\\n \\"scopes\\" JSON DEFAULT '[]',\\n \\"missing_permissions\\" JSON DEFAULT '[]',\\n \\"link_behavior\\" TEXT DEFAULT 'description',\\n \\"publish_mode\\" TEXT DEFAULT 'dry_run',\\n \\"public_publishing_allowed\\" BOOLEAN DEFAULT FALSE,\\n \\"status\\" TEXT DEFAULT 'connected',\\n \\"error_message\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"name":{"type":"TEXT","notNull":false,"default":""},"platform":{"type":"TEXT","notNull":false,"default":"youtube"},"platform_user_id":{"type":"TEXT","notNull":false},"platform_username":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"access_token":{"type":"TEXT","notNull":false},"refresh_token":{"type":"TEXT","notNull":false},"credential_secret_id":{"type":"TEXT","notNull":false},"access_token_secret_name":{"type":"TEXT","notNull":false},"refresh_token_secret_name":{"type":"TEXT","notNull":false},"token_expires_at":{"type":"TIMESTAMP","notNull":false},"is_active":{"type":"BOOLEAN","notNull":false,"default":true},"default_hashtags":{"type":"JSON","notNull":false,"default":[]},"scopes":{"type":"JSON","notNull":false,"default":[]},"missing_permissions":{"type":"JSON","notNull":false,"default":[]},"link_behavior":{"type":"TEXT","notNull":false,"default":"description"},"publish_mode":{"type":"TEXT","notNull":false,"default":"dry_run"},"public_publishing_allowed":{"type":"BOOLEAN","notNull":false,"default":false},"status":{"type":"TEXT","notNull":false,"default":"connected"},"error_message":{"type":"TEXT","notNull":false}},"indexes":[{"name":"social_accounts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_accounts_meta_type_idx","columns":["_meta_type"]},{"name":"social_accounts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"0c175da6"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection":{"name":"socialpostanalyticssnapshotcollection","className":"SocialPostAnalyticsSnapshotCollection","qualifiedName":"@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection","collection":"socialpostanalyticssnapshots","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/social-post-analytics-snapshot-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"recordSnapshot":{"name":"recordSnapshot","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["string","SocialPlatformType","PostAnalytics","RawAnalyticsPayload","Date","string | null"]}],"returnType":"Promise<SocialPostAnalyticsSnapshot>","isStatic":false,"isPublic":true},"findForPost":{"name":"findForPost","async":true,"parameters":[{"name":"socialPostId","type":"string","optional":false}],"returnType":"Promise<SocialPostAnalyticsSnapshot[]>","isStatic":false,"isPublic":true},"findLatestForPost":{"name":"findLatestForPost","async":true,"parameters":[{"name":"socialPostId","type":"string","optional":false}],"returnType":"Promise<SocialPostAnalyticsSnapshot | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","delete"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SocialPostAnalyticsSnapshot","exportName":"SocialPostAnalyticsSnapshotCollection","collectionExportName":"SocialPostAnalyticsSnapshotCollectionCollection","schema":{"tableName":"social_post_analytics_snapshots","ddl":"CREATE TABLE IF NOT EXISTS \\"social_post_analytics_snapshots\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_post_id\\" UUID,\\n \\"platform\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"raw\\" JSON,\\n \\"captured_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_post_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_posts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"platform":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"raw":{"type":"JSON","notNull":false},"captured_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_post_analytics_snapshots_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_post_analytics_snapshots_meta_type_idx","columns":["_meta_type"]},{"name":"social_post_analytics_snapshots_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_post_analytics_snapshots_social_post_id_idx","columns":["social_post_id"]}],"version":"bd17983d"},"importPath":"@happyvertical/smrt-social"},"@happyvertical/smrt-social:SocialPostCollection":{"name":"socialpostcollection","className":"SocialPostCollection","qualifiedName":"@happyvertical/smrt-social:SocialPostCollection","collection":"socialposts","filePath":"/home/runner/work/smrt/smrt/packages/social/src/collections/social-post-collection.ts","packageName":"@happyvertical/smrt-social","fields":{},"methods":{"createDraft":{"name":"createDraft","async":true,"parameters":[{"name":"options","type":"CreateSocialPostDraftOptions","optional":false}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true},"findByStatus":{"name":"findByStatus","async":true,"parameters":[{"name":"status","type":"PostStatus","optional":false}],"returnType":"Promise<SocialPost[]>","isStatic":false,"isPublic":true},"findForAccount":{"name":"findForAccount","async":true,"parameters":[{"name":"socialAccountId","type":"string","optional":false}],"returnType":"Promise<SocialPost[]>","isStatic":false,"isPublic":true},"findDueForPublish":{"name":"findDueForPublish","async":true,"parameters":[{"name":"now","type":"Date","optional":true}],"returnType":"Promise<SocialPost[]>","isStatic":false,"isPublic":true},"recordPublishSuccess":{"name":"recordPublishSuccess","async":true,"parameters":[{"name":"post","type":"SocialPost","optional":false},{"name":"data","type":"PublishSuccessData","optional":false}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true},"recordPublishFailure":{"name":"recordPublishFailure","async":true,"parameters":[{"name":"post","type":"SocialPost","optional":false},{"name":"error","type":"Error | string","optional":false,"unionBranches":[{"type":"Error"},{"type":"string"}]}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true},"updateLatestAnalytics":{"name":"updateLatestAnalytics","async":true,"parameters":[{"name":"post","type":"SocialPost","optional":false},{"name":"analytics","type":"PostAnalytics","optional":false},{"name":"syncedAt","type":"Date","optional":true}],"returnType":"Promise<SocialPost>","isStatic":false,"isPublic":true}},"decoratorConfig":{"api":{"include":["list","get","create","update","delete"]},"mcp":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"SocialPost","exportName":"SocialPostCollection","collectionExportName":"SocialPostCollectionCollection","schema":{"tableName":"social_posts","ddl":"CREATE TABLE IF NOT EXISTS \\"social_posts\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"_meta_type\\" TEXT NOT NULL,\\n \\"_meta_data\\" JSON,\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"social_account_id\\" UUID,\\n \\"created_by_user_id\\" UUID,\\n \\"video_content_id\\" UUID,\\n \\"content_id\\" UUID,\\n \\"post_type\\" TEXT DEFAULT 'text',\\n \\"media_url\\" TEXT,\\n \\"title\\" TEXT,\\n \\"description\\" TEXT DEFAULT '',\\n \\"hashtags\\" JSON DEFAULT '[]',\\n \\"link_url\\" TEXT,\\n \\"platform_post_id\\" TEXT,\\n \\"platform_url\\" TEXT,\\n \\"scheduled_at\\" TIMESTAMP,\\n \\"published_at\\" TIMESTAMP,\\n \\"status\\" TEXT DEFAULT 'draft',\\n \\"error_message\\" TEXT,\\n \\"analytics\\" JSON,\\n \\"analytics_last_synced_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"_meta_type":{"type":"TEXT","notNull":true},"_meta_data":{"type":"JSON","notNull":false},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false},"social_account_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"foreignKey":{"table":"social_accounts","column":"id","onDelete":"NO ACTION","onUpdate":"CASCADE"}},"created_by_user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"video_content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"content_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false},"post_type":{"type":"TEXT","notNull":false,"default":"text"},"media_url":{"type":"TEXT","notNull":false},"title":{"type":"TEXT","notNull":false},"description":{"type":"TEXT","notNull":false,"default":""},"hashtags":{"type":"JSON","notNull":false,"default":[]},"link_url":{"type":"TEXT","notNull":false},"platform_post_id":{"type":"TEXT","notNull":false},"platform_url":{"type":"TEXT","notNull":false},"scheduled_at":{"type":"TIMESTAMP","notNull":false},"published_at":{"type":"TIMESTAMP","notNull":false},"status":{"type":"TEXT","notNull":false,"default":"draft"},"error_message":{"type":"TEXT","notNull":false},"analytics":{"type":"JSON","notNull":false},"analytics_last_synced_at":{"type":"TIMESTAMP","notNull":false}},"indexes":[{"name":"social_posts_slug_context_meta_type_idx","columns":["tenant_id","slug","context","_meta_type"],"unique":true,"nullsNotDistinct":true},{"name":"social_posts_meta_type_idx","columns":["_meta_type"]},{"name":"social_posts_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"social_posts_social_account_id_idx","columns":["social_account_id"]},{"name":"social_posts_created_by_user_id_idx","columns":["created_by_user_id"]},{"name":"social_posts_video_content_id_idx","columns":["video_content_id"]},{"name":"social_posts_content_id_idx","columns":["content_id"]}],"version":"cfb50b15"},"importPath":"@happyvertical/smrt-social"}},"moduleType":"smrt","recipes":[{"id":"social.posts","className":"SocialPostsRecipe","label":"Social","summary":"Write posts for your YouTube, X, Threads and Bluesky accounts, plan when they go out and see how each one did.","synonyms":["social media","social posts","social accounts","youtube","bluesky","threads","tweets","post results"],"models":["@happyvertical/smrt-social:SocialPost","@happyvertical/smrt-social:SocialAccount","@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"],"nav":[{"label":"Posts","model":"@happyvertical/smrt-social:SocialPost","icon":"fileText","description":"What you have written for each account and where it stands.","noun":"post"},{"label":"Connected accounts","model":"@happyvertical/smrt-social:SocialAccount","icon":"users","description":"The social accounts you can post to, and their settings.","noun":"account"}],"requires":[],"section":{"id":"publish","label":"Publish","icon":"fileText","description":"What you write, record and put out."},"options":{"@happyvertical/smrt-social:SocialPost":{"fields":{"socialAccountId":{"label":"Account","order":1},"title":{"order":2},"description":{"label":"Text","order":3},"hashtags":{"order":4},"linkUrl":{"label":"Link","order":5},"postType":{"label":"Kind of post","order":6},"scheduledAt":{"label":"Planned for","order":7},"status":{"locked":true,"order":8},"publishedAt":{"label":"Published on","locked":true,"order":9},"platformUrl":{"label":"Link to the post","locked":true,"order":10},"videoContentId":{"label":"Video","visibility":"advanced"},"contentId":{"label":"Content","visibility":"advanced"},"mediaUrl":{"label":"Media link","visibility":"advanced"},"errorMessage":{"label":"What went wrong","visibility":"advanced"},"analyticsLastSyncedAt":{"label":"Results last updated","visibility":"advanced"},"tenantId":{"visibility":"hidden"},"createdByUserId":{"visibility":"hidden"},"platformPostId":{"visibility":"hidden"},"analytics":{"visibility":"hidden"}}},"@happyvertical/smrt-social:SocialAccount":{"fields":{"name":{"order":1},"platform":{"order":2},"platformUsername":{"label":"Username","order":3},"platformUrl":{"label":"Profile link","order":4},"status":{"locked":true,"order":5},"isActive":{"label":"In use","order":6},"defaultHashtags":{"order":7},"linkBehavior":{"label":"Where links go","order":8},"publishMode":{"label":"Publishing mode","visibility":"advanced"},"publicPublishingAllowed":{"label":"Allow public posts","visibility":"advanced"},"platformUserId":{"visibility":"advanced"},"tokenExpiresAt":{"label":"Connection expires","visibility":"advanced"},"scopes":{"label":"Permissions granted","visibility":"advanced"},"missingPermissions":{"visibility":"advanced"},"errorMessage":{"label":"What went wrong","visibility":"advanced"},"tenantId":{"visibility":"hidden"},"accessToken":{"visibility":"hidden"},"refreshToken":{"visibility":"hidden"},"credentialSecretId":{"visibility":"hidden"},"accessTokenSecretName":{"visibility":"hidden"},"refreshTokenSecretName":{"visibility":"hidden"}}},"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot":{"fields":{"socialPostId":{"label":"Post","order":1},"platform":{"order":2},"capturedAt":{"label":"Measured on","order":3},"analytics":{"label":"Numbers","order":4},"tenantId":{"visibility":"hidden"},"raw":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nSocial is where you write what you want to put out on YouTube, X, Threads and\\nBluesky. Each post is written for one connected account, with its text,\\nhashtags and an optional link, and can carry the date you plan to put it out.\\nYour app does the publishing; once a post is out, the platform's numbers for it\\narrive here as post results.\\n\\n## Tasks\\n\\n### Connect an account\\n\\n1. Open the connected accounts and choose **New**.\\n2. Give it a **{field:SocialAccount.name}** you will recognise, such as \\"Acme Corp on Bluesky\\".\\n3. Pick the **{field:SocialAccount.platform}** and type the **{field:SocialAccount.platformUsername}** you post under.\\n4. Add any **{field:SocialAccount.defaultHashtags}** you want on every post from this account.\\n5. Save. Signing in to the platform itself happens from your app, not in this form; the **{field:SocialAccount.status}** shows whether the account is connected.\\n\\n### Write a post\\n\\n1. Open the posts and choose **New**.\\n2. Pick the **{field:SocialPost.socialAccountId}** it is for.\\n3. Write the **{field:SocialPost.description}** and add any **{field:SocialPost.hashtags}**.\\n4. Give it a **{field:SocialPost.title}** if the platform shows one, and a **{field:SocialPost.linkUrl}** if you are sharing a page.\\n5. Save. It stays a draft until your app puts it out.\\n\\n### Note when a post should go out\\n\\n1. Open the post and set **{field:SocialPost.scheduledAt}** to the date and time you have in mind.\\n2. Save. This only records the plan on the post. Nothing here publishes it: a post goes out only when your application's own publishing step approves it and sends it at that time, so check with whoever set up your app that this step is in place.\\n\\n### See where a post stands\\n\\nOpen the post. Its **{field:SocialPost.status}** shows whether it is a draft,\\nwaiting to go out, published or failed. Once it is out, **{field:SocialPost.publishedAt}**\\nand the **{field:SocialPost.platformUrl}** are filled in.\\n\\n### Change or remove a post\\n\\n1. Open the post and change what you need, then save.\\n2. To remove it, open the post and choose **Delete**.\\n\\n### See how a post did\\n\\nPost results are written by the platform sync, not by hand; you can only read\\nthem here.\\n\\n1. Open the post and look at its results, listed under the post.\\n2. Each result names the **{field:SocialPostAnalyticsSnapshot.socialPostId}** it belongs to and the **{field:SocialPostAnalyticsSnapshot.platform}** it ran on.\\n3. Each result shows the **{field:SocialPostAnalyticsSnapshot.analytics}** the platform reported and when they were **{field:SocialPostAnalyticsSnapshot.capturedAt}**, so the newest one is the latest count.\\n\\n### Stop using an account\\n\\n1. Open the account and untick **{field:SocialAccount.isActive}**, then save. Its posts stay, but nothing new goes out from it.\\n2. To remove it entirely, open the account and choose **Delete**.\\n","fieldRefs":["SocialAccount.defaultHashtags","SocialAccount.isActive","SocialAccount.name","SocialAccount.platform","SocialAccount.platformUsername","SocialAccount.status","SocialPost.description","SocialPost.hashtags","SocialPost.linkUrl","SocialPost.platformUrl","SocialPost.publishedAt","SocialPost.scheduledAt","SocialPost.socialAccountId","SocialPost.status","SocialPost.title","SocialPostAnalyticsSnapshot.analytics","SocialPostAnalyticsSnapshot.capturedAt","SocialPostAnalyticsSnapshot.platform","SocialPostAnalyticsSnapshot.socialPostId"]},"demo":{"mode":"server","reasons":["Needs a server because its package does not build for a browser: node:crypto; and its package depends on @happyvertical/smrt-agents, @happyvertical/smrt-chat, @happyvertical/smrt-content, @happyvertical/smrt-images, @happyvertical/smrt-jobs, @happyvertical/smrt-profiles, @happyvertical/smrt-reports, @happyvertical/smrt-secrets, @happyvertical/smrt-tenancy, @happyvertical/smrt-users, @happyvertical/smrt-video, @happyvertical/smrt-voice, which do not build for a browser (#3615, #3617, #3624, #3625, #3626, #3627, #3628)."]}}],"smrtDependencies":["@happyvertical/smrt-content","@happyvertical/smrt-core","@happyvertical/smrt-secrets","@happyvertical/smrt-tenancy","@happyvertical/smrt-video"],"browser":{"status":"server-only","issues":["#3615","#3617","#3624","#3625","#3626","#3627","#3628"],"reason":"node:crypto","via":["@happyvertical/smrt-agents","@happyvertical/smrt-chat","@happyvertical/smrt-content","@happyvertical/smrt-images","@happyvertical/smrt-jobs","@happyvertical/smrt-profiles","@happyvertical/smrt-reports","@happyvertical/smrt-secrets","@happyvertical/smrt-tenancy","@happyvertical/smrt-users","@happyvertical/smrt-video","@happyvertical/smrt-voice"]},"stampsConstructors":true}`));
8
8
  //#endregion
9
9
  //#region src/oauth-state.ts
10
10
  var __defProp$3 = Object.defineProperty;