@happyvertical/smrt-social 0.61.2 → 0.61.4

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.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["tenantId","secretService","secret"],"sources":["../src/__smrt-register__.ts","../src/oauth-state.ts","../src/collections/oauth-state-collection.ts","../src/social-account.ts","../src/collections/social-account-collection.ts","../src/social-post.ts","../src/social-post-analytics-snapshot.ts","../src/collections/social-post-analytics-snapshot-collection.ts","../src/collections/social-post-collection.ts","../src/recipes.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-social\\\",\\\"packageVersion\\\":\\\"0.61.2\\\",\\\"objects\\\":{\\\"@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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:OAuthState\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"oauth_states\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"oauth_states\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"46b1e275\\\"},\\\"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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:SocialAccount\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"social_accounts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"social_accounts\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"973c4ad8\\\"},\\\"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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"social_post_analytics_snapshots\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"social_post_analytics_snapshots\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"0f4b8270\\\"},\\\"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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:SocialPost\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"social_posts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"social_posts\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"1006bafa\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-social\\\"},\\\"@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 \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"46b1e275\\\"},\\\"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 \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"973c4ad8\\\"},\\\"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 \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"0f4b8270\\\"},\\\"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:VideoShot\\\"},\\\"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 \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"1006bafa\\\"},\\\"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, 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\\\"]},\\\"stampsConstructors\\\":true}\"));\n","/**\n * OAuth State Model\n *\n * Manages temporary OAuth state for connecting social accounts.\n * Used to verify callback requests and prevent CSRF attacks.\n */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport { crossPackageRef, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { SocialPlatformType } from './social-account.js';\n\n/**\n * OAuth state creation options\n */\nexport interface OAuthStateOptions extends SmrtObjectOptions {\n /**\n * Platform being connected\n */\n platform?: SocialPlatformType;\n\n /**\n * CSRF state token\n */\n state?: string;\n\n /**\n * PKCE code verifier (for platforms that require it)\n */\n codeVerifier?: string | null;\n\n /**\n * Redirect URI used in the OAuth request\n */\n redirectUri?: string;\n\n /**\n * Requested OAuth scopes\n */\n scopes?: string[];\n\n /**\n * When this state expires\n */\n expiresAt?: Date;\n\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n\n /**\n * User who started the OAuth flow\n */\n createdByUserId?: string | null;\n\n /**\n * Application-defined path to return to after the callback\n */\n returnTo?: string | null;\n}\n\n/**\n * Temporary OAuth state for social account connection\n *\n * OAuthState stores temporary data during the OAuth flow to:\n * - Verify callback requests match initiated requests (CSRF protection)\n * - Store PKCE code verifier for code exchange\n * - Track redirect URI and scopes for verification\n * - Bind the flow to the user who started it (`createdByUserId`) and record\n * where the host returns afterwards (`returnTo`), so one fixed callback\n * can serve every tenant\n *\n * These records should be cleaned up after successful connection\n * or after expiration.\n *\n * @example\n * ```typescript\n * import { OAuthState } from '@happyvertical/smrt-social';\n *\n * // Create state when initiating OAuth\n * const state = new OAuthState({\n * platform: 'youtube',\n * state: crypto.randomUUID(),\n * codeVerifier: generatePKCEVerifier(),\n * redirectUri: 'https://app.example.com/oauth/callback',\n * scopes: ['youtube.upload', 'youtube.readonly'],\n * expiresAt: new Date(Date.now() + 10 * 60 * 1000), // 10 minutes\n * });\n * await state.save();\n *\n * // After successful callback, delete the state\n * await state.delete();\n * ```\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'delete'],\n },\n mcp: false,\n cli: { skipApiCheck: true },\n})\nexport class OAuthState extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Platform being connected\n */\n platform: SocialPlatformType = 'youtube';\n\n /**\n * CSRF state token\n * This is sent to the OAuth provider and verified on callback\n */\n state: string = '';\n\n /**\n * PKCE code verifier\n * Required for platforms using PKCE (YouTube, etc.)\n */\n codeVerifier: string | null = null;\n\n /**\n * Redirect URI used in the OAuth request\n * Must match on callback for verification\n */\n redirectUri: string = '';\n\n /**\n * Requested OAuth scopes\n */\n scopes: string[] = [];\n\n /**\n * When this state expires\n * States should be short-lived (10 minutes typical)\n */\n expiresAt: Date = new Date(Date.now() + 10 * 60 * 1000);\n\n /**\n * User who started the OAuth flow.\n *\n * A host with one fixed callback for every tenant compares this to the\n * signed-in user on callback and rejects a mismatch, so a forwarded or\n * leaked state cannot be completed by someone else. A `@crossPackageRef` to\n * `@happyvertical/smrt-users:User` (native uuid on PostgreSQL, no DDL FK).\n * Null for states created before the column existed.\n */\n @crossPackageRef('@happyvertical/smrt-users:User')\n createdByUserId: string | null = null;\n\n /**\n * Application-defined path to return to after the callback, for example the\n * settings page that started the flow. Opaque to the framework: the host\n * that reads it must validate it as a same-origin path before redirecting.\n */\n returnTo: string | null = null;\n\n constructor(options: OAuthStateOptions = {}) {\n super(options);\n\n if (options.platform !== undefined) this.platform = options.platform;\n if (options.state !== undefined) this.state = options.state;\n if (options.codeVerifier !== undefined)\n this.codeVerifier = options.codeVerifier;\n if (options.redirectUri !== undefined)\n this.redirectUri = options.redirectUri;\n if (options.scopes !== undefined) this.scopes = options.scopes;\n if (options.expiresAt !== undefined) this.expiresAt = options.expiresAt;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.createdByUserId !== undefined)\n this.createdByUserId = options.createdByUserId;\n if (options.returnTo !== undefined) this.returnTo = options.returnTo;\n }\n\n /**\n * Check if the state has expired\n */\n get isExpired(): boolean {\n return Date.now() >= this.expiresAt.getTime();\n }\n\n /**\n * Check if the state is still valid\n */\n get isValid(): boolean {\n return !this.isExpired && this.state.length > 0;\n }\n\n /**\n * Verify a callback state matches this record\n */\n verifyState(callbackState: string): boolean {\n return this.isValid && this.state === callbackState;\n }\n\n /**\n * Generate a new random state token\n */\n static generateState(): string {\n return crypto.randomUUID();\n }\n\n /**\n * Generate a PKCE code verifier\n * Returns a 43-128 character random string\n */\n static generateCodeVerifier(): string {\n const array = new Uint8Array(32);\n crypto.getRandomValues(array);\n return Array.from(array, (byte) => byte.toString(16).padStart(2, '0')).join(\n '',\n );\n }\n\n /**\n * Generate PKCE code challenge from verifier (S256 method)\n * Note: This requires async crypto operations\n */\n static async generateCodeChallenge(verifier: string): Promise<string> {\n const encoder = new TextEncoder();\n const data = encoder.encode(verifier);\n const digest = await crypto.subtle.digest('SHA-256', data);\n const base64 = btoa(String.fromCharCode(...new Uint8Array(digest)));\n return base64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n }\n}\n","import { RuntimeError, SmrtCollection } from '@happyvertical/smrt-core';\nimport { OAuthState } from '../oauth-state.js';\n\nexport class OAuthStateCollection extends SmrtCollection<OAuthState> {\n static readonly _itemClass = OAuthState;\n\n async findByState(state: string): Promise<OAuthState | null> {\n return this.get({ state });\n }\n\n /**\n * Consume a loaded state exactly once.\n *\n * Deletes the record with a revision-guarded delete, so when two callbacks\n * race on the same state only one delete removes the row. Returns `true`\n * for that caller and `false` for every caller whose row was already gone\n * or changed; any other failure propagates. Call it before acting on the\n * state (exchanging the code), and stop when it returns `false`.\n */\n async consume(state: OAuthState): Promise<boolean> {\n if (!state.id || !state.updated_at) return false;\n try {\n await state.delete({ expectedUpdatedAt: state.updated_at });\n return true;\n } catch (error) {\n if (\n error instanceof RuntimeError &&\n error.code === 'RUNTIME_REVISION_CONFLICT'\n ) {\n return false;\n }\n throw error;\n }\n }\n\n async findExpired(now: Date = new Date()): Promise<OAuthState[]> {\n return this.list({\n where: { 'expiresAt <=': now },\n orderBy: 'expiresAt ASC',\n });\n }\n\n async deleteExpired(now: Date = new Date()): Promise<number> {\n const expired = await this.findExpired(now);\n await Promise.all(expired.map((state) => state.delete()));\n return expired.length;\n }\n}\n","/**\n * Social Account Model\n *\n * Manages connected social media platform accounts for publishing.\n * Stores OAuth credentials and account settings.\n */\n\nimport { randomUUID } from 'node:crypto';\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport { field, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { SecretService } from '@happyvertical/smrt-secrets';\nimport {\n getCurrentTenant,\n TenantScoped,\n tenantId,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { getSocialPlatformSetup } from './server.js';\n\n/**\n * Supported social platforms\n */\nexport type SocialPlatformType =\n | 'youtube'\n | 'threads'\n | 'x'\n | 'bluesky'\n | 'facebook';\n\n/**\n * Account connection status\n */\nexport type AccountStatus =\n | 'connected'\n | 'disconnected'\n | 'expired'\n | 'missing_permissions'\n | 'error';\n\n/**\n * Link behavior for posts with links\n */\nexport type LinkBehavior =\n | 'description'\n | 'inline'\n | 'attachment'\n | 'reply'\n | 'none';\n\n/**\n * Controls how far publish operations are allowed to go.\n */\nexport type PublishMode =\n | 'dry_run'\n | 'stage_remote'\n | 'private_or_scheduled'\n | 'public';\n\n/**\n * Social account creation options\n */\nexport interface SocialAccountOptions extends SmrtObjectOptions {\n /**\n * Human-readable name for the account\n */\n name?: string;\n\n /**\n * Social platform type\n */\n platform?: SocialPlatformType;\n\n /**\n * Platform-specific user ID\n */\n platformUserId?: string | null;\n\n /**\n * Platform username/handle\n */\n platformUsername?: string | null;\n\n /**\n * Profile URL on the platform\n */\n platformUrl?: string | null;\n\n /**\n * Deprecated raw OAuth access token\n */\n accessToken?: string | null;\n\n /**\n * Deprecated raw OAuth refresh token\n */\n refreshToken?: string | null;\n\n /**\n * Secret name containing the full platform credential payload\n */\n credentialSecretId?: string | null;\n\n /**\n * Secret name containing the OAuth access token\n */\n accessTokenSecretName?: string | null;\n\n /**\n * Secret name containing the OAuth refresh token\n */\n refreshTokenSecretName?: string | null;\n\n /**\n * Token expiration time\n */\n tokenExpiresAt?: Date | null;\n\n /**\n * Whether the account is active\n * @default true\n */\n isActive?: boolean;\n\n /**\n * Default hashtags to add to posts\n */\n defaultHashtags?: string[];\n\n /**\n * Granted OAuth scopes or platform permissions\n */\n scopes?: string[];\n\n /**\n * Required permissions that still need approval/granting\n */\n missingPermissions?: string[];\n\n /**\n * How to handle links in posts\n * @default 'description'\n */\n linkBehavior?: LinkBehavior;\n\n /**\n * Safety mode for publish operations.\n * @default 'dry_run'\n */\n publishMode?: PublishMode;\n\n /**\n * Separate latch required before public publishing can happen.\n * @default false\n */\n publicPublishingAllowed?: boolean;\n\n /**\n * Account connection status\n * @default 'connected'\n */\n status?: AccountStatus;\n\n /**\n * Error message if status is 'error'\n */\n errorMessage?: string | null;\n\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n}\n\n/**\n * Connected social media account for publishing\n *\n * SocialAccount represents a connected social platform account\n * with OAuth credentials and publishing settings. Accounts can\n * be used to publish content to multiple platforms.\n *\n * @example\n * ```typescript\n * import { SocialAccount } from '@happyvertical/smrt-social';\n *\n * const account = new SocialAccount({\n * name: 'Bentley News YouTube',\n * platform: 'youtube',\n * platformUserId: 'UC...',\n * platformUsername: 'Bentley News',\n * accessToken: '...encrypted...',\n * refreshToken: '...encrypted...',\n * tokenExpiresAt: new Date('2026-02-25'),\n * defaultHashtags: ['news', 'local', 'bentley'],\n * linkBehavior: 'description',\n * });\n * await account.save();\n * ```\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'update', 'delete'],\n },\n mcp: {\n include: ['list', 'get'],\n },\n cli: { skipApiCheck: true },\n})\nexport class SocialAccount extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Human-readable name for the account\n */\n @field({ description: 'A name you will recognise this account by.' })\n name: string = '';\n\n /**\n * Social platform type\n */\n @field({\n description: 'Which platform it is on: YouTube, X, Threads or Bluesky.',\n })\n platform: SocialPlatformType = 'youtube';\n\n /**\n * Platform-specific user ID\n */\n platformUserId: string | null = null;\n\n /**\n * Platform username/handle\n */\n @field({ description: 'The username or handle you post under.' })\n platformUsername: string | null = null;\n\n /**\n * Profile URL on the platform\n */\n @field({ description: 'The web address of your profile on the platform.' })\n platformUrl: string | null = null;\n\n /**\n * Deprecated raw OAuth access token.\n * Prefer credentialSecretId/accessTokenSecretName.\n */\n accessToken: string | null = null;\n\n /**\n * Deprecated raw OAuth refresh token.\n * Prefer credentialSecretId/refreshTokenSecretName.\n */\n refreshToken: string | null = null;\n\n /**\n * Secret name containing the complete platform credential payload.\n */\n credentialSecretId: string | null = null;\n\n /**\n * Secret name containing only the access token.\n */\n accessTokenSecretName: string | null = null;\n\n /**\n * Secret name containing only the refresh token.\n */\n refreshTokenSecretName: string | null = null;\n\n /**\n * Token expiration time\n */\n tokenExpiresAt: Date | null = null;\n\n /**\n * Whether the account is active\n */\n @field({\n description: 'Whether posts can still go out from this account.',\n })\n isActive: boolean = true;\n\n /**\n * Default hashtags to add to posts\n */\n @field({ description: 'Hashtags added to every post from this account.' })\n defaultHashtags: string[] = [];\n\n /**\n * Granted OAuth scopes or platform permissions.\n */\n scopes: string[] = [];\n\n /**\n * Required permissions that still need app review or user grant.\n */\n missingPermissions: string[] = [];\n\n /**\n * How to handle links in posts\n * - description: Include link in post body/description\n * - reply: Post link as a reply (better for X algorithm)\n * - none: Don't include link\n */\n @field({\n description:\n 'Where a shared link goes: in the text, as a reply, or left out.',\n })\n linkBehavior: LinkBehavior = 'description';\n\n /**\n * Safety mode for publish operations.\n */\n publishMode: PublishMode = 'dry_run';\n\n /**\n * Separate latch required before public publishing is allowed.\n */\n publicPublishingAllowed: boolean = false;\n\n /**\n * Account connection status\n */\n @field({\n description: 'Whether the account is connected, or needs signing in again.',\n })\n status: AccountStatus = 'connected';\n\n /**\n * Error message if status is 'error'\n */\n errorMessage: string | null = null;\n\n constructor(options: SocialAccountOptions = {}) {\n super(options);\n\n if (options.name !== undefined) this.name = options.name;\n if (options.platform !== undefined) this.platform = options.platform;\n if (options.platformUserId !== undefined)\n this.platformUserId = options.platformUserId;\n if (options.platformUsername !== undefined)\n this.platformUsername = options.platformUsername;\n if (options.platformUrl !== undefined)\n this.platformUrl = options.platformUrl;\n if (options.accessToken !== undefined)\n this.accessToken = options.accessToken;\n if (options.refreshToken !== undefined)\n this.refreshToken = options.refreshToken;\n if (options.credentialSecretId !== undefined)\n this.credentialSecretId = options.credentialSecretId;\n if (options.accessTokenSecretName !== undefined)\n this.accessTokenSecretName = options.accessTokenSecretName;\n if (options.refreshTokenSecretName !== undefined)\n this.refreshTokenSecretName = options.refreshTokenSecretName;\n if (options.tokenExpiresAt !== undefined)\n this.tokenExpiresAt = options.tokenExpiresAt;\n if (options.isActive !== undefined) this.isActive = options.isActive;\n if (options.defaultHashtags !== undefined)\n this.defaultHashtags = options.defaultHashtags;\n if (options.scopes !== undefined) this.scopes = options.scopes;\n if (options.missingPermissions !== undefined)\n this.missingPermissions = options.missingPermissions;\n if (options.linkBehavior !== undefined)\n this.linkBehavior = options.linkBehavior;\n if (options.publishMode !== undefined)\n this.publishMode = options.publishMode;\n if (options.publicPublishingAllowed !== undefined)\n this.publicPublishingAllowed = options.publicPublishingAllowed;\n if (options.status !== undefined) this.status = options.status;\n if (options.errorMessage !== undefined)\n this.errorMessage = options.errorMessage;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n\n if (options.platform !== undefined) {\n const setup = getSocialPlatformSetup(this.platform);\n if (options.linkBehavior === undefined) {\n this.linkBehavior = setup.defaultLinkBehavior;\n }\n if (options.publishMode === undefined) {\n this.publishMode = setup.defaultPublishMode;\n }\n }\n }\n\n /**\n * Social accounts need a slug identity that is scoped by tenant and platform.\n * A newsroom may connect `@localnews` on X, YouTube, Threads, and Facebook;\n * the generic name-derived slug would make those accounts overwrite each\n * other through SMRT's slug/context upsert identity.\n */\n async getSlug(): Promise<string | null | undefined> {\n if (!this.slug) {\n const identity =\n this.platformUserId || this.platformUsername || this.name || this.id;\n if (!identity) {\n return this.slug;\n }\n\n const source = [\n this.tenantId ? `tenant-${this.tenantId}` : 'no-tenant',\n this.platform,\n identity,\n ]\n .filter(Boolean)\n .join('-');\n\n this.slug = source\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/(^-|-$)/g, '');\n }\n\n return this.slug;\n }\n\n /**\n * Check if the token is expired or will expire soon\n */\n get isTokenExpired(): boolean {\n if (!this.tokenExpiresAt) return false;\n // Expire 5 minutes early to allow for refresh\n const expiryBuffer = 5 * 60 * 1000;\n return Date.now() >= this.tokenExpiresAt.getTime() - expiryBuffer;\n }\n\n /**\n * Check if the account needs attention (expired or error)\n */\n get needsAttention(): boolean {\n return (\n this.status !== 'connected' ||\n this.isTokenExpired ||\n this.missingPermissions.length > 0 ||\n (this.publishMode === 'public' && !this.publicPublishingAllowed)\n );\n }\n\n /**\n * Check if the account is ready for publishing\n */\n get isReady(): boolean {\n return (\n this.isActive &&\n this.status === 'connected' &&\n this.hasCredentials &&\n this.missingPermissions.length === 0 &&\n !this.isTokenExpired &&\n (this.publishMode !== 'public' || this.publicPublishingAllowed)\n );\n }\n\n /**\n * Effective publish mode after applying the public-publishing latch.\n */\n get effectivePublishMode(): PublishMode {\n if (this.publishMode === 'public' && !this.publicPublishingAllowed) {\n return 'dry_run';\n }\n return this.publishMode;\n }\n\n /**\n * Check whether any usable credential reference exists.\n */\n get hasCredentials(): boolean {\n return Boolean(\n this.credentialSecretId || this.accessTokenSecretName || this.accessToken,\n );\n }\n\n /**\n * Store all platform credentials in smrt-secrets as a single JSON payload.\n */\n async setCredentials(\n credentials: Record<string, unknown>,\n options: {\n description?: string;\n category?: string;\n } = {},\n ): Promise<void> {\n if (!this.id) {\n this.id = randomUUID();\n }\n\n const secretName = this.credentialSecretId ?? `social-account-${this.id}`;\n const tenantId = this.requireCredentialTenantId(\n 'store social account credentials',\n );\n const secretService = await SecretService.create({ db: this.db });\n\n await secretService.storeForTenant(\n tenantId,\n secretName,\n JSON.stringify(credentials),\n {\n description: options.description ?? `Credentials for ${this.name}`,\n category: options.category ?? 'social',\n },\n );\n\n this.credentialSecretId = secretName;\n\n await this.withCredentialTenantContext(async () => {\n await this.save();\n });\n }\n\n /**\n * Retrieve platform credentials from smrt-secrets, falling back to deprecated fields.\n */\n async getCredentials(): Promise<Record<string, unknown> | null> {\n if (!this.credentialSecretId) {\n if (this.accessTokenSecretName || this.refreshTokenSecretName) {\n const tenantId = this.requireCredentialTenantId(\n 'retrieve social account credentials',\n );\n const secretService = await SecretService.create({ db: this.db });\n const credentials: Record<string, unknown> = {};\n\n if (this.accessTokenSecretName) {\n const secret = await secretService.retrieveForTenant(\n tenantId,\n this.accessTokenSecretName,\n );\n credentials.accessToken = secret.value;\n }\n\n if (this.refreshTokenSecretName) {\n const secret = await secretService.retrieveForTenant(\n tenantId,\n this.refreshTokenSecretName,\n );\n credentials.refreshToken = secret.value;\n }\n\n return credentials;\n }\n\n if (!this.accessToken && !this.refreshToken) return null;\n return {\n accessToken: this.accessToken,\n refreshToken: this.refreshToken,\n };\n }\n\n const credentialSecretId = this.credentialSecretId;\n const tenantId = this.requireCredentialTenantId(\n 'retrieve social account credentials',\n );\n const secretService = await SecretService.create({ db: this.db });\n const secret = await secretService.retrieveForTenant(\n tenantId,\n credentialSecretId,\n );\n return JSON.parse(secret.value);\n }\n\n private async withCredentialTenantContext<T>(\n fn: () => Promise<T>,\n ): Promise<T> {\n const tenantId = this.getCredentialTenantId();\n const currentTenantId = getCurrentTenant()?.tenantId;\n\n if (!tenantId || currentTenantId === tenantId) {\n return fn();\n }\n\n return withTenant({ tenantId }, fn);\n }\n\n private getCredentialTenantId(): string | null {\n if (this.tenantId) {\n return this.tenantId;\n }\n\n return getCurrentTenant()?.tenantId ?? null;\n }\n\n private requireCredentialTenantId(action: string): string {\n const tenantId = this.getCredentialTenantId();\n if (!tenantId) {\n throw new Error(`Tenant context required to ${action}.`);\n }\n return tenantId;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { SocialAccount, type SocialPlatformType } from '../social-account.js';\n\nexport class SocialAccountCollection extends SmrtCollection<SocialAccount> {\n static readonly _itemClass = SocialAccount;\n\n async findActive(platform?: SocialPlatformType): Promise<SocialAccount[]> {\n const accounts = await this.list({\n where: {\n isActive: true,\n ...(platform ? { platform } : {}),\n },\n orderBy: 'name ASC',\n });\n\n return accounts;\n }\n\n async findReady(platform?: SocialPlatformType): Promise<SocialAccount[]> {\n const accounts = await this.findActive(platform);\n return accounts.filter((account) => account.isReady);\n }\n\n async findNeedsAttention(): Promise<SocialAccount[]> {\n const accounts = await this.list({\n where: { isActive: true },\n orderBy: 'name ASC',\n });\n return accounts.filter((account) => account.needsAttention);\n }\n}\n","/**\n * Social Post Model\n *\n * Manages posts published or scheduled to social media platforms.\n * Tracks publishing status and engagement analytics.\n */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport {\n crossPackageRef,\n field,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { SocialAccount } from './social-account.js';\n\n/**\n * Post status\n */\nexport type PostStatus =\n | 'draft'\n | 'pending_approval'\n | 'approved'\n | 'scheduled'\n | 'publishing'\n | 'dry_run'\n | 'staged'\n | 'published'\n | 'failed'\n | 'cancelled';\n\n/**\n * Social post type\n */\nexport type SocialPostType = 'text' | 'link' | 'image' | 'video';\n\n/**\n * Post analytics\n */\nexport interface PostAnalytics {\n /**\n * View/impression count\n */\n views?: number;\n\n /**\n * Impression count when the platform distinguishes it from views\n */\n impressions?: number;\n\n /**\n * Like/favorite count\n */\n likes?: number;\n\n /**\n * Comment count\n */\n comments?: number;\n\n /**\n * Share/repost count\n */\n shares?: number;\n\n /**\n * Link click count\n */\n clicks?: number;\n\n /**\n * Raw platform analytics payload\n */\n raw?: unknown;\n\n /**\n * When analytics were last updated\n */\n lastUpdated?: Date;\n}\n\n/**\n * Social post creation options\n */\nexport interface SocialPostOptions extends SmrtObjectOptions {\n /**\n * Social account to publish to\n */\n socialAccountId?: string | null;\n\n /**\n * Video content to publish\n */\n videoContentId?: string | null;\n\n /**\n * Generic content ID (for non-video content)\n */\n contentId?: string | null;\n\n /**\n * High-level post type\n */\n postType?: SocialPostType;\n\n /**\n * Public media URL for platforms that cannot upload buffers\n */\n mediaUrl?: string | null;\n\n /**\n * Post title (for platforms that support it)\n */\n title?: string | null;\n\n /**\n * Post description/caption\n */\n description?: string;\n\n /**\n * Hashtags to include\n */\n hashtags?: string[];\n\n /**\n * Link URL to include\n */\n linkUrl?: string | null;\n\n /**\n * Platform-specific post ID (after publishing)\n */\n platformPostId?: string | null;\n\n /**\n * Public post URL (after publishing)\n */\n platformUrl?: string | null;\n\n /**\n * Scheduled publish time\n */\n scheduledAt?: Date | null;\n\n /**\n * Actual publish time\n */\n publishedAt?: Date | null;\n\n /**\n * Post status\n * @default 'draft'\n */\n status?: PostStatus;\n\n /**\n * Error message if status is 'failed'\n */\n errorMessage?: string | null;\n\n /**\n * Engagement analytics\n */\n analytics?: PostAnalytics;\n\n /**\n * When analytics were last synced\n */\n analyticsLastSyncedAt?: Date | null;\n\n /**\n * User who created (drafted, scheduled, or published) the post\n */\n createdByUserId?: string | null;\n\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n}\n\n/**\n * Social media post for multi-platform publishing\n *\n * SocialPost represents a post published or scheduled to a social\n * platform. It tracks publishing status and engagement analytics,\n * and can reference VideoContent for video posts.\n *\n * @example\n * ```typescript\n * import { SocialPost } from '@happyvertical/smrt-social';\n *\n * const post = new SocialPost({\n * socialAccountId: 'account-123',\n * videoContentId: 'video-456',\n * title: 'Breaking News from Bentley',\n * description: 'Latest updates from the town council meeting.',\n * hashtags: ['news', 'local', 'bentley'],\n * linkUrl: 'https://example.com/article',\n * scheduledAt: new Date('2026-01-26T18:00:00Z'),\n * });\n * await post.save();\n * ```\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'update', 'delete'],\n },\n mcp: {\n include: ['list', 'get'],\n },\n cli: true,\n})\nexport class SocialPost extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Social account to publish to\n */\n @field({ description: 'The connected account this post goes out from.' })\n @foreignKey(SocialAccount)\n socialAccountId: string | null = null;\n\n /**\n * User who created the post: drafted it, scheduled it, or published it\n * directly. Hosts use it to tell the poster when publishing fails.\n *\n * A `@crossPackageRef` to `@happyvertical/smrt-users:User`, so a native uuid\n * column on PostgreSQL with no DDL FK. Null for posts created before the\n * column existed and for posts an agent or schedule created with no person\n * behind them. Set through `SocialPostCollection.createDraft()`; the\n * publish-outcome helpers (`recordPublishSuccess`/`Failure`) never change it.\n */\n @crossPackageRef('@happyvertical/smrt-users:User')\n createdByUserId: string | null = null;\n\n /**\n * Video content to publish\n *\n * Cross-package target (`@happyvertical/smrt-video`), so it is a\n * `@crossPackageRef` rather than a `@foreignKey`: no DDL FK constraint and\n * no value import back into this package.\n */\n @crossPackageRef('@happyvertical/smrt-video:VideoShot')\n videoContentId: string | null = null;\n\n /**\n * Generic content ID (for non-video content)\n */\n @crossPackageRef('@happyvertical/smrt-content:Content')\n contentId: string | null = null;\n\n /**\n * High-level post type\n */\n @field({\n description: 'What kind of post it is: text, link, image or video.',\n })\n postType: SocialPostType = 'text';\n\n /**\n * Public media URL for platforms that require URL media publishing\n */\n mediaUrl: string | null = null;\n\n /**\n * Post title (for platforms that support it)\n */\n @field({ description: 'A title, for platforms that show one.' })\n title: string | null = null;\n\n /**\n * Post description/caption\n */\n @field({ description: 'The words of the post.' })\n description: string = '';\n\n /**\n * Hashtags to include\n */\n @field({ description: 'Hashtags added to the end of the post.' })\n hashtags: string[] = [];\n\n /**\n * Link URL to include in the post\n */\n @field({ description: 'A web address to share with the post.' })\n linkUrl: string | null = null;\n\n /**\n * Platform-specific post ID (set after publishing)\n */\n platformPostId: string | null = null;\n\n /**\n * Public post URL (set after publishing)\n */\n @field({\n description: 'Where the post can be seen on the platform, once it is out.',\n })\n platformUrl: string | null = null;\n\n /**\n * Scheduled publish time\n * If set, post will be scheduled instead of published immediately\n */\n @field({\n description:\n '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.',\n })\n scheduledAt: Date | null = null;\n\n /**\n * Actual publish time\n */\n @field({ description: 'When the post actually went out.' })\n publishedAt: Date | null = null;\n\n /**\n * Post status\n * - draft: Not yet submitted for publishing\n * - pending_approval: Awaiting editorial approval\n * - approved: Approved and ready to publish\n * - scheduled: Queued for future publishing\n * - publishing: Currently being published\n * - dry_run: Payload was validated without remote write\n * - staged: Non-public platform object/container was created\n * - published: Successfully published\n * - failed: Publishing failed\n * - cancelled: Publishing was cancelled\n */\n @field({\n description:\n 'Where the post stands: draft, waiting to go out, published or failed.',\n })\n status: PostStatus = 'draft';\n\n /**\n * Error message if status is 'failed'\n */\n errorMessage: string | null = null;\n\n /**\n * Engagement analytics\n */\n analytics: PostAnalytics = {};\n\n /**\n * When analytics were last synced\n */\n analyticsLastSyncedAt: Date | null = null;\n\n constructor(options: SocialPostOptions = {}) {\n super(options);\n\n if (options.socialAccountId !== undefined)\n this.socialAccountId = options.socialAccountId;\n if (options.videoContentId !== undefined)\n this.videoContentId = options.videoContentId;\n if (options.contentId !== undefined) this.contentId = options.contentId;\n if (options.postType !== undefined) this.postType = options.postType;\n if (options.mediaUrl !== undefined) this.mediaUrl = options.mediaUrl;\n if (options.title !== undefined) this.title = options.title;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.hashtags !== undefined) this.hashtags = options.hashtags;\n if (options.linkUrl !== undefined) this.linkUrl = options.linkUrl;\n if (options.platformPostId !== undefined)\n this.platformPostId = options.platformPostId;\n if (options.platformUrl !== undefined)\n this.platformUrl = options.platformUrl;\n if (options.scheduledAt !== undefined)\n this.scheduledAt = options.scheduledAt;\n if (options.publishedAt !== undefined)\n this.publishedAt = options.publishedAt;\n if (options.status !== undefined) this.status = options.status;\n if (options.errorMessage !== undefined)\n this.errorMessage = options.errorMessage;\n if (options.analytics !== undefined) this.analytics = options.analytics;\n if (options.analyticsLastSyncedAt !== undefined)\n this.analyticsLastSyncedAt = options.analyticsLastSyncedAt;\n if (options.createdByUserId !== undefined)\n this.createdByUserId = options.createdByUserId;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n\n /**\n * Check if the post is scheduled for future publishing\n */\n get isScheduled(): boolean {\n return this.status === 'scheduled' && this.scheduledAt !== null;\n }\n\n /**\n * Check if the post has been published\n */\n get isPublished(): boolean {\n return this.status === 'published';\n }\n\n /**\n * Check if the post can be edited (draft or failed)\n */\n get isEditable(): boolean {\n return (\n this.status === 'draft' ||\n this.status === 'pending_approval' ||\n this.status === 'failed'\n );\n }\n\n /**\n * Check if the post is due for publishing now.\n */\n get isDueForPublish(): boolean {\n if (this.status !== 'approved' && this.status !== 'scheduled') {\n return false;\n }\n return !this.scheduledAt || this.scheduledAt.getTime() <= Date.now();\n }\n\n /**\n * Get formatted hashtag string\n */\n get hashtagString(): string {\n return this.hashtags\n .map((tag) => (tag.startsWith('#') ? tag : `#${tag}`))\n .join(' ');\n }\n\n /**\n * Get the full post text with hashtags\n */\n get fullText(): string {\n const parts = [this.description];\n if (this.hashtags.length > 0) {\n parts.push(this.hashtagString);\n }\n return parts.join('\\n\\n');\n }\n}\n","/**\n * Social Post Analytics Snapshot Model\n *\n * Stores timestamped normalized and raw platform analytics payloads.\n */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport { field, foreignKey, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { SocialPlatformType } from './social-account.js';\nimport { type PostAnalytics, SocialPost } from './social-post.js';\n\nexport type RawAnalyticsPayload = Record<string, unknown> | unknown[] | null;\n\nexport interface SocialPostAnalyticsSnapshotOptions extends SmrtObjectOptions {\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n\n /**\n * Social post being measured\n */\n socialPostId?: string | null;\n\n /**\n * Platform that produced this snapshot\n */\n platform?: SocialPlatformType | null;\n\n /**\n * Normalized platform analytics.\n */\n analytics?: PostAnalytics;\n\n /**\n * Raw platform payload\n */\n raw?: RawAnalyticsPayload;\n\n /**\n * When the platform data was captured\n */\n capturedAt?: Date;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'delete'],\n },\n mcp: {\n include: ['list', 'get'],\n },\n cli: true,\n})\nexport class SocialPostAnalyticsSnapshot extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ description: 'The post these numbers are for.' })\n @foreignKey(SocialPost)\n socialPostId: string | null = null;\n\n @field({\n required: true,\n description: 'The platform that reported the numbers.',\n })\n platform: SocialPlatformType | null = null;\n\n @field({\n description:\n 'The views, likes, comments, shares and clicks the platform reported.',\n })\n analytics: PostAnalytics = {};\n\n @field({ type: 'json', nullable: true })\n raw: RawAnalyticsPayload = null;\n\n @field({ description: 'When these numbers were taken from the platform.' })\n capturedAt: Date = new Date();\n\n constructor(options: SocialPostAnalyticsSnapshotOptions = {}) {\n super(options);\n\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.socialPostId !== undefined)\n this.socialPostId = options.socialPostId;\n if (options.platform !== undefined) this.platform = options.platform;\n if (options.analytics !== undefined) this.analytics = options.analytics;\n if (options.raw !== undefined) this.raw = options.raw;\n if (options.capturedAt !== undefined) this.capturedAt = options.capturedAt;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport type { SocialPlatformType } from '../social-account.js';\nimport type { PostAnalytics } from '../social-post.js';\nimport {\n type RawAnalyticsPayload,\n SocialPostAnalyticsSnapshot,\n} from '../social-post-analytics-snapshot.js';\n\nfunction isRawAnalyticsPayload(value: unknown): value is RawAnalyticsPayload {\n return (\n value === null ||\n Array.isArray(value) ||\n (typeof value === 'object' && value !== null)\n );\n}\n\nexport class SocialPostAnalyticsSnapshotCollection extends SmrtCollection<SocialPostAnalyticsSnapshot> {\n static readonly _itemClass = SocialPostAnalyticsSnapshot;\n\n async recordSnapshot(options: {\n socialPostId: string;\n platform: SocialPlatformType;\n metrics: PostAnalytics;\n raw?: RawAnalyticsPayload;\n capturedAt?: Date;\n tenantId?: string | null;\n }): Promise<SocialPostAnalyticsSnapshot> {\n const snapshot = await this.create({\n socialPostId: options.socialPostId,\n platform: options.platform,\n analytics: options.metrics,\n raw:\n options.raw ??\n (isRawAnalyticsPayload(options.metrics.raw)\n ? options.metrics.raw\n : null),\n capturedAt: options.capturedAt ?? new Date(),\n tenantId: options.tenantId,\n });\n return snapshot;\n }\n\n async findForPost(\n socialPostId: string,\n ): Promise<SocialPostAnalyticsSnapshot[]> {\n return this.list({\n where: { socialPostId },\n orderBy: 'capturedAt DESC',\n });\n }\n\n async findLatestForPost(\n socialPostId: string,\n ): Promise<SocialPostAnalyticsSnapshot | null> {\n const snapshots = await this.findForPost(socialPostId);\n return snapshots[0] ?? null;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n type PostAnalytics,\n type PostStatus,\n SocialPost,\n type SocialPostType,\n} from '../social-post.js';\n\nexport interface CreateSocialPostDraftOptions {\n socialAccountId: string;\n contentId?: string | null;\n videoContentId?: string | null;\n postType?: SocialPostType;\n title?: string | null;\n description?: string;\n hashtags?: string[];\n linkUrl?: string | null;\n mediaUrl?: string | null;\n scheduledAt?: Date | null;\n /**\n * User creating the post (the poster). Stored as `createdByUserId` so a\n * failed publish can be reported to them; omit for agent/schedule posts.\n */\n createdByUserId?: string | null;\n tenantId?: string | null;\n}\n\nexport interface PublishSuccessData {\n platformPostId: string;\n platformUrl: string;\n publishedAt?: Date;\n status?: PostStatus;\n}\n\nexport class SocialPostCollection extends SmrtCollection<SocialPost> {\n static readonly _itemClass = SocialPost;\n\n async createDraft(\n options: CreateSocialPostDraftOptions,\n ): Promise<SocialPost> {\n return this.create({\n ...options,\n postType:\n options.postType ??\n (options.videoContentId || options.mediaUrl\n ? 'video'\n : options.linkUrl\n ? 'link'\n : 'text'),\n status: options.scheduledAt ? 'scheduled' : 'draft',\n });\n }\n\n async findByStatus(status: PostStatus): Promise<SocialPost[]> {\n return this.list({ where: { status }, orderBy: 'scheduledAt ASC' });\n }\n\n async findForAccount(socialAccountId: string): Promise<SocialPost[]> {\n return this.list({\n where: { socialAccountId },\n orderBy: 'created_at DESC',\n });\n }\n\n async findDueForPublish(now: Date = new Date()): Promise<SocialPost[]> {\n const [approved, scheduled] = await Promise.all([\n this.list({\n where: { status: 'approved' },\n orderBy: 'scheduledAt ASC',\n }),\n this.list({\n where: { status: 'scheduled', 'scheduledAt <=': now },\n orderBy: 'scheduledAt ASC',\n }),\n ]);\n\n return [\n ...approved.filter((post) => post.isDueForPublish),\n ...scheduled,\n ].sort(\n (a, b) =>\n (a.scheduledAt?.getTime() ?? 0) - (b.scheduledAt?.getTime() ?? 0),\n );\n }\n\n async recordPublishSuccess(\n post: SocialPost,\n data: PublishSuccessData,\n ): Promise<SocialPost> {\n const status = data.status ?? 'published';\n post.platformPostId = data.platformPostId;\n post.platformUrl = data.platformUrl;\n if (status === 'published') {\n post.publishedAt = data.publishedAt ?? post.publishedAt ?? new Date();\n }\n post.status = status;\n post.errorMessage = null;\n await post.save();\n return post;\n }\n\n async recordPublishFailure(\n post: SocialPost,\n error: Error | string,\n ): Promise<SocialPost> {\n post.status = 'failed';\n post.errorMessage = formatPublishError(error);\n await post.save();\n return post;\n }\n\n async updateLatestAnalytics(\n post: SocialPost,\n analytics: PostAnalytics,\n syncedAt: Date = new Date(),\n ): Promise<SocialPost> {\n post.analytics = {\n ...analytics,\n lastUpdated: analytics.lastUpdated ?? syncedAt,\n };\n post.analyticsLastSyncedAt = syncedAt;\n await post.save();\n return post;\n }\n}\n\nfunction formatPublishError(error: Error | string): string {\n if (typeof error === 'string') {\n return error;\n }\n\n const details = [error.message];\n const code = (error as Error & { code?: unknown }).code;\n if (code !== undefined) {\n details.push(`code=${String(code)}`);\n }\n if (error.stack) {\n details.push(error.stack);\n }\n return details.join('\\n');\n}\n","/**\n * Declared recipes for smrt-social (#4409): user-facing units of\n * functionality an app or agent can pick instead of the whole package.\n * The scanner reads these statics into the `recipes` array of `manifest.json`\n * and `smrt-knowledge.json`; nothing here runs at that point.\n *\n * `OAuthState` is deliberately not listed: it is the sign-in handshake record,\n * not something a person opens.\n *\n * @packageDocumentation\n */\n\nimport { SmrtRecipe } from '@happyvertical/smrt-core';\nimport { SocialAccount } from './social-account.js';\nimport { SocialPost } from './social-post.js';\nimport { SocialPostAnalyticsSnapshot } from './social-post-analytics-snapshot.js';\n\n/** Social: Write posts for your social accounts and see how each one did. */\nexport class SocialPostsRecipe extends SmrtRecipe {\n static id = 'social.posts';\n static help = './posts.recipe.md';\n static label = 'Social';\n static summary =\n 'Write posts for your YouTube, X, Threads and Bluesky accounts, plan when they go out and see how each one did.';\n static synonyms = [\n 'social media',\n 'social posts',\n 'social accounts',\n 'youtube',\n 'bluesky',\n 'threads',\n 'tweets',\n 'post results',\n ];\n static section = {\n id: 'publish',\n label: 'Publish',\n icon: 'fileText',\n description: 'What you write, record and put out.',\n };\n static models = [SocialPost, SocialAccount, SocialPostAnalyticsSnapshot];\n static nav = [\n {\n label: 'Posts',\n model: SocialPost,\n icon: 'fileText',\n description:\n 'What you have written for each account and where it stands.',\n noun: 'post',\n },\n {\n label: 'Connected accounts',\n model: SocialAccount,\n icon: 'users',\n description: 'The social accounts you can post to, and their settings.',\n noun: 'account',\n },\n ];\n static options = {\n SocialPost: {\n fields: {\n socialAccountId: { label: 'Account', order: 1 },\n title: { order: 2 },\n description: { label: 'Text', order: 3 },\n hashtags: { order: 4 },\n linkUrl: { label: 'Link', order: 5 },\n postType: { label: 'Kind of post', order: 6 },\n scheduledAt: { label: 'Planned for', order: 7 },\n status: { locked: true, order: 8 },\n publishedAt: { label: 'Published on', locked: true, order: 9 },\n platformUrl: { label: 'Link to the post', locked: true, order: 10 },\n videoContentId: { label: 'Video', visibility: 'advanced' },\n contentId: { label: 'Content', visibility: 'advanced' },\n mediaUrl: { label: 'Media link', visibility: 'advanced' },\n errorMessage: { label: 'What went wrong', visibility: 'advanced' },\n analyticsLastSyncedAt: {\n label: 'Results last updated',\n visibility: 'advanced',\n },\n tenantId: { visibility: 'hidden' },\n createdByUserId: { visibility: 'hidden' },\n platformPostId: { visibility: 'hidden' },\n analytics: { visibility: 'hidden' },\n },\n },\n SocialAccount: {\n fields: {\n name: { order: 1 },\n platform: { order: 2 },\n platformUsername: { label: 'Username', order: 3 },\n platformUrl: { label: 'Profile link', order: 4 },\n status: { locked: true, order: 5 },\n isActive: { label: 'In use', order: 6 },\n defaultHashtags: { order: 7 },\n linkBehavior: { label: 'Where links go', order: 8 },\n publishMode: { label: 'Publishing mode', visibility: 'advanced' },\n publicPublishingAllowed: {\n label: 'Allow public posts',\n visibility: 'advanced',\n },\n platformUserId: { visibility: 'advanced' },\n tokenExpiresAt: { label: 'Connection expires', visibility: 'advanced' },\n scopes: { label: 'Permissions granted', visibility: 'advanced' },\n missingPermissions: { visibility: 'advanced' },\n errorMessage: { label: 'What went wrong', visibility: 'advanced' },\n tenantId: { visibility: 'hidden' },\n accessToken: { visibility: 'hidden' },\n refreshToken: { visibility: 'hidden' },\n credentialSecretId: { visibility: 'hidden' },\n accessTokenSecretName: { visibility: 'hidden' },\n refreshTokenSecretName: { visibility: 'hidden' },\n },\n },\n SocialPostAnalyticsSnapshot: {\n fields: {\n socialPostId: { label: 'Post', order: 1 },\n platform: { order: 2 },\n capturedAt: { label: 'Measured on', order: 3 },\n analytics: { label: 'Numbers', order: 4 },\n tenantId: { visibility: 'hidden' },\n raw: { visibility: 'hidden' },\n },\n },\n } as const;\n}\n"],"mappings":";;;;;;AAOA,eAAe,wBAAwB,KAAK,MAAM,01hDAA8/sD,CAAC;;;;;;;;;;;;;;;;;;ACiG1itD,IAAM,aAAN,cAAyB,WAAW;CAKzC,WAA0B;;;;CAK1B,WAA+B;;;;;CAM/B,QAAgB;;;;;CAMhB,eAA8B;;;;;CAM9B,cAAsB;;;;CAKtB,SAAmB,CAAC;;;;;CAMpB,YAAkB,IAAI,KAAK,KAAK,IAAI,IAAI,MAAU,GAAI;CAYtD,kBAAiC;;;;;;CAOjC,WAA0B;CAE1B,YAAY,UAA6B,CAAC,GAAG;EAC3C,MAAM,OAAO;EAEb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,IAAI,QAAQ,UAAU,KAAA,GAAW,KAAK,QAAQ,QAAQ;EACtD,IAAI,QAAQ,iBAAiB,KAAA,GAC3B,KAAK,eAAe,QAAQ;EAC9B,IAAI,QAAQ,gBAAgB,KAAA,GAC1B,KAAK,cAAc,QAAQ;EAC7B,IAAI,QAAQ,WAAW,KAAA,GAAW,KAAK,SAAS,QAAQ;EACxD,IAAI,QAAQ,cAAc,KAAA,GAAW,KAAK,YAAY,QAAQ;EAC9D,IAAI,QAAQ,aAAa,KAAA,GAAW,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OAAO;GAAE;GACtC,iBAAiB,EAAE,OAAO,EAAE;GAC5B,cAAc;IAAE,OAAO;IAAkB,OAAO;GAAE;GAClD,aAAa;IAAE,OAAO;IAAmB,YAAY;GAAW;GAChE,yBAAyB;IACvB,OAAO;IACP,YAAY;GACd;GACA,gBAAgB,EAAE,YAAY,WAAW;GACzC,gBAAgB;IAAE,OAAO;IAAsB,YAAY;GAAW;GACtE,QAAQ;IAAE,OAAO;IAAuB,YAAY;GAAW;GAC/D,oBAAoB,EAAE,YAAY,WAAW;GAC7C,cAAc;IAAE,OAAO;IAAmB,YAAY;GAAW;GACjE,UAAU,EAAE,YAAY,SAAS;GACjC,aAAa,EAAE,YAAY,SAAS;GACpC,cAAc,EAAE,YAAY,SAAS;GACrC,oBAAoB,EAAE,YAAY,SAAS;GAC3C,uBAAuB,EAAE,YAAY,SAAS;GAC9C,wBAAwB,EAAE,YAAY,SAAS;EACjD,EACF;EACA,6BAA6B,EAC3B,QAAQ;GACN,cAAc;IAAE,OAAO;IAAQ,OAAO;GAAE;GACxC,UAAU,EAAE,OAAO,EAAE;GACrB,YAAY;IAAE,OAAO;IAAe,OAAO;GAAE;GAC7C,WAAW;IAAE,OAAO;IAAW,OAAO;GAAE;GACxC,UAAU,EAAE,YAAY,SAAS;GACjC,KAAK,EAAE,YAAY,SAAS;EAC9B,EACF;CACF;AACF"}
1
+ {"version":3,"file":"index.js","names":["tenantId","secretService","secret"],"sources":["../src/__smrt-register__.ts","../src/oauth-state.ts","../src/collections/oauth-state-collection.ts","../src/social-account.ts","../src/collections/social-account-collection.ts","../src/social-post.ts","../src/social-post-analytics-snapshot.ts","../src/collections/social-post-analytics-snapshot-collection.ts","../src/collections/social-post-collection.ts","../src/recipes.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-social\\\",\\\"packageVersion\\\":\\\"0.61.4\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-social:OAuthStateCollection\\\":{\\\"name\\\":\\\"oauthstatecollection\\\",\\\"className\\\":\\\"OAuthStateCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-social:OAuthStateCollection\\\",\\\"collection\\\":\\\"oauthstates\\\",\\\"filePath\\\":\\\"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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:OAuthState\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"oauth_states\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"oauth_states\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"46b1e275\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-social\\\"},\\\"@happyvertical/smrt-social:SocialAccountCollection\\\":{\\\"name\\\":\\\"socialaccountcollection\\\",\\\"className\\\":\\\"SocialAccountCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-social:SocialAccountCollection\\\",\\\"collection\\\":\\\"socialaccounts\\\",\\\"filePath\\\":\\\"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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:SocialAccount\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"social_accounts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"social_accounts\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"973c4ad8\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-social\\\"},\\\"@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection\\\":{\\\"name\\\":\\\"socialpostanalyticssnapshotcollection\\\",\\\"className\\\":\\\"SocialPostAnalyticsSnapshotCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection\\\",\\\"collection\\\":\\\"socialpostanalyticssnapshots\\\",\\\"filePath\\\":\\\"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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"social_post_analytics_snapshots\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"social_post_analytics_snapshots\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"0f4b8270\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-social\\\"},\\\"@happyvertical/smrt-social:SocialPostCollection\\\":{\\\"name\\\":\\\"socialpostcollection\\\",\\\"className\\\":\\\"SocialPostCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-social:SocialPostCollection\\\",\\\"collection\\\":\\\"socialposts\\\",\\\"filePath\\\":\\\"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\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-social:SocialPost\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"social_posts\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"social_posts\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"1006bafa\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-social\\\"},\\\"@happyvertical/smrt-social:OAuthState\\\":{\\\"name\\\":\\\"oauthstate\\\",\\\"className\\\":\\\"OAuthState\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-social:OAuthState\\\",\\\"collection\\\":\\\"oauthstates\\\",\\\"description\\\":\\\"Temporary OAuth state for social account connection\\\",\\\"filePath\\\":\\\"src/oauth-state.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-social\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false},\\\"__statedOptions\\\":[\\\"sqlType\\\",\\\"nullable\\\",\\\"__tenancy\\\",\\\"required\\\"],\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"platform\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\",\\\"enum\\\"]},\\\"required\\\":false,\\\"default\\\":\\\"youtube\\\",\\\"enum\\\":[\\\"youtube\\\",\\\"threads\\\",\\\"x\\\",\\\"bluesky\\\",\\\"facebook\\\"]},\\\"state\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\"]},\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"codeVerifier\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"redirectUri\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\"]},\\\"required\\\":false,\\\"default\\\":\\\"\\\"},\\\"scopes\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\"]},\\\"required\\\":false,\\\"default\\\":[]},\\\"expiresAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"createdByUserId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"related\\\"]},\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-users:User\\\"},\\\"returnTo\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"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 \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"46b1e275\\\"},\\\"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\\\":\\\"src/social-account.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-social\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false},\\\"__statedOptions\\\":[\\\"sqlType\\\",\\\"nullable\\\",\\\"__tenancy\\\",\\\"required\\\"],\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"name\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\"],\\\"description\\\":\\\"A name you will recognise this account by.\\\"},\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"A name you will recognise this account by.\\\"},\\\"platform\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\",\\\"enum\\\"],\\\"description\\\":\\\"Which platform it is on: YouTube, X, Threads or Bluesky.\\\"},\\\"required\\\":false,\\\"default\\\":\\\"youtube\\\",\\\"description\\\":\\\"Which platform it is on: YouTube, X, Threads or Bluesky.\\\",\\\"enum\\\":[\\\"youtube\\\",\\\"threads\\\",\\\"x\\\",\\\"bluesky\\\",\\\"facebook\\\"]},\\\"platformUserId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"platformUsername\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"The username or handle you post under.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"The username or handle you post under.\\\"},\\\"platformUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"The web address of your profile on the platform.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"The web address of your profile on the platform.\\\"},\\\"accessToken\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"refreshToken\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"credentialSecretId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"accessTokenSecretName\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"refreshTokenSecretName\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"tokenExpiresAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"isActive\\\":{\\\"type\\\":\\\"boolean\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\"],\\\"description\\\":\\\"Whether posts can still go out from this account.\\\"},\\\"required\\\":false,\\\"default\\\":true,\\\"description\\\":\\\"Whether posts can still go out from this account.\\\"},\\\"defaultHashtags\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\"],\\\"description\\\":\\\"Hashtags added to every post from this account.\\\"},\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"Hashtags added to every post from this account.\\\"},\\\"scopes\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\"]},\\\"required\\\":false,\\\"default\\\":[]},\\\"missingPermissions\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\"]},\\\"required\\\":false,\\\"default\\\":[]},\\\"linkBehavior\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\",\\\"enum\\\"],\\\"description\\\":\\\"Where a shared link goes: in the text, as a reply, or left out.\\\"},\\\"required\\\":false,\\\"default\\\":\\\"description\\\",\\\"description\\\":\\\"Where a shared link goes: in the text, as a reply, or left out.\\\",\\\"enum\\\":[\\\"description\\\",\\\"inline\\\",\\\"attachment\\\",\\\"reply\\\",\\\"none\\\"]},\\\"publishMode\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\",\\\"enum\\\"]},\\\"required\\\":false,\\\"default\\\":\\\"dry_run\\\",\\\"enum\\\":[\\\"dry_run\\\",\\\"stage_remote\\\",\\\"private_or_scheduled\\\",\\\"public\\\"]},\\\"publicPublishingAllowed\\\":{\\\"type\\\":\\\"boolean\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"default\\\"]},\\\"required\\\":false,\\\"default\\\":false},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\",\\\"enum\\\"],\\\"description\\\":\\\"Whether the account is connected, or needs signing in again.\\\"},\\\"required\\\":false,\\\"default\\\":\\\"connected\\\",\\\"description\\\":\\\"Whether the account is connected, or needs signing in again.\\\",\\\"enum\\\":[\\\"connected\\\",\\\"disconnected\\\",\\\"expired\\\",\\\"missing_permissions\\\",\\\"error\\\"]},\\\"errorMessage\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"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 \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"973c4ad8\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-social\\\"},\\\"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot\\\":{\\\"name\\\":\\\"socialpostanalyticssnapshot\\\",\\\"className\\\":\\\"SocialPostAnalyticsSnapshot\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-social:SocialPostAnalyticsSnapshot\\\",\\\"collection\\\":\\\"socialpostanalyticssnapshots\\\",\\\"filePath\\\":\\\"src/social-post-analytics-snapshot.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-social\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false},\\\"__statedOptions\\\":[\\\"sqlType\\\",\\\"nullable\\\",\\\"__tenancy\\\",\\\"required\\\"],\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"socialPostId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"related\\\"],\\\"description\\\":\\\"The post these numbers are for.\\\"},\\\"required\\\":false,\\\"related\\\":\\\"SocialPost\\\",\\\"description\\\":\\\"The post these numbers are for.\\\"},\\\"platform\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"enum\\\"],\\\"description\\\":\\\"The platform that reported the numbers.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"The platform that reported the numbers.\\\",\\\"enum\\\":[\\\"youtube\\\",\\\"threads\\\",\\\"x\\\",\\\"bluesky\\\",\\\"facebook\\\"]},\\\"analytics\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__typeUnresolved\\\":true,\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"The views, likes, comments, shares and clicks the platform reported.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"The views, likes, comments, shares and clicks the platform reported.\\\"},\\\"raw\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"nullable\\\",\\\"required\\\"],\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"capturedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"When these numbers were taken from the platform.\\\"},\\\"required\\\":false,\\\"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\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"social_post_analytics_snapshots\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"social_post_analytics_snapshots\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"0f4b8270\\\"},\\\"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\\\":\\\"src/social-post.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-social\\\",\\\"fields\\\":{\\\"created_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"updated_at\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":false,\\\"autoPopulate\\\":true,\\\"nullable\\\":true,\\\"mode\\\":\\\"optional\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false},\\\"__statedOptions\\\":[\\\"sqlType\\\",\\\"nullable\\\",\\\"__tenancy\\\",\\\"required\\\"],\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true,\\\"required\\\":false},\\\"required\\\":false},\\\"socialAccountId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"related\\\"],\\\"description\\\":\\\"The connected account this post goes out from.\\\"},\\\"required\\\":false,\\\"related\\\":\\\"SocialAccount\\\",\\\"description\\\":\\\"The connected account this post goes out from.\\\"},\\\"createdByUserId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"related\\\"]},\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-users:User\\\"},\\\"videoContentId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"related\\\"]},\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-video:VideoShot\\\"},\\\"contentId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"related\\\"]},\\\"required\\\":false,\\\"related\\\":\\\"@happyvertical/smrt-content:Content\\\"},\\\"postType\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\",\\\"enum\\\"],\\\"description\\\":\\\"What kind of post it is: text, link, image or video.\\\"},\\\"required\\\":false,\\\"default\\\":\\\"text\\\",\\\"description\\\":\\\"What kind of post it is: text, link, image or video.\\\",\\\"enum\\\":[\\\"text\\\",\\\"link\\\",\\\"image\\\",\\\"video\\\"]},\\\"mediaUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"title\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"A title, for platforms that show one.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"A title, for platforms that show one.\\\"},\\\"description\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\"],\\\"description\\\":\\\"The words of the post.\\\"},\\\"required\\\":false,\\\"default\\\":\\\"\\\",\\\"description\\\":\\\"The words of the post.\\\"},\\\"hashtags\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\"],\\\"description\\\":\\\"Hashtags added to the end of the post.\\\"},\\\"required\\\":false,\\\"default\\\":[],\\\"description\\\":\\\"Hashtags added to the end of the post.\\\"},\\\"linkUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"A web address to share with the post.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"A web address to share with the post.\\\"},\\\"platformPostId\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"platformUrl\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"Where the post can be seen on the platform, once it is out.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"Where the post can be seen on the platform, once it is out.\\\"},\\\"scheduledAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"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.\\\"},\\\"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.\\\"},\\\"publishedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\"],\\\"description\\\":\\\"When the post actually went out.\\\"},\\\"required\\\":false,\\\"description\\\":\\\"When the post actually went out.\\\"},\\\"status\\\":{\\\"type\\\":\\\"text\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[\\\"description\\\",\\\"default\\\",\\\"enum\\\"],\\\"description\\\":\\\"Where the post stands: draft, waiting to go out, published or failed.\\\"},\\\"required\\\":false,\\\"default\\\":\\\"draft\\\",\\\"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\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"analytics\\\":{\\\"type\\\":\\\"json\\\",\\\"_meta\\\":{\\\"__typeUnresolved\\\":true,\\\"__statedOptions\\\":[]},\\\"required\\\":false},\\\"analyticsLastSyncedAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"_meta\\\":{\\\"__statedOptions\\\":[]},\\\"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 \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\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\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"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\\\":\\\"1006bafa\\\"},\\\"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, 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\\\"]},\\\"stampsConstructors\\\":true}\"));\n","/**\n * OAuth State Model\n *\n * Manages temporary OAuth state for connecting social accounts.\n * Used to verify callback requests and prevent CSRF attacks.\n */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport { crossPackageRef, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { SocialPlatformType } from './social-account.js';\n\n/**\n * OAuth state creation options\n */\nexport interface OAuthStateOptions extends SmrtObjectOptions {\n /**\n * Platform being connected\n */\n platform?: SocialPlatformType;\n\n /**\n * CSRF state token\n */\n state?: string;\n\n /**\n * PKCE code verifier (for platforms that require it)\n */\n codeVerifier?: string | null;\n\n /**\n * Redirect URI used in the OAuth request\n */\n redirectUri?: string;\n\n /**\n * Requested OAuth scopes\n */\n scopes?: string[];\n\n /**\n * When this state expires\n */\n expiresAt?: Date;\n\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n\n /**\n * User who started the OAuth flow\n */\n createdByUserId?: string | null;\n\n /**\n * Application-defined path to return to after the callback\n */\n returnTo?: string | null;\n}\n\n/**\n * Temporary OAuth state for social account connection\n *\n * OAuthState stores temporary data during the OAuth flow to:\n * - Verify callback requests match initiated requests (CSRF protection)\n * - Store PKCE code verifier for code exchange\n * - Track redirect URI and scopes for verification\n * - Bind the flow to the user who started it (`createdByUserId`) and record\n * where the host returns afterwards (`returnTo`), so one fixed callback\n * can serve every tenant\n *\n * These records should be cleaned up after successful connection\n * or after expiration.\n *\n * @example\n * ```typescript\n * import { OAuthState } from '@happyvertical/smrt-social';\n *\n * // Create state when initiating OAuth\n * const state = new OAuthState({\n * platform: 'youtube',\n * state: crypto.randomUUID(),\n * codeVerifier: generatePKCEVerifier(),\n * redirectUri: 'https://app.example.com/oauth/callback',\n * scopes: ['youtube.upload', 'youtube.readonly'],\n * expiresAt: new Date(Date.now() + 10 * 60 * 1000), // 10 minutes\n * });\n * await state.save();\n *\n * // After successful callback, delete the state\n * await state.delete();\n * ```\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'delete'],\n },\n mcp: false,\n cli: { skipApiCheck: true },\n})\nexport class OAuthState extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Platform being connected\n */\n platform: SocialPlatformType = 'youtube';\n\n /**\n * CSRF state token\n * This is sent to the OAuth provider and verified on callback\n */\n state: string = '';\n\n /**\n * PKCE code verifier\n * Required for platforms using PKCE (YouTube, etc.)\n */\n codeVerifier: string | null = null;\n\n /**\n * Redirect URI used in the OAuth request\n * Must match on callback for verification\n */\n redirectUri: string = '';\n\n /**\n * Requested OAuth scopes\n */\n scopes: string[] = [];\n\n /**\n * When this state expires\n * States should be short-lived (10 minutes typical)\n */\n expiresAt: Date = new Date(Date.now() + 10 * 60 * 1000);\n\n /**\n * User who started the OAuth flow.\n *\n * A host with one fixed callback for every tenant compares this to the\n * signed-in user on callback and rejects a mismatch, so a forwarded or\n * leaked state cannot be completed by someone else. A `@crossPackageRef` to\n * `@happyvertical/smrt-users:User` (native uuid on PostgreSQL, no DDL FK).\n * Null for states created before the column existed.\n */\n @crossPackageRef('@happyvertical/smrt-users:User')\n createdByUserId: string | null = null;\n\n /**\n * Application-defined path to return to after the callback, for example the\n * settings page that started the flow. Opaque to the framework: the host\n * that reads it must validate it as a same-origin path before redirecting.\n */\n returnTo: string | null = null;\n\n constructor(options: OAuthStateOptions = {}) {\n super(options);\n\n if (options.platform !== undefined) this.platform = options.platform;\n if (options.state !== undefined) this.state = options.state;\n if (options.codeVerifier !== undefined)\n this.codeVerifier = options.codeVerifier;\n if (options.redirectUri !== undefined)\n this.redirectUri = options.redirectUri;\n if (options.scopes !== undefined) this.scopes = options.scopes;\n if (options.expiresAt !== undefined) this.expiresAt = options.expiresAt;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.createdByUserId !== undefined)\n this.createdByUserId = options.createdByUserId;\n if (options.returnTo !== undefined) this.returnTo = options.returnTo;\n }\n\n /**\n * Check if the state has expired\n */\n get isExpired(): boolean {\n return Date.now() >= this.expiresAt.getTime();\n }\n\n /**\n * Check if the state is still valid\n */\n get isValid(): boolean {\n return !this.isExpired && this.state.length > 0;\n }\n\n /**\n * Verify a callback state matches this record\n */\n verifyState(callbackState: string): boolean {\n return this.isValid && this.state === callbackState;\n }\n\n /**\n * Generate a new random state token\n */\n static generateState(): string {\n return crypto.randomUUID();\n }\n\n /**\n * Generate a PKCE code verifier\n * Returns a 43-128 character random string\n */\n static generateCodeVerifier(): string {\n const array = new Uint8Array(32);\n crypto.getRandomValues(array);\n return Array.from(array, (byte) => byte.toString(16).padStart(2, '0')).join(\n '',\n );\n }\n\n /**\n * Generate PKCE code challenge from verifier (S256 method)\n * Note: This requires async crypto operations\n */\n static async generateCodeChallenge(verifier: string): Promise<string> {\n const encoder = new TextEncoder();\n const data = encoder.encode(verifier);\n const digest = await crypto.subtle.digest('SHA-256', data);\n const base64 = btoa(String.fromCharCode(...new Uint8Array(digest)));\n return base64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n }\n}\n","import { RuntimeError, SmrtCollection } from '@happyvertical/smrt-core';\nimport { OAuthState } from '../oauth-state.js';\n\nexport class OAuthStateCollection extends SmrtCollection<OAuthState> {\n static readonly _itemClass = OAuthState;\n\n async findByState(state: string): Promise<OAuthState | null> {\n return this.get({ state });\n }\n\n /**\n * Consume a loaded state exactly once.\n *\n * Deletes the record with a revision-guarded delete, so when two callbacks\n * race on the same state only one delete removes the row. Returns `true`\n * for that caller and `false` for every caller whose row was already gone\n * or changed; any other failure propagates. Call it before acting on the\n * state (exchanging the code), and stop when it returns `false`.\n */\n async consume(state: OAuthState): Promise<boolean> {\n if (!state.id || !state.updated_at) return false;\n try {\n await state.delete({ expectedUpdatedAt: state.updated_at });\n return true;\n } catch (error) {\n if (\n error instanceof RuntimeError &&\n error.code === 'RUNTIME_REVISION_CONFLICT'\n ) {\n return false;\n }\n throw error;\n }\n }\n\n async findExpired(now: Date = new Date()): Promise<OAuthState[]> {\n return this.list({\n where: { 'expiresAt <=': now },\n orderBy: 'expiresAt ASC',\n });\n }\n\n async deleteExpired(now: Date = new Date()): Promise<number> {\n const expired = await this.findExpired(now);\n await Promise.all(expired.map((state) => state.delete()));\n return expired.length;\n }\n}\n","/**\n * Social Account Model\n *\n * Manages connected social media platform accounts for publishing.\n * Stores OAuth credentials and account settings.\n */\n\nimport { randomUUID } from 'node:crypto';\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport { field, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { SecretService } from '@happyvertical/smrt-secrets';\nimport {\n getCurrentTenant,\n TenantScoped,\n tenantId,\n withTenant,\n} from '@happyvertical/smrt-tenancy';\nimport { getSocialPlatformSetup } from './server.js';\n\n/**\n * Supported social platforms\n */\nexport type SocialPlatformType =\n | 'youtube'\n | 'threads'\n | 'x'\n | 'bluesky'\n | 'facebook';\n\n/**\n * Account connection status\n */\nexport type AccountStatus =\n | 'connected'\n | 'disconnected'\n | 'expired'\n | 'missing_permissions'\n | 'error';\n\n/**\n * Link behavior for posts with links\n */\nexport type LinkBehavior =\n | 'description'\n | 'inline'\n | 'attachment'\n | 'reply'\n | 'none';\n\n/**\n * Controls how far publish operations are allowed to go.\n */\nexport type PublishMode =\n | 'dry_run'\n | 'stage_remote'\n | 'private_or_scheduled'\n | 'public';\n\n/**\n * Social account creation options\n */\nexport interface SocialAccountOptions extends SmrtObjectOptions {\n /**\n * Human-readable name for the account\n */\n name?: string;\n\n /**\n * Social platform type\n */\n platform?: SocialPlatformType;\n\n /**\n * Platform-specific user ID\n */\n platformUserId?: string | null;\n\n /**\n * Platform username/handle\n */\n platformUsername?: string | null;\n\n /**\n * Profile URL on the platform\n */\n platformUrl?: string | null;\n\n /**\n * Deprecated raw OAuth access token\n */\n accessToken?: string | null;\n\n /**\n * Deprecated raw OAuth refresh token\n */\n refreshToken?: string | null;\n\n /**\n * Secret name containing the full platform credential payload\n */\n credentialSecretId?: string | null;\n\n /**\n * Secret name containing the OAuth access token\n */\n accessTokenSecretName?: string | null;\n\n /**\n * Secret name containing the OAuth refresh token\n */\n refreshTokenSecretName?: string | null;\n\n /**\n * Token expiration time\n */\n tokenExpiresAt?: Date | null;\n\n /**\n * Whether the account is active\n * @default true\n */\n isActive?: boolean;\n\n /**\n * Default hashtags to add to posts\n */\n defaultHashtags?: string[];\n\n /**\n * Granted OAuth scopes or platform permissions\n */\n scopes?: string[];\n\n /**\n * Required permissions that still need approval/granting\n */\n missingPermissions?: string[];\n\n /**\n * How to handle links in posts\n * @default 'description'\n */\n linkBehavior?: LinkBehavior;\n\n /**\n * Safety mode for publish operations.\n * @default 'dry_run'\n */\n publishMode?: PublishMode;\n\n /**\n * Separate latch required before public publishing can happen.\n * @default false\n */\n publicPublishingAllowed?: boolean;\n\n /**\n * Account connection status\n * @default 'connected'\n */\n status?: AccountStatus;\n\n /**\n * Error message if status is 'error'\n */\n errorMessage?: string | null;\n\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n}\n\n/**\n * Connected social media account for publishing\n *\n * SocialAccount represents a connected social platform account\n * with OAuth credentials and publishing settings. Accounts can\n * be used to publish content to multiple platforms.\n *\n * @example\n * ```typescript\n * import { SocialAccount } from '@happyvertical/smrt-social';\n *\n * const account = new SocialAccount({\n * name: 'Bentley News YouTube',\n * platform: 'youtube',\n * platformUserId: 'UC...',\n * platformUsername: 'Bentley News',\n * accessToken: '...encrypted...',\n * refreshToken: '...encrypted...',\n * tokenExpiresAt: new Date('2026-02-25'),\n * defaultHashtags: ['news', 'local', 'bentley'],\n * linkBehavior: 'description',\n * });\n * await account.save();\n * ```\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'update', 'delete'],\n },\n mcp: {\n include: ['list', 'get'],\n },\n cli: { skipApiCheck: true },\n})\nexport class SocialAccount extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Human-readable name for the account\n */\n @field({ description: 'A name you will recognise this account by.' })\n name: string = '';\n\n /**\n * Social platform type\n */\n @field({\n description: 'Which platform it is on: YouTube, X, Threads or Bluesky.',\n })\n platform: SocialPlatformType = 'youtube';\n\n /**\n * Platform-specific user ID\n */\n platformUserId: string | null = null;\n\n /**\n * Platform username/handle\n */\n @field({ description: 'The username or handle you post under.' })\n platformUsername: string | null = null;\n\n /**\n * Profile URL on the platform\n */\n @field({ description: 'The web address of your profile on the platform.' })\n platformUrl: string | null = null;\n\n /**\n * Deprecated raw OAuth access token.\n * Prefer credentialSecretId/accessTokenSecretName.\n */\n accessToken: string | null = null;\n\n /**\n * Deprecated raw OAuth refresh token.\n * Prefer credentialSecretId/refreshTokenSecretName.\n */\n refreshToken: string | null = null;\n\n /**\n * Secret name containing the complete platform credential payload.\n */\n credentialSecretId: string | null = null;\n\n /**\n * Secret name containing only the access token.\n */\n accessTokenSecretName: string | null = null;\n\n /**\n * Secret name containing only the refresh token.\n */\n refreshTokenSecretName: string | null = null;\n\n /**\n * Token expiration time\n */\n tokenExpiresAt: Date | null = null;\n\n /**\n * Whether the account is active\n */\n @field({\n description: 'Whether posts can still go out from this account.',\n })\n isActive: boolean = true;\n\n /**\n * Default hashtags to add to posts\n */\n @field({ description: 'Hashtags added to every post from this account.' })\n defaultHashtags: string[] = [];\n\n /**\n * Granted OAuth scopes or platform permissions.\n */\n scopes: string[] = [];\n\n /**\n * Required permissions that still need app review or user grant.\n */\n missingPermissions: string[] = [];\n\n /**\n * How to handle links in posts\n * - description: Include link in post body/description\n * - reply: Post link as a reply (better for X algorithm)\n * - none: Don't include link\n */\n @field({\n description:\n 'Where a shared link goes: in the text, as a reply, or left out.',\n })\n linkBehavior: LinkBehavior = 'description';\n\n /**\n * Safety mode for publish operations.\n */\n publishMode: PublishMode = 'dry_run';\n\n /**\n * Separate latch required before public publishing is allowed.\n */\n publicPublishingAllowed: boolean = false;\n\n /**\n * Account connection status\n */\n @field({\n description: 'Whether the account is connected, or needs signing in again.',\n })\n status: AccountStatus = 'connected';\n\n /**\n * Error message if status is 'error'\n */\n errorMessage: string | null = null;\n\n constructor(options: SocialAccountOptions = {}) {\n super(options);\n\n if (options.name !== undefined) this.name = options.name;\n if (options.platform !== undefined) this.platform = options.platform;\n if (options.platformUserId !== undefined)\n this.platformUserId = options.platformUserId;\n if (options.platformUsername !== undefined)\n this.platformUsername = options.platformUsername;\n if (options.platformUrl !== undefined)\n this.platformUrl = options.platformUrl;\n if (options.accessToken !== undefined)\n this.accessToken = options.accessToken;\n if (options.refreshToken !== undefined)\n this.refreshToken = options.refreshToken;\n if (options.credentialSecretId !== undefined)\n this.credentialSecretId = options.credentialSecretId;\n if (options.accessTokenSecretName !== undefined)\n this.accessTokenSecretName = options.accessTokenSecretName;\n if (options.refreshTokenSecretName !== undefined)\n this.refreshTokenSecretName = options.refreshTokenSecretName;\n if (options.tokenExpiresAt !== undefined)\n this.tokenExpiresAt = options.tokenExpiresAt;\n if (options.isActive !== undefined) this.isActive = options.isActive;\n if (options.defaultHashtags !== undefined)\n this.defaultHashtags = options.defaultHashtags;\n if (options.scopes !== undefined) this.scopes = options.scopes;\n if (options.missingPermissions !== undefined)\n this.missingPermissions = options.missingPermissions;\n if (options.linkBehavior !== undefined)\n this.linkBehavior = options.linkBehavior;\n if (options.publishMode !== undefined)\n this.publishMode = options.publishMode;\n if (options.publicPublishingAllowed !== undefined)\n this.publicPublishingAllowed = options.publicPublishingAllowed;\n if (options.status !== undefined) this.status = options.status;\n if (options.errorMessage !== undefined)\n this.errorMessage = options.errorMessage;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n\n if (options.platform !== undefined) {\n const setup = getSocialPlatformSetup(this.platform);\n if (options.linkBehavior === undefined) {\n this.linkBehavior = setup.defaultLinkBehavior;\n }\n if (options.publishMode === undefined) {\n this.publishMode = setup.defaultPublishMode;\n }\n }\n }\n\n /**\n * Social accounts need a slug identity that is scoped by tenant and platform.\n * A newsroom may connect `@localnews` on X, YouTube, Threads, and Facebook;\n * the generic name-derived slug would make those accounts overwrite each\n * other through SMRT's slug/context upsert identity.\n */\n async getSlug(): Promise<string | null | undefined> {\n if (!this.slug) {\n const identity =\n this.platformUserId || this.platformUsername || this.name || this.id;\n if (!identity) {\n return this.slug;\n }\n\n const source = [\n this.tenantId ? `tenant-${this.tenantId}` : 'no-tenant',\n this.platform,\n identity,\n ]\n .filter(Boolean)\n .join('-');\n\n this.slug = source\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/(^-|-$)/g, '');\n }\n\n return this.slug;\n }\n\n /**\n * Check if the token is expired or will expire soon\n */\n get isTokenExpired(): boolean {\n if (!this.tokenExpiresAt) return false;\n // Expire 5 minutes early to allow for refresh\n const expiryBuffer = 5 * 60 * 1000;\n return Date.now() >= this.tokenExpiresAt.getTime() - expiryBuffer;\n }\n\n /**\n * Check if the account needs attention (expired or error)\n */\n get needsAttention(): boolean {\n return (\n this.status !== 'connected' ||\n this.isTokenExpired ||\n this.missingPermissions.length > 0 ||\n (this.publishMode === 'public' && !this.publicPublishingAllowed)\n );\n }\n\n /**\n * Check if the account is ready for publishing\n */\n get isReady(): boolean {\n return (\n this.isActive &&\n this.status === 'connected' &&\n this.hasCredentials &&\n this.missingPermissions.length === 0 &&\n !this.isTokenExpired &&\n (this.publishMode !== 'public' || this.publicPublishingAllowed)\n );\n }\n\n /**\n * Effective publish mode after applying the public-publishing latch.\n */\n get effectivePublishMode(): PublishMode {\n if (this.publishMode === 'public' && !this.publicPublishingAllowed) {\n return 'dry_run';\n }\n return this.publishMode;\n }\n\n /**\n * Check whether any usable credential reference exists.\n */\n get hasCredentials(): boolean {\n return Boolean(\n this.credentialSecretId || this.accessTokenSecretName || this.accessToken,\n );\n }\n\n /**\n * Store all platform credentials in smrt-secrets as a single JSON payload.\n */\n async setCredentials(\n credentials: Record<string, unknown>,\n options: {\n description?: string;\n category?: string;\n } = {},\n ): Promise<void> {\n if (!this.id) {\n this.id = randomUUID();\n }\n\n const secretName = this.credentialSecretId ?? `social-account-${this.id}`;\n const tenantId = this.requireCredentialTenantId(\n 'store social account credentials',\n );\n const secretService = await SecretService.create({ db: this.db });\n\n await secretService.storeForTenant(\n tenantId,\n secretName,\n JSON.stringify(credentials),\n {\n description: options.description ?? `Credentials for ${this.name}`,\n category: options.category ?? 'social',\n },\n );\n\n this.credentialSecretId = secretName;\n\n await this.withCredentialTenantContext(async () => {\n await this.save();\n });\n }\n\n /**\n * Retrieve platform credentials from smrt-secrets, falling back to deprecated fields.\n */\n async getCredentials(): Promise<Record<string, unknown> | null> {\n if (!this.credentialSecretId) {\n if (this.accessTokenSecretName || this.refreshTokenSecretName) {\n const tenantId = this.requireCredentialTenantId(\n 'retrieve social account credentials',\n );\n const secretService = await SecretService.create({ db: this.db });\n const credentials: Record<string, unknown> = {};\n\n if (this.accessTokenSecretName) {\n const secret = await secretService.retrieveForTenant(\n tenantId,\n this.accessTokenSecretName,\n );\n credentials.accessToken = secret.value;\n }\n\n if (this.refreshTokenSecretName) {\n const secret = await secretService.retrieveForTenant(\n tenantId,\n this.refreshTokenSecretName,\n );\n credentials.refreshToken = secret.value;\n }\n\n return credentials;\n }\n\n if (!this.accessToken && !this.refreshToken) return null;\n return {\n accessToken: this.accessToken,\n refreshToken: this.refreshToken,\n };\n }\n\n const credentialSecretId = this.credentialSecretId;\n const tenantId = this.requireCredentialTenantId(\n 'retrieve social account credentials',\n );\n const secretService = await SecretService.create({ db: this.db });\n const secret = await secretService.retrieveForTenant(\n tenantId,\n credentialSecretId,\n );\n return JSON.parse(secret.value);\n }\n\n private async withCredentialTenantContext<T>(\n fn: () => Promise<T>,\n ): Promise<T> {\n const tenantId = this.getCredentialTenantId();\n const currentTenantId = getCurrentTenant()?.tenantId;\n\n if (!tenantId || currentTenantId === tenantId) {\n return fn();\n }\n\n return withTenant({ tenantId }, fn);\n }\n\n private getCredentialTenantId(): string | null {\n if (this.tenantId) {\n return this.tenantId;\n }\n\n return getCurrentTenant()?.tenantId ?? null;\n }\n\n private requireCredentialTenantId(action: string): string {\n const tenantId = this.getCredentialTenantId();\n if (!tenantId) {\n throw new Error(`Tenant context required to ${action}.`);\n }\n return tenantId;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { SocialAccount, type SocialPlatformType } from '../social-account.js';\n\nexport class SocialAccountCollection extends SmrtCollection<SocialAccount> {\n static readonly _itemClass = SocialAccount;\n\n async findActive(platform?: SocialPlatformType): Promise<SocialAccount[]> {\n const accounts = await this.list({\n where: {\n isActive: true,\n ...(platform ? { platform } : {}),\n },\n orderBy: 'name ASC',\n });\n\n return accounts;\n }\n\n async findReady(platform?: SocialPlatformType): Promise<SocialAccount[]> {\n const accounts = await this.findActive(platform);\n return accounts.filter((account) => account.isReady);\n }\n\n async findNeedsAttention(): Promise<SocialAccount[]> {\n const accounts = await this.list({\n where: { isActive: true },\n orderBy: 'name ASC',\n });\n return accounts.filter((account) => account.needsAttention);\n }\n}\n","/**\n * Social Post Model\n *\n * Manages posts published or scheduled to social media platforms.\n * Tracks publishing status and engagement analytics.\n */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport {\n crossPackageRef,\n field,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { SocialAccount } from './social-account.js';\n\n/**\n * Post status\n */\nexport type PostStatus =\n | 'draft'\n | 'pending_approval'\n | 'approved'\n | 'scheduled'\n | 'publishing'\n | 'dry_run'\n | 'staged'\n | 'published'\n | 'failed'\n | 'cancelled';\n\n/**\n * Social post type\n */\nexport type SocialPostType = 'text' | 'link' | 'image' | 'video';\n\n/**\n * Post analytics\n */\nexport interface PostAnalytics {\n /**\n * View/impression count\n */\n views?: number;\n\n /**\n * Impression count when the platform distinguishes it from views\n */\n impressions?: number;\n\n /**\n * Like/favorite count\n */\n likes?: number;\n\n /**\n * Comment count\n */\n comments?: number;\n\n /**\n * Share/repost count\n */\n shares?: number;\n\n /**\n * Link click count\n */\n clicks?: number;\n\n /**\n * Raw platform analytics payload\n */\n raw?: unknown;\n\n /**\n * When analytics were last updated\n */\n lastUpdated?: Date;\n}\n\n/**\n * Social post creation options\n */\nexport interface SocialPostOptions extends SmrtObjectOptions {\n /**\n * Social account to publish to\n */\n socialAccountId?: string | null;\n\n /**\n * Video content to publish\n */\n videoContentId?: string | null;\n\n /**\n * Generic content ID (for non-video content)\n */\n contentId?: string | null;\n\n /**\n * High-level post type\n */\n postType?: SocialPostType;\n\n /**\n * Public media URL for platforms that cannot upload buffers\n */\n mediaUrl?: string | null;\n\n /**\n * Post title (for platforms that support it)\n */\n title?: string | null;\n\n /**\n * Post description/caption\n */\n description?: string;\n\n /**\n * Hashtags to include\n */\n hashtags?: string[];\n\n /**\n * Link URL to include\n */\n linkUrl?: string | null;\n\n /**\n * Platform-specific post ID (after publishing)\n */\n platformPostId?: string | null;\n\n /**\n * Public post URL (after publishing)\n */\n platformUrl?: string | null;\n\n /**\n * Scheduled publish time\n */\n scheduledAt?: Date | null;\n\n /**\n * Actual publish time\n */\n publishedAt?: Date | null;\n\n /**\n * Post status\n * @default 'draft'\n */\n status?: PostStatus;\n\n /**\n * Error message if status is 'failed'\n */\n errorMessage?: string | null;\n\n /**\n * Engagement analytics\n */\n analytics?: PostAnalytics;\n\n /**\n * When analytics were last synced\n */\n analyticsLastSyncedAt?: Date | null;\n\n /**\n * User who created (drafted, scheduled, or published) the post\n */\n createdByUserId?: string | null;\n\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n}\n\n/**\n * Social media post for multi-platform publishing\n *\n * SocialPost represents a post published or scheduled to a social\n * platform. It tracks publishing status and engagement analytics,\n * and can reference VideoContent for video posts.\n *\n * @example\n * ```typescript\n * import { SocialPost } from '@happyvertical/smrt-social';\n *\n * const post = new SocialPost({\n * socialAccountId: 'account-123',\n * videoContentId: 'video-456',\n * title: 'Breaking News from Bentley',\n * description: 'Latest updates from the town council meeting.',\n * hashtags: ['news', 'local', 'bentley'],\n * linkUrl: 'https://example.com/article',\n * scheduledAt: new Date('2026-01-26T18:00:00Z'),\n * });\n * await post.save();\n * ```\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'update', 'delete'],\n },\n mcp: {\n include: ['list', 'get'],\n },\n cli: true,\n})\nexport class SocialPost extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n /**\n * Tenant ID for multi-tenant isolation\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Social account to publish to\n */\n @field({ description: 'The connected account this post goes out from.' })\n @foreignKey(SocialAccount)\n socialAccountId: string | null = null;\n\n /**\n * User who created the post: drafted it, scheduled it, or published it\n * directly. Hosts use it to tell the poster when publishing fails.\n *\n * A `@crossPackageRef` to `@happyvertical/smrt-users:User`, so a native uuid\n * column on PostgreSQL with no DDL FK. Null for posts created before the\n * column existed and for posts an agent or schedule created with no person\n * behind them. Set through `SocialPostCollection.createDraft()`; the\n * publish-outcome helpers (`recordPublishSuccess`/`Failure`) never change it.\n */\n @crossPackageRef('@happyvertical/smrt-users:User')\n createdByUserId: string | null = null;\n\n /**\n * Video content to publish\n *\n * Cross-package target (`@happyvertical/smrt-video`), so it is a\n * `@crossPackageRef` rather than a `@foreignKey`: no DDL FK constraint and\n * no value import back into this package.\n */\n @crossPackageRef('@happyvertical/smrt-video:VideoShot')\n videoContentId: string | null = null;\n\n /**\n * Generic content ID (for non-video content)\n */\n @crossPackageRef('@happyvertical/smrt-content:Content')\n contentId: string | null = null;\n\n /**\n * High-level post type\n */\n @field({\n description: 'What kind of post it is: text, link, image or video.',\n })\n postType: SocialPostType = 'text';\n\n /**\n * Public media URL for platforms that require URL media publishing\n */\n mediaUrl: string | null = null;\n\n /**\n * Post title (for platforms that support it)\n */\n @field({ description: 'A title, for platforms that show one.' })\n title: string | null = null;\n\n /**\n * Post description/caption\n */\n @field({ description: 'The words of the post.' })\n description: string = '';\n\n /**\n * Hashtags to include\n */\n @field({ description: 'Hashtags added to the end of the post.' })\n hashtags: string[] = [];\n\n /**\n * Link URL to include in the post\n */\n @field({ description: 'A web address to share with the post.' })\n linkUrl: string | null = null;\n\n /**\n * Platform-specific post ID (set after publishing)\n */\n platformPostId: string | null = null;\n\n /**\n * Public post URL (set after publishing)\n */\n @field({\n description: 'Where the post can be seen on the platform, once it is out.',\n })\n platformUrl: string | null = null;\n\n /**\n * Scheduled publish time\n * If set, post will be scheduled instead of published immediately\n */\n @field({\n description:\n '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.',\n })\n scheduledAt: Date | null = null;\n\n /**\n * Actual publish time\n */\n @field({ description: 'When the post actually went out.' })\n publishedAt: Date | null = null;\n\n /**\n * Post status\n * - draft: Not yet submitted for publishing\n * - pending_approval: Awaiting editorial approval\n * - approved: Approved and ready to publish\n * - scheduled: Queued for future publishing\n * - publishing: Currently being published\n * - dry_run: Payload was validated without remote write\n * - staged: Non-public platform object/container was created\n * - published: Successfully published\n * - failed: Publishing failed\n * - cancelled: Publishing was cancelled\n */\n @field({\n description:\n 'Where the post stands: draft, waiting to go out, published or failed.',\n })\n status: PostStatus = 'draft';\n\n /**\n * Error message if status is 'failed'\n */\n errorMessage: string | null = null;\n\n /**\n * Engagement analytics\n */\n analytics: PostAnalytics = {};\n\n /**\n * When analytics were last synced\n */\n analyticsLastSyncedAt: Date | null = null;\n\n constructor(options: SocialPostOptions = {}) {\n super(options);\n\n if (options.socialAccountId !== undefined)\n this.socialAccountId = options.socialAccountId;\n if (options.videoContentId !== undefined)\n this.videoContentId = options.videoContentId;\n if (options.contentId !== undefined) this.contentId = options.contentId;\n if (options.postType !== undefined) this.postType = options.postType;\n if (options.mediaUrl !== undefined) this.mediaUrl = options.mediaUrl;\n if (options.title !== undefined) this.title = options.title;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.hashtags !== undefined) this.hashtags = options.hashtags;\n if (options.linkUrl !== undefined) this.linkUrl = options.linkUrl;\n if (options.platformPostId !== undefined)\n this.platformPostId = options.platformPostId;\n if (options.platformUrl !== undefined)\n this.platformUrl = options.platformUrl;\n if (options.scheduledAt !== undefined)\n this.scheduledAt = options.scheduledAt;\n if (options.publishedAt !== undefined)\n this.publishedAt = options.publishedAt;\n if (options.status !== undefined) this.status = options.status;\n if (options.errorMessage !== undefined)\n this.errorMessage = options.errorMessage;\n if (options.analytics !== undefined) this.analytics = options.analytics;\n if (options.analyticsLastSyncedAt !== undefined)\n this.analyticsLastSyncedAt = options.analyticsLastSyncedAt;\n if (options.createdByUserId !== undefined)\n this.createdByUserId = options.createdByUserId;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n\n /**\n * Check if the post is scheduled for future publishing\n */\n get isScheduled(): boolean {\n return this.status === 'scheduled' && this.scheduledAt !== null;\n }\n\n /**\n * Check if the post has been published\n */\n get isPublished(): boolean {\n return this.status === 'published';\n }\n\n /**\n * Check if the post can be edited (draft or failed)\n */\n get isEditable(): boolean {\n return (\n this.status === 'draft' ||\n this.status === 'pending_approval' ||\n this.status === 'failed'\n );\n }\n\n /**\n * Check if the post is due for publishing now.\n */\n get isDueForPublish(): boolean {\n if (this.status !== 'approved' && this.status !== 'scheduled') {\n return false;\n }\n return !this.scheduledAt || this.scheduledAt.getTime() <= Date.now();\n }\n\n /**\n * Get formatted hashtag string\n */\n get hashtagString(): string {\n return this.hashtags\n .map((tag) => (tag.startsWith('#') ? tag : `#${tag}`))\n .join(' ');\n }\n\n /**\n * Get the full post text with hashtags\n */\n get fullText(): string {\n const parts = [this.description];\n if (this.hashtags.length > 0) {\n parts.push(this.hashtagString);\n }\n return parts.join('\\n\\n');\n }\n}\n","/**\n * Social Post Analytics Snapshot Model\n *\n * Stores timestamped normalized and raw platform analytics payloads.\n */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport { field, foreignKey, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { SocialPlatformType } from './social-account.js';\nimport { type PostAnalytics, SocialPost } from './social-post.js';\n\nexport type RawAnalyticsPayload = Record<string, unknown> | unknown[] | null;\n\nexport interface SocialPostAnalyticsSnapshotOptions extends SmrtObjectOptions {\n /**\n * Tenant ID for multi-tenant isolation\n */\n tenantId?: string | null;\n\n /**\n * Social post being measured\n */\n socialPostId?: string | null;\n\n /**\n * Platform that produced this snapshot\n */\n platform?: SocialPlatformType | null;\n\n /**\n * Normalized platform analytics.\n */\n analytics?: PostAnalytics;\n\n /**\n * Raw platform payload\n */\n raw?: RawAnalyticsPayload;\n\n /**\n * When the platform data was captured\n */\n capturedAt?: Date;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: {\n include: ['list', 'get', 'create', 'delete'],\n },\n mcp: {\n include: ['list', 'get'],\n },\n cli: true,\n})\nexport class SocialPostAnalyticsSnapshot extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-social\";\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ description: 'The post these numbers are for.' })\n @foreignKey(SocialPost)\n socialPostId: string | null = null;\n\n @field({\n description: 'The platform that reported the numbers.',\n })\n platform: SocialPlatformType | null = null;\n\n @field({\n description:\n 'The views, likes, comments, shares and clicks the platform reported.',\n })\n analytics: PostAnalytics = {};\n\n @field({ type: 'json', nullable: true })\n raw: RawAnalyticsPayload = null;\n\n @field({ description: 'When these numbers were taken from the platform.' })\n capturedAt: Date = new Date();\n\n constructor(options: SocialPostAnalyticsSnapshotOptions = {}) {\n super(options);\n\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.socialPostId !== undefined)\n this.socialPostId = options.socialPostId;\n if (options.platform !== undefined) this.platform = options.platform;\n if (options.analytics !== undefined) this.analytics = options.analytics;\n if (options.raw !== undefined) this.raw = options.raw;\n if (options.capturedAt !== undefined) this.capturedAt = options.capturedAt;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport type { SocialPlatformType } from '../social-account.js';\nimport type { PostAnalytics } from '../social-post.js';\nimport {\n type RawAnalyticsPayload,\n SocialPostAnalyticsSnapshot,\n} from '../social-post-analytics-snapshot.js';\n\nfunction isRawAnalyticsPayload(value: unknown): value is RawAnalyticsPayload {\n return (\n value === null ||\n Array.isArray(value) ||\n (typeof value === 'object' && value !== null)\n );\n}\n\nexport class SocialPostAnalyticsSnapshotCollection extends SmrtCollection<SocialPostAnalyticsSnapshot> {\n static readonly _itemClass = SocialPostAnalyticsSnapshot;\n\n async recordSnapshot(options: {\n socialPostId: string;\n platform: SocialPlatformType;\n metrics: PostAnalytics;\n raw?: RawAnalyticsPayload;\n capturedAt?: Date;\n tenantId?: string | null;\n }): Promise<SocialPostAnalyticsSnapshot> {\n const snapshot = await this.create({\n socialPostId: options.socialPostId,\n platform: options.platform,\n analytics: options.metrics,\n raw:\n options.raw ??\n (isRawAnalyticsPayload(options.metrics.raw)\n ? options.metrics.raw\n : null),\n capturedAt: options.capturedAt ?? new Date(),\n tenantId: options.tenantId,\n });\n return snapshot;\n }\n\n async findForPost(\n socialPostId: string,\n ): Promise<SocialPostAnalyticsSnapshot[]> {\n return this.list({\n where: { socialPostId },\n orderBy: 'capturedAt DESC',\n });\n }\n\n async findLatestForPost(\n socialPostId: string,\n ): Promise<SocialPostAnalyticsSnapshot | null> {\n const snapshots = await this.findForPost(socialPostId);\n return snapshots[0] ?? null;\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n type PostAnalytics,\n type PostStatus,\n SocialPost,\n type SocialPostType,\n} from '../social-post.js';\n\nexport interface CreateSocialPostDraftOptions {\n socialAccountId: string;\n contentId?: string | null;\n videoContentId?: string | null;\n postType?: SocialPostType;\n title?: string | null;\n description?: string;\n hashtags?: string[];\n linkUrl?: string | null;\n mediaUrl?: string | null;\n scheduledAt?: Date | null;\n /**\n * User creating the post (the poster). Stored as `createdByUserId` so a\n * failed publish can be reported to them; omit for agent/schedule posts.\n */\n createdByUserId?: string | null;\n tenantId?: string | null;\n}\n\nexport interface PublishSuccessData {\n platformPostId: string;\n platformUrl: string;\n publishedAt?: Date;\n status?: PostStatus;\n}\n\nexport class SocialPostCollection extends SmrtCollection<SocialPost> {\n static readonly _itemClass = SocialPost;\n\n async createDraft(\n options: CreateSocialPostDraftOptions,\n ): Promise<SocialPost> {\n return this.create({\n ...options,\n postType:\n options.postType ??\n (options.videoContentId || options.mediaUrl\n ? 'video'\n : options.linkUrl\n ? 'link'\n : 'text'),\n status: options.scheduledAt ? 'scheduled' : 'draft',\n });\n }\n\n async findByStatus(status: PostStatus): Promise<SocialPost[]> {\n return this.list({ where: { status }, orderBy: 'scheduledAt ASC' });\n }\n\n async findForAccount(socialAccountId: string): Promise<SocialPost[]> {\n return this.list({\n where: { socialAccountId },\n orderBy: 'created_at DESC',\n });\n }\n\n async findDueForPublish(now: Date = new Date()): Promise<SocialPost[]> {\n const [approved, scheduled] = await Promise.all([\n this.list({\n where: { status: 'approved' },\n orderBy: 'scheduledAt ASC',\n }),\n this.list({\n where: { status: 'scheduled', 'scheduledAt <=': now },\n orderBy: 'scheduledAt ASC',\n }),\n ]);\n\n return [\n ...approved.filter((post) => post.isDueForPublish),\n ...scheduled,\n ].sort(\n (a, b) =>\n (a.scheduledAt?.getTime() ?? 0) - (b.scheduledAt?.getTime() ?? 0),\n );\n }\n\n async recordPublishSuccess(\n post: SocialPost,\n data: PublishSuccessData,\n ): Promise<SocialPost> {\n const status = data.status ?? 'published';\n post.platformPostId = data.platformPostId;\n post.platformUrl = data.platformUrl;\n if (status === 'published') {\n post.publishedAt = data.publishedAt ?? post.publishedAt ?? new Date();\n }\n post.status = status;\n post.errorMessage = null;\n await post.save();\n return post;\n }\n\n async recordPublishFailure(\n post: SocialPost,\n error: Error | string,\n ): Promise<SocialPost> {\n post.status = 'failed';\n post.errorMessage = formatPublishError(error);\n await post.save();\n return post;\n }\n\n async updateLatestAnalytics(\n post: SocialPost,\n analytics: PostAnalytics,\n syncedAt: Date = new Date(),\n ): Promise<SocialPost> {\n post.analytics = {\n ...analytics,\n lastUpdated: analytics.lastUpdated ?? syncedAt,\n };\n post.analyticsLastSyncedAt = syncedAt;\n await post.save();\n return post;\n }\n}\n\nfunction formatPublishError(error: Error | string): string {\n if (typeof error === 'string') {\n return error;\n }\n\n const details = [error.message];\n const code = (error as Error & { code?: unknown }).code;\n if (code !== undefined) {\n details.push(`code=${String(code)}`);\n }\n if (error.stack) {\n details.push(error.stack);\n }\n return details.join('\\n');\n}\n","/**\n * Declared recipes for smrt-social (#4409): user-facing units of\n * functionality an app or agent can pick instead of the whole package.\n * The scanner reads these statics into the `recipes` array of `manifest.json`\n * and `smrt-knowledge.json`; nothing here runs at that point.\n *\n * `OAuthState` is deliberately not listed: it is the sign-in handshake record,\n * not something a person opens.\n *\n * @packageDocumentation\n */\n\nimport { SmrtRecipe } from '@happyvertical/smrt-core';\nimport { SocialAccount } from './social-account.js';\nimport { SocialPost } from './social-post.js';\nimport { SocialPostAnalyticsSnapshot } from './social-post-analytics-snapshot.js';\n\n/** Social: Write posts for your social accounts and see how each one did. */\nexport class SocialPostsRecipe extends SmrtRecipe {\n static id = 'social.posts';\n static help = './posts.recipe.md';\n static label = 'Social';\n static summary =\n 'Write posts for your YouTube, X, Threads and Bluesky accounts, plan when they go out and see how each one did.';\n static synonyms = [\n 'social media',\n 'social posts',\n 'social accounts',\n 'youtube',\n 'bluesky',\n 'threads',\n 'tweets',\n 'post results',\n ];\n static section = {\n id: 'publish',\n label: 'Publish',\n icon: 'fileText',\n description: 'What you write, record and put out.',\n };\n static models = [SocialPost, SocialAccount, SocialPostAnalyticsSnapshot];\n static nav = [\n {\n label: 'Posts',\n model: SocialPost,\n icon: 'fileText',\n description:\n 'What you have written for each account and where it stands.',\n noun: 'post',\n },\n {\n label: 'Connected accounts',\n model: SocialAccount,\n icon: 'users',\n description: 'The social accounts you can post to, and their settings.',\n noun: 'account',\n },\n ];\n static options = {\n SocialPost: {\n fields: {\n socialAccountId: { label: 'Account', order: 1 },\n title: { order: 2 },\n description: { label: 'Text', order: 3 },\n hashtags: { order: 4 },\n linkUrl: { label: 'Link', order: 5 },\n postType: { label: 'Kind of post', order: 6 },\n scheduledAt: { label: 'Planned for', order: 7 },\n status: { locked: true, order: 8 },\n publishedAt: { label: 'Published on', locked: true, order: 9 },\n platformUrl: { label: 'Link to the post', locked: true, order: 10 },\n videoContentId: { label: 'Video', visibility: 'advanced' },\n contentId: { label: 'Content', visibility: 'advanced' },\n mediaUrl: { label: 'Media link', visibility: 'advanced' },\n errorMessage: { label: 'What went wrong', visibility: 'advanced' },\n analyticsLastSyncedAt: {\n label: 'Results last updated',\n visibility: 'advanced',\n },\n tenantId: { visibility: 'hidden' },\n createdByUserId: { visibility: 'hidden' },\n platformPostId: { visibility: 'hidden' },\n analytics: { visibility: 'hidden' },\n },\n },\n SocialAccount: {\n fields: {\n name: { order: 1 },\n platform: { order: 2 },\n platformUsername: { label: 'Username', order: 3 },\n platformUrl: { label: 'Profile link', order: 4 },\n status: { locked: true, order: 5 },\n isActive: { label: 'In use', order: 6 },\n defaultHashtags: { order: 7 },\n linkBehavior: { label: 'Where links go', order: 8 },\n publishMode: { label: 'Publishing mode', visibility: 'advanced' },\n publicPublishingAllowed: {\n label: 'Allow public posts',\n visibility: 'advanced',\n },\n platformUserId: { visibility: 'advanced' },\n tokenExpiresAt: { label: 'Connection expires', visibility: 'advanced' },\n scopes: { label: 'Permissions granted', visibility: 'advanced' },\n missingPermissions: { visibility: 'advanced' },\n errorMessage: { label: 'What went wrong', visibility: 'advanced' },\n tenantId: { visibility: 'hidden' },\n accessToken: { visibility: 'hidden' },\n refreshToken: { visibility: 'hidden' },\n credentialSecretId: { visibility: 'hidden' },\n accessTokenSecretName: { visibility: 'hidden' },\n refreshTokenSecretName: { visibility: 'hidden' },\n },\n },\n SocialPostAnalyticsSnapshot: {\n fields: {\n socialPostId: { label: 'Post', order: 1 },\n platform: { order: 2 },\n capturedAt: { label: 'Measured on', order: 3 },\n analytics: { label: 'Numbers', order: 4 },\n tenantId: { visibility: 'hidden' },\n raw: { visibility: 'hidden' },\n },\n },\n } as const;\n}\n"],"mappings":";;;;;;AAOA,eAAe,wBAAwB,KAAK,MAAM,g7lDAAw6xD,CAAC;;;;;;;;;;;;;;;;;;ACiGp9xD,IAAM,aAAN,cAAyB,WAAW;CAKzC,WAA0B;;;;CAK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