@happyvertical/smrt-social 0.49.2 → 0.49.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 +1 -1
- package/dist/manifest.json +379 -33
- package/dist/smrt-knowledge.json +8 -8
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { TenantScoped, getCurrentTenant, tenantId, withTenant } from "@happyvert
|
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { SecretService } from "@happyvertical/smrt-secrets";
|
|
6
6
|
//#region src/__smrt-register__.ts
|
|
7
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-social\",\"packageVersion\":\"0.49.2\",\"objects\":{\"@happyvertical/smrt-social:OAuthState\":{\"name\":\"oauthstate\",\"className\":\"OAuthState\",\"qualifiedName\":\"@happyvertical/smrt-social:OAuthState\",\"collection\":\"oauthstates\",\"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\"},\"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}},\"methods\":{\"verifyState\":{\"name\":\"verifyState\",\"async\":false,\"parameters\":[{\"name\":\"callbackState\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"generateState\":{\"name\":\"generateState\",\"async\":false,\"parameters\":[],\"returnType\":\"string\",\"isStatic\":true,\"isPublic\":true},\"generateCodeVerifier\":{\"name\":\"generateCodeVerifier\",\"async\":false,\"parameters\":[],\"returnType\":\"string\",\"isStatic\":true,\"isPublic\":true},\"generateCodeChallenge\":{\"name\":\"generateCodeChallenge\",\"async\":true,\"parameters\":[{\"name\":\"verifier\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<string>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"delete\"]},\"mcp\":false,\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtObject\",\"exportName\":\"OAuthState\",\"collectionExportName\":\"OAuthStateCollection\",\"schema\":{\"tableName\":\"oauth_states\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"oauth_states\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"platform\\\" TEXT DEFAULT 'youtube',\\n \\\"state\\\" TEXT DEFAULT '',\\n \\\"code_verifier\\\" TEXT,\\n \\\"redirect_uri\\\" TEXT DEFAULT '',\\n \\\"scopes\\\" JSON DEFAULT '[]',\\n \\\"expires_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"platform\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"youtube\"},\"state\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"code_verifier\":{\"type\":\"TEXT\",\"notNull\":false},\"redirect_uri\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"scopes\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"expires_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false}},\"indexes\":[{\"name\":\"oauth_states_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"oauth_states_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"oauth_states_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"709e111f\"}},\"@happyvertical/smrt-social:SocialAccount\":{\"name\":\"socialaccount\",\"className\":\"SocialAccount\",\"qualifiedName\":\"@happyvertical/smrt-social:SocialAccount\",\"collection\":\"socialaccounts\",\"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\":\"\"},\"platform\":{\"type\":\"text\",\"required\":false,\"default\":\"youtube\"},\"platformUserId\":{\"type\":\"text\",\"required\":false},\"platformUsername\":{\"type\":\"text\",\"required\":false},\"platformUrl\":{\"type\":\"text\",\"required\":false},\"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},\"defaultHashtags\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"scopes\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"missingPermissions\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"linkBehavior\":{\"type\":\"text\",\"required\":false,\"default\":\"description\"},\"publishMode\":{\"type\":\"text\",\"required\":false,\"default\":\"dry_run\"},\"publicPublishingAllowed\":{\"type\":\"boolean\",\"required\":false,\"default\":false},\"status\":{\"type\":\"text\",\"required\":false,\"default\":\"connected\"},\"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\",\"schema\":{\"tableName\":\"social_accounts\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_accounts\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"platform\\\" TEXT DEFAULT 'youtube',\\n \\\"platform_user_id\\\" TEXT,\\n \\\"platform_username\\\" TEXT,\\n \\\"platform_url\\\" TEXT,\\n \\\"access_token\\\" TEXT,\\n \\\"refresh_token\\\" TEXT,\\n \\\"credential_secret_id\\\" TEXT,\\n \\\"access_token_secret_name\\\" TEXT,\\n \\\"refresh_token_secret_name\\\" TEXT,\\n \\\"token_expires_at\\\" TIMESTAMP,\\n \\\"is_active\\\" BOOLEAN DEFAULT TRUE,\\n \\\"default_hashtags\\\" JSON DEFAULT '[]',\\n \\\"scopes\\\" JSON DEFAULT '[]',\\n \\\"missing_permissions\\\" JSON DEFAULT '[]',\\n \\\"link_behavior\\\" TEXT DEFAULT 'description',\\n \\\"publish_mode\\\" TEXT DEFAULT 'dry_run',\\n \\\"public_publishing_allowed\\\" BOOLEAN DEFAULT FALSE,\\n \\\"status\\\" TEXT DEFAULT 'connected',\\n \\\"error_message\\\" TEXT\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"platform\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"youtube\"},\"platform_user_id\":{\"type\":\"TEXT\",\"notNull\":false},\"platform_username\":{\"type\":\"TEXT\",\"notNull\":false},\"platform_url\":{\"type\":\"TEXT\",\"notNull\":false},\"access_token\":{\"type\":\"TEXT\",\"notNull\":false},\"refresh_token\":{\"type\":\"TEXT\",\"notNull\":false},\"credential_secret_id\":{\"type\":\"TEXT\",\"notNull\":false},\"access_token_secret_name\":{\"type\":\"TEXT\",\"notNull\":false},\"refresh_token_secret_name\":{\"type\":\"TEXT\",\"notNull\":false},\"token_expires_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false},\"is_active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true},\"default_hashtags\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"scopes\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"missing_permissions\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"link_behavior\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"description\"},\"publish_mode\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"dry_run\"},\"public_publishing_allowed\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":false},\"status\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"connected\"},\"error_message\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"social_accounts_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"social_accounts_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"social_accounts_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"0c175da6\"}},\"@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\"},\"platform\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"analytics\":{\"type\":\"json\",\"required\":false},\"raw\":{\"type\":\"json\",\"required\":false,\"_meta\":{\"nullable\":true}},\"capturedAt\":{\"type\":\"datetime\",\"required\":false}},\"methods\":{},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtObject\",\"exportName\":\"SocialPostAnalyticsSnapshot\",\"collectionExportName\":\"SocialPostAnalyticsSnapshotCollection\",\"validationRules\":[{\"field\":\"platform\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"social_post_analytics_snapshots\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_post_analytics_snapshots\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"social_post_id\\\" UUID,\\n \\\"platform\\\" TEXT,\\n \\\"analytics\\\" JSON,\\n \\\"raw\\\" JSON,\\n \\\"captured_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"social_post_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"social_posts\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"platform\":{\"type\":\"TEXT\",\"notNull\":false},\"analytics\":{\"type\":\"JSON\",\"notNull\":false},\"raw\":{\"type\":\"JSON\",\"notNull\":false},\"captured_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false}},\"indexes\":[{\"name\":\"social_post_analytics_snapshots_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"social_post_analytics_snapshots_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"social_post_analytics_snapshots_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"social_post_analytics_snapshots_social_post_id_idx\",\"columns\":[\"social_post_id\"]}],\"version\":\"bd17983d\"}},\"@happyvertical/smrt-social:SocialPost\":{\"name\":\"socialpost\",\"className\":\"SocialPost\",\"qualifiedName\":\"@happyvertical/smrt-social:SocialPost\",\"collection\":\"socialposts\",\"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\"},\"videoContentId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-video:VideoContent\"},\"contentId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-content:Content\"},\"postType\":{\"type\":\"text\",\"required\":false,\"default\":\"text\"},\"mediaUrl\":{\"type\":\"text\",\"required\":false},\"title\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"hashtags\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"linkUrl\":{\"type\":\"text\",\"required\":false},\"platformPostId\":{\"type\":\"text\",\"required\":false},\"platformUrl\":{\"type\":\"text\",\"required\":false},\"scheduledAt\":{\"type\":\"datetime\",\"required\":false},\"publishedAt\":{\"type\":\"datetime\",\"required\":false},\"status\":{\"type\":\"text\",\"required\":false,\"default\":\"draft\"},\"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\",\"schema\":{\"tableName\":\"social_posts\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_posts\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"social_account_id\\\" UUID,\\n \\\"video_content_id\\\" UUID,\\n \\\"content_id\\\" UUID,\\n \\\"post_type\\\" TEXT DEFAULT 'text',\\n \\\"media_url\\\" TEXT,\\n \\\"title\\\" TEXT,\\n \\\"description\\\" TEXT DEFAULT '',\\n \\\"hashtags\\\" JSON DEFAULT '[]',\\n \\\"link_url\\\" TEXT,\\n \\\"platform_post_id\\\" TEXT,\\n \\\"platform_url\\\" TEXT,\\n \\\"scheduled_at\\\" TIMESTAMP,\\n \\\"published_at\\\" TIMESTAMP,\\n \\\"status\\\" TEXT DEFAULT 'draft',\\n \\\"error_message\\\" TEXT,\\n \\\"analytics\\\" JSON,\\n \\\"analytics_last_synced_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"social_account_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"social_accounts\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"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},{\"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_video_content_id_idx\",\"columns\":[\"video_content_id\"]},{\"name\":\"social_posts_content_id_idx\",\"columns\":[\"content_id\"]}],\"version\":\"49573fcf\"}},\"@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},\"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\":{\"mcp\":false},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"OAuthState\",\"exportName\":\"OAuthStateCollection\",\"collectionExportName\":\"OAuthStateCollectionCollection\",\"schema\":{\"tableName\":\"oauth_state_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"oauth_state_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"oauth_state_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"oauth_state_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"bb1b91f9\"}},\"@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\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SocialAccount\",\"exportName\":\"SocialAccountCollection\",\"collectionExportName\":\"SocialAccountCollectionCollection\",\"schema\":{\"tableName\":\"social_account_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_account_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"social_account_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"social_account_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"eeae07d4\"}},\"@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\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SocialPostAnalyticsSnapshot\",\"exportName\":\"SocialPostAnalyticsSnapshotCollection\",\"collectionExportName\":\"SocialPostAnalyticsSnapshotCollectionCollection\",\"schema\":{\"tableName\":\"social_post_analytics_snapshot_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_post_analytics_snapshot_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"social_post_analytics_snapshot_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"social_post_analytics_snapshot_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"c98f7921\"}},\"@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\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SocialPost\",\"exportName\":\"SocialPostCollection\",\"collectionExportName\":\"SocialPostCollectionCollection\",\"schema\":{\"tableName\":\"social_post_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_post_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"social_post_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"social_post_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"1baa42c4\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-content\",\"@happyvertical/smrt-core\",\"@happyvertical/smrt-secrets\",\"@happyvertical/smrt-tenancy\",\"@happyvertical/smrt-video\"]}"));
|
|
7
|
+
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-social\",\"packageVersion\":\"0.49.4\",\"objects\":{\"@happyvertical/smrt-social:OAuthState\":{\"name\":\"oauthstate\",\"className\":\"OAuthState\",\"qualifiedName\":\"@happyvertical/smrt-social:OAuthState\",\"collection\":\"oauthstates\",\"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\"},\"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}},\"methods\":{\"verifyState\":{\"name\":\"verifyState\",\"async\":false,\"parameters\":[{\"name\":\"callbackState\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"generateState\":{\"name\":\"generateState\",\"async\":false,\"parameters\":[],\"returnType\":\"string\",\"isStatic\":true,\"isPublic\":true},\"generateCodeVerifier\":{\"name\":\"generateCodeVerifier\",\"async\":false,\"parameters\":[],\"returnType\":\"string\",\"isStatic\":true,\"isPublic\":true},\"generateCodeChallenge\":{\"name\":\"generateCodeChallenge\",\"async\":true,\"parameters\":[{\"name\":\"verifier\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<string>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"delete\"]},\"mcp\":false,\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtObject\",\"exportName\":\"OAuthState\",\"collectionExportName\":\"OAuthStateCollection\",\"schema\":{\"tableName\":\"oauth_states\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"oauth_states\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"platform\\\" TEXT DEFAULT 'youtube',\\n \\\"state\\\" TEXT DEFAULT '',\\n \\\"code_verifier\\\" TEXT,\\n \\\"redirect_uri\\\" TEXT DEFAULT '',\\n \\\"scopes\\\" JSON DEFAULT '[]',\\n \\\"expires_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"platform\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"youtube\"},\"state\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"code_verifier\":{\"type\":\"TEXT\",\"notNull\":false},\"redirect_uri\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"scopes\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"expires_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false}},\"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\"]}],\"version\":\"709e111f\"}},\"@happyvertical/smrt-social:SocialAccount\":{\"name\":\"socialaccount\",\"className\":\"SocialAccount\",\"qualifiedName\":\"@happyvertical/smrt-social:SocialAccount\",\"collection\":\"socialaccounts\",\"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\":\"\"},\"platform\":{\"type\":\"text\",\"required\":false,\"default\":\"youtube\"},\"platformUserId\":{\"type\":\"text\",\"required\":false},\"platformUsername\":{\"type\":\"text\",\"required\":false},\"platformUrl\":{\"type\":\"text\",\"required\":false},\"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},\"defaultHashtags\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"scopes\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"missingPermissions\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"linkBehavior\":{\"type\":\"text\",\"required\":false,\"default\":\"description\"},\"publishMode\":{\"type\":\"text\",\"required\":false,\"default\":\"dry_run\"},\"publicPublishingAllowed\":{\"type\":\"boolean\",\"required\":false,\"default\":false},\"status\":{\"type\":\"text\",\"required\":false,\"default\":\"connected\"},\"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\",\"schema\":{\"tableName\":\"social_accounts\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_accounts\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"platform\\\" TEXT DEFAULT 'youtube',\\n \\\"platform_user_id\\\" TEXT,\\n \\\"platform_username\\\" TEXT,\\n \\\"platform_url\\\" TEXT,\\n \\\"access_token\\\" TEXT,\\n \\\"refresh_token\\\" TEXT,\\n \\\"credential_secret_id\\\" TEXT,\\n \\\"access_token_secret_name\\\" TEXT,\\n \\\"refresh_token_secret_name\\\" TEXT,\\n \\\"token_expires_at\\\" TIMESTAMP,\\n \\\"is_active\\\" BOOLEAN DEFAULT TRUE,\\n \\\"default_hashtags\\\" JSON DEFAULT '[]',\\n \\\"scopes\\\" JSON DEFAULT '[]',\\n \\\"missing_permissions\\\" JSON DEFAULT '[]',\\n \\\"link_behavior\\\" TEXT DEFAULT 'description',\\n \\\"publish_mode\\\" TEXT DEFAULT 'dry_run',\\n \\\"public_publishing_allowed\\\" BOOLEAN DEFAULT FALSE,\\n \\\"status\\\" TEXT DEFAULT 'connected',\\n \\\"error_message\\\" TEXT\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"platform\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"youtube\"},\"platform_user_id\":{\"type\":\"TEXT\",\"notNull\":false},\"platform_username\":{\"type\":\"TEXT\",\"notNull\":false},\"platform_url\":{\"type\":\"TEXT\",\"notNull\":false},\"access_token\":{\"type\":\"TEXT\",\"notNull\":false},\"refresh_token\":{\"type\":\"TEXT\",\"notNull\":false},\"credential_secret_id\":{\"type\":\"TEXT\",\"notNull\":false},\"access_token_secret_name\":{\"type\":\"TEXT\",\"notNull\":false},\"refresh_token_secret_name\":{\"type\":\"TEXT\",\"notNull\":false},\"token_expires_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false},\"is_active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true},\"default_hashtags\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"scopes\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"missing_permissions\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"link_behavior\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"description\"},\"publish_mode\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"dry_run\"},\"public_publishing_allowed\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":false},\"status\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"connected\"},\"error_message\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"social_accounts_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"social_accounts_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"social_accounts_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"0c175da6\"}},\"@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\"},\"platform\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"analytics\":{\"type\":\"json\",\"required\":false},\"raw\":{\"type\":\"json\",\"required\":false,\"_meta\":{\"nullable\":true}},\"capturedAt\":{\"type\":\"datetime\",\"required\":false}},\"methods\":{},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtObject\",\"exportName\":\"SocialPostAnalyticsSnapshot\",\"collectionExportName\":\"SocialPostAnalyticsSnapshotCollection\",\"validationRules\":[{\"field\":\"platform\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"social_post_analytics_snapshots\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_post_analytics_snapshots\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"social_post_id\\\" UUID,\\n \\\"platform\\\" TEXT,\\n \\\"analytics\\\" JSON,\\n \\\"raw\\\" JSON,\\n \\\"captured_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"social_post_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"social_posts\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"platform\":{\"type\":\"TEXT\",\"notNull\":false},\"analytics\":{\"type\":\"JSON\",\"notNull\":false},\"raw\":{\"type\":\"JSON\",\"notNull\":false},\"captured_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false}},\"indexes\":[{\"name\":\"social_post_analytics_snapshots_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"social_post_analytics_snapshots_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"social_post_analytics_snapshots_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"social_post_analytics_snapshots_social_post_id_idx\",\"columns\":[\"social_post_id\"]}],\"version\":\"bd17983d\"}},\"@happyvertical/smrt-social:SocialPost\":{\"name\":\"socialpost\",\"className\":\"SocialPost\",\"qualifiedName\":\"@happyvertical/smrt-social:SocialPost\",\"collection\":\"socialposts\",\"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\"},\"videoContentId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-video:VideoContent\"},\"contentId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-content:Content\"},\"postType\":{\"type\":\"text\",\"required\":false,\"default\":\"text\"},\"mediaUrl\":{\"type\":\"text\",\"required\":false},\"title\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"hashtags\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"linkUrl\":{\"type\":\"text\",\"required\":false},\"platformPostId\":{\"type\":\"text\",\"required\":false},\"platformUrl\":{\"type\":\"text\",\"required\":false},\"scheduledAt\":{\"type\":\"datetime\",\"required\":false},\"publishedAt\":{\"type\":\"datetime\",\"required\":false},\"status\":{\"type\":\"text\",\"required\":false,\"default\":\"draft\"},\"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\",\"schema\":{\"tableName\":\"social_posts\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_posts\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"social_account_id\\\" UUID,\\n \\\"video_content_id\\\" UUID,\\n \\\"content_id\\\" UUID,\\n \\\"post_type\\\" TEXT DEFAULT 'text',\\n \\\"media_url\\\" TEXT,\\n \\\"title\\\" TEXT,\\n \\\"description\\\" TEXT DEFAULT '',\\n \\\"hashtags\\\" JSON DEFAULT '[]',\\n \\\"link_url\\\" TEXT,\\n \\\"platform_post_id\\\" TEXT,\\n \\\"platform_url\\\" TEXT,\\n \\\"scheduled_at\\\" TIMESTAMP,\\n \\\"published_at\\\" TIMESTAMP,\\n \\\"status\\\" TEXT DEFAULT 'draft',\\n \\\"error_message\\\" TEXT,\\n \\\"analytics\\\" JSON,\\n \\\"analytics_last_synced_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"social_account_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"social_accounts\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"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_video_content_id_idx\",\"columns\":[\"video_content_id\"]},{\"name\":\"social_posts_content_id_idx\",\"columns\":[\"content_id\"]}],\"version\":\"49573fcf\"}},\"@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},\"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\":{\"mcp\":false},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"OAuthState\",\"exportName\":\"OAuthStateCollection\",\"collectionExportName\":\"OAuthStateCollectionCollection\",\"schema\":{\"tableName\":\"oauth_states\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"oauth_states\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"platform\\\" TEXT DEFAULT 'youtube',\\n \\\"state\\\" TEXT DEFAULT '',\\n \\\"code_verifier\\\" TEXT,\\n \\\"redirect_uri\\\" TEXT DEFAULT '',\\n \\\"scopes\\\" JSON DEFAULT '[]',\\n \\\"expires_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"platform\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"youtube\"},\"state\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"code_verifier\":{\"type\":\"TEXT\",\"notNull\":false},\"redirect_uri\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"scopes\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"expires_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false}},\"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\"]}],\"version\":\"709e111f\"}},\"@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\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SocialAccount\",\"exportName\":\"SocialAccountCollection\",\"collectionExportName\":\"SocialAccountCollectionCollection\",\"schema\":{\"tableName\":\"social_accounts\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_accounts\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"name\\\" TEXT DEFAULT '',\\n \\\"platform\\\" TEXT DEFAULT 'youtube',\\n \\\"platform_user_id\\\" TEXT,\\n \\\"platform_username\\\" TEXT,\\n \\\"platform_url\\\" TEXT,\\n \\\"access_token\\\" TEXT,\\n \\\"refresh_token\\\" TEXT,\\n \\\"credential_secret_id\\\" TEXT,\\n \\\"access_token_secret_name\\\" TEXT,\\n \\\"refresh_token_secret_name\\\" TEXT,\\n \\\"token_expires_at\\\" TIMESTAMP,\\n \\\"is_active\\\" BOOLEAN DEFAULT TRUE,\\n \\\"default_hashtags\\\" JSON DEFAULT '[]',\\n \\\"scopes\\\" JSON DEFAULT '[]',\\n \\\"missing_permissions\\\" JSON DEFAULT '[]',\\n \\\"link_behavior\\\" TEXT DEFAULT 'description',\\n \\\"publish_mode\\\" TEXT DEFAULT 'dry_run',\\n \\\"public_publishing_allowed\\\" BOOLEAN DEFAULT FALSE,\\n \\\"status\\\" TEXT DEFAULT 'connected',\\n \\\"error_message\\\" TEXT\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"\"},\"platform\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"youtube\"},\"platform_user_id\":{\"type\":\"TEXT\",\"notNull\":false},\"platform_username\":{\"type\":\"TEXT\",\"notNull\":false},\"platform_url\":{\"type\":\"TEXT\",\"notNull\":false},\"access_token\":{\"type\":\"TEXT\",\"notNull\":false},\"refresh_token\":{\"type\":\"TEXT\",\"notNull\":false},\"credential_secret_id\":{\"type\":\"TEXT\",\"notNull\":false},\"access_token_secret_name\":{\"type\":\"TEXT\",\"notNull\":false},\"refresh_token_secret_name\":{\"type\":\"TEXT\",\"notNull\":false},\"token_expires_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false},\"is_active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true},\"default_hashtags\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"scopes\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"missing_permissions\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]},\"link_behavior\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"description\"},\"publish_mode\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"dry_run\"},\"public_publishing_allowed\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":false},\"status\":{\"type\":\"TEXT\",\"notNull\":false,\"default\":\"connected\"},\"error_message\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"social_accounts_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"social_accounts_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"social_accounts_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"0c175da6\"}},\"@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\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SocialPostAnalyticsSnapshot\",\"exportName\":\"SocialPostAnalyticsSnapshotCollection\",\"collectionExportName\":\"SocialPostAnalyticsSnapshotCollectionCollection\",\"schema\":{\"tableName\":\"social_post_analytics_snapshots\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_post_analytics_snapshots\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"social_post_id\\\" UUID,\\n \\\"platform\\\" TEXT,\\n \\\"analytics\\\" JSON,\\n \\\"raw\\\" JSON,\\n \\\"captured_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"social_post_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"social_posts\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"platform\":{\"type\":\"TEXT\",\"notNull\":false},\"analytics\":{\"type\":\"JSON\",\"notNull\":false},\"raw\":{\"type\":\"JSON\",\"notNull\":false},\"captured_at\":{\"type\":\"TIMESTAMP\",\"notNull\":false}},\"indexes\":[{\"name\":\"social_post_analytics_snapshots_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"social_post_analytics_snapshots_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"social_post_analytics_snapshots_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"social_post_analytics_snapshots_social_post_id_idx\",\"columns\":[\"social_post_id\"]}],\"version\":\"bd17983d\"}},\"@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\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"SocialPost\",\"exportName\":\"SocialPostCollection\",\"collectionExportName\":\"SocialPostCollectionCollection\",\"schema\":{\"tableName\":\"social_posts\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"social_posts\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"_meta_type\\\" TEXT NOT NULL,\\n \\\"_meta_data\\\" JSON,\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"social_account_id\\\" UUID,\\n \\\"video_content_id\\\" UUID,\\n \\\"content_id\\\" UUID,\\n \\\"post_type\\\" TEXT DEFAULT 'text',\\n \\\"media_url\\\" TEXT,\\n \\\"title\\\" TEXT,\\n \\\"description\\\" TEXT DEFAULT '',\\n \\\"hashtags\\\" JSON DEFAULT '[]',\\n \\\"link_url\\\" TEXT,\\n \\\"platform_post_id\\\" TEXT,\\n \\\"platform_url\\\" TEXT,\\n \\\"scheduled_at\\\" TIMESTAMP,\\n \\\"published_at\\\" TIMESTAMP,\\n \\\"status\\\" TEXT DEFAULT 'draft',\\n \\\"error_message\\\" TEXT,\\n \\\"analytics\\\" JSON,\\n \\\"analytics_last_synced_at\\\" TIMESTAMP\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"social_account_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"social_accounts\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"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_video_content_id_idx\",\"columns\":[\"video_content_id\"]},{\"name\":\"social_posts_content_id_idx\",\"columns\":[\"content_id\"]}],\"version\":\"49573fcf\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-content\",\"@happyvertical/smrt-core\",\"@happyvertical/smrt-secrets\",\"@happyvertical/smrt-tenancy\",\"@happyvertical/smrt-video\"]}"));
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/oauth-state.ts
|
|
10
10
|
var __defProp$3 = Object.defineProperty;
|
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-social",
|
|
5
|
-
"packageVersion": "0.49.
|
|
5
|
+
"packageVersion": "0.49.4",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-social:OAuthState": {
|
|
8
8
|
"name": "oauthstate",
|
|
@@ -220,7 +220,8 @@
|
|
|
220
220
|
"context",
|
|
221
221
|
"_meta_type"
|
|
222
222
|
],
|
|
223
|
-
"unique": true
|
|
223
|
+
"unique": true,
|
|
224
|
+
"nullsNotDistinct": true
|
|
224
225
|
},
|
|
225
226
|
{
|
|
226
227
|
"name": "oauth_states_meta_type_idx",
|
|
@@ -579,7 +580,8 @@
|
|
|
579
580
|
"context",
|
|
580
581
|
"_meta_type"
|
|
581
582
|
],
|
|
582
|
-
"unique": true
|
|
583
|
+
"unique": true,
|
|
584
|
+
"nullsNotDistinct": true
|
|
583
585
|
},
|
|
584
586
|
{
|
|
585
587
|
"name": "social_accounts_meta_type_idx",
|
|
@@ -777,7 +779,8 @@
|
|
|
777
779
|
"context",
|
|
778
780
|
"_meta_type"
|
|
779
781
|
],
|
|
780
|
-
"unique": true
|
|
782
|
+
"unique": true,
|
|
783
|
+
"nullsNotDistinct": true
|
|
781
784
|
},
|
|
782
785
|
{
|
|
783
786
|
"name": "social_post_analytics_snapshots_meta_type_idx",
|
|
@@ -1077,7 +1080,8 @@
|
|
|
1077
1080
|
"context",
|
|
1078
1081
|
"_meta_type"
|
|
1079
1082
|
],
|
|
1080
|
-
"unique": true
|
|
1083
|
+
"unique": true,
|
|
1084
|
+
"nullsNotDistinct": true
|
|
1081
1085
|
},
|
|
1082
1086
|
{
|
|
1083
1087
|
"name": "social_posts_meta_type_idx",
|
|
@@ -1174,8 +1178,8 @@
|
|
|
1174
1178
|
"exportName": "OAuthStateCollection",
|
|
1175
1179
|
"collectionExportName": "OAuthStateCollectionCollection",
|
|
1176
1180
|
"schema": {
|
|
1177
|
-
"tableName": "
|
|
1178
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
1181
|
+
"tableName": "oauth_states",
|
|
1182
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"oauth_states\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"platform\" TEXT DEFAULT 'youtube',\n \"state\" TEXT DEFAULT '',\n \"code_verifier\" TEXT,\n \"redirect_uri\" TEXT DEFAULT '',\n \"scopes\" JSON DEFAULT '[]',\n \"expires_at\" TIMESTAMP\n);",
|
|
1179
1183
|
"columns": {
|
|
1180
1184
|
"id": {
|
|
1181
1185
|
"type": "UUID",
|
|
@@ -1192,6 +1196,14 @@
|
|
|
1192
1196
|
"notNull": true,
|
|
1193
1197
|
"default": ""
|
|
1194
1198
|
},
|
|
1199
|
+
"_meta_type": {
|
|
1200
|
+
"type": "TEXT",
|
|
1201
|
+
"notNull": true
|
|
1202
|
+
},
|
|
1203
|
+
"_meta_data": {
|
|
1204
|
+
"type": "JSON",
|
|
1205
|
+
"notNull": false
|
|
1206
|
+
},
|
|
1195
1207
|
"created_at": {
|
|
1196
1208
|
"type": "TIMESTAMP",
|
|
1197
1209
|
"notNull": true,
|
|
@@ -1201,25 +1213,68 @@
|
|
|
1201
1213
|
"type": "TIMESTAMP",
|
|
1202
1214
|
"notNull": true,
|
|
1203
1215
|
"default": "current_timestamp"
|
|
1216
|
+
},
|
|
1217
|
+
"tenant_id": {
|
|
1218
|
+
"type": "UUID",
|
|
1219
|
+
"referenceKind": "tenantId",
|
|
1220
|
+
"notNull": false
|
|
1221
|
+
},
|
|
1222
|
+
"platform": {
|
|
1223
|
+
"type": "TEXT",
|
|
1224
|
+
"notNull": false,
|
|
1225
|
+
"default": "youtube"
|
|
1226
|
+
},
|
|
1227
|
+
"state": {
|
|
1228
|
+
"type": "TEXT",
|
|
1229
|
+
"notNull": false,
|
|
1230
|
+
"default": ""
|
|
1231
|
+
},
|
|
1232
|
+
"code_verifier": {
|
|
1233
|
+
"type": "TEXT",
|
|
1234
|
+
"notNull": false
|
|
1235
|
+
},
|
|
1236
|
+
"redirect_uri": {
|
|
1237
|
+
"type": "TEXT",
|
|
1238
|
+
"notNull": false,
|
|
1239
|
+
"default": ""
|
|
1240
|
+
},
|
|
1241
|
+
"scopes": {
|
|
1242
|
+
"type": "JSON",
|
|
1243
|
+
"notNull": false,
|
|
1244
|
+
"default": []
|
|
1245
|
+
},
|
|
1246
|
+
"expires_at": {
|
|
1247
|
+
"type": "TIMESTAMP",
|
|
1248
|
+
"notNull": false
|
|
1204
1249
|
}
|
|
1205
1250
|
},
|
|
1206
1251
|
"indexes": [
|
|
1207
1252
|
{
|
|
1208
|
-
"name": "
|
|
1253
|
+
"name": "oauth_states_slug_context_meta_type_idx",
|
|
1209
1254
|
"columns": [
|
|
1255
|
+
"tenant_id",
|
|
1210
1256
|
"slug",
|
|
1211
|
-
"context"
|
|
1257
|
+
"context",
|
|
1258
|
+
"_meta_type"
|
|
1212
1259
|
],
|
|
1213
|
-
"unique": true
|
|
1260
|
+
"unique": true,
|
|
1261
|
+
"nullsNotDistinct": true
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
"name": "oauth_states_meta_type_idx",
|
|
1265
|
+
"columns": [
|
|
1266
|
+
"_meta_type"
|
|
1267
|
+
]
|
|
1214
1268
|
},
|
|
1215
1269
|
{
|
|
1216
|
-
"name": "
|
|
1270
|
+
"name": "oauth_states_tenant_id_created_at_idx",
|
|
1217
1271
|
"columns": [
|
|
1272
|
+
"tenant_id",
|
|
1218
1273
|
"created_at"
|
|
1219
1274
|
]
|
|
1220
1275
|
}
|
|
1221
1276
|
],
|
|
1222
|
-
"version": "
|
|
1277
|
+
"version": "709e111f"
|
|
1223
1278
|
}
|
|
1224
1279
|
},
|
|
1225
1280
|
"@happyvertical/smrt-social:SocialAccountCollection": {
|
|
@@ -1274,8 +1329,8 @@
|
|
|
1274
1329
|
"exportName": "SocialAccountCollection",
|
|
1275
1330
|
"collectionExportName": "SocialAccountCollectionCollection",
|
|
1276
1331
|
"schema": {
|
|
1277
|
-
"tableName": "
|
|
1278
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
1332
|
+
"tableName": "social_accounts",
|
|
1333
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"social_accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"platform\" TEXT DEFAULT 'youtube',\n \"platform_user_id\" TEXT,\n \"platform_username\" TEXT,\n \"platform_url\" TEXT,\n \"access_token\" TEXT,\n \"refresh_token\" TEXT,\n \"credential_secret_id\" TEXT,\n \"access_token_secret_name\" TEXT,\n \"refresh_token_secret_name\" TEXT,\n \"token_expires_at\" TIMESTAMP,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"default_hashtags\" JSON DEFAULT '[]',\n \"scopes\" JSON DEFAULT '[]',\n \"missing_permissions\" JSON DEFAULT '[]',\n \"link_behavior\" TEXT DEFAULT 'description',\n \"publish_mode\" TEXT DEFAULT 'dry_run',\n \"public_publishing_allowed\" BOOLEAN DEFAULT FALSE,\n \"status\" TEXT DEFAULT 'connected',\n \"error_message\" TEXT\n);",
|
|
1279
1334
|
"columns": {
|
|
1280
1335
|
"id": {
|
|
1281
1336
|
"type": "UUID",
|
|
@@ -1292,6 +1347,14 @@
|
|
|
1292
1347
|
"notNull": true,
|
|
1293
1348
|
"default": ""
|
|
1294
1349
|
},
|
|
1350
|
+
"_meta_type": {
|
|
1351
|
+
"type": "TEXT",
|
|
1352
|
+
"notNull": true
|
|
1353
|
+
},
|
|
1354
|
+
"_meta_data": {
|
|
1355
|
+
"type": "JSON",
|
|
1356
|
+
"notNull": false
|
|
1357
|
+
},
|
|
1295
1358
|
"created_at": {
|
|
1296
1359
|
"type": "TIMESTAMP",
|
|
1297
1360
|
"notNull": true,
|
|
@@ -1301,25 +1364,130 @@
|
|
|
1301
1364
|
"type": "TIMESTAMP",
|
|
1302
1365
|
"notNull": true,
|
|
1303
1366
|
"default": "current_timestamp"
|
|
1367
|
+
},
|
|
1368
|
+
"tenant_id": {
|
|
1369
|
+
"type": "UUID",
|
|
1370
|
+
"referenceKind": "tenantId",
|
|
1371
|
+
"notNull": false
|
|
1372
|
+
},
|
|
1373
|
+
"name": {
|
|
1374
|
+
"type": "TEXT",
|
|
1375
|
+
"notNull": false,
|
|
1376
|
+
"default": ""
|
|
1377
|
+
},
|
|
1378
|
+
"platform": {
|
|
1379
|
+
"type": "TEXT",
|
|
1380
|
+
"notNull": false,
|
|
1381
|
+
"default": "youtube"
|
|
1382
|
+
},
|
|
1383
|
+
"platform_user_id": {
|
|
1384
|
+
"type": "TEXT",
|
|
1385
|
+
"notNull": false
|
|
1386
|
+
},
|
|
1387
|
+
"platform_username": {
|
|
1388
|
+
"type": "TEXT",
|
|
1389
|
+
"notNull": false
|
|
1390
|
+
},
|
|
1391
|
+
"platform_url": {
|
|
1392
|
+
"type": "TEXT",
|
|
1393
|
+
"notNull": false
|
|
1394
|
+
},
|
|
1395
|
+
"access_token": {
|
|
1396
|
+
"type": "TEXT",
|
|
1397
|
+
"notNull": false
|
|
1398
|
+
},
|
|
1399
|
+
"refresh_token": {
|
|
1400
|
+
"type": "TEXT",
|
|
1401
|
+
"notNull": false
|
|
1402
|
+
},
|
|
1403
|
+
"credential_secret_id": {
|
|
1404
|
+
"type": "TEXT",
|
|
1405
|
+
"notNull": false
|
|
1406
|
+
},
|
|
1407
|
+
"access_token_secret_name": {
|
|
1408
|
+
"type": "TEXT",
|
|
1409
|
+
"notNull": false
|
|
1410
|
+
},
|
|
1411
|
+
"refresh_token_secret_name": {
|
|
1412
|
+
"type": "TEXT",
|
|
1413
|
+
"notNull": false
|
|
1414
|
+
},
|
|
1415
|
+
"token_expires_at": {
|
|
1416
|
+
"type": "TIMESTAMP",
|
|
1417
|
+
"notNull": false
|
|
1418
|
+
},
|
|
1419
|
+
"is_active": {
|
|
1420
|
+
"type": "BOOLEAN",
|
|
1421
|
+
"notNull": false,
|
|
1422
|
+
"default": true
|
|
1423
|
+
},
|
|
1424
|
+
"default_hashtags": {
|
|
1425
|
+
"type": "JSON",
|
|
1426
|
+
"notNull": false,
|
|
1427
|
+
"default": []
|
|
1428
|
+
},
|
|
1429
|
+
"scopes": {
|
|
1430
|
+
"type": "JSON",
|
|
1431
|
+
"notNull": false,
|
|
1432
|
+
"default": []
|
|
1433
|
+
},
|
|
1434
|
+
"missing_permissions": {
|
|
1435
|
+
"type": "JSON",
|
|
1436
|
+
"notNull": false,
|
|
1437
|
+
"default": []
|
|
1438
|
+
},
|
|
1439
|
+
"link_behavior": {
|
|
1440
|
+
"type": "TEXT",
|
|
1441
|
+
"notNull": false,
|
|
1442
|
+
"default": "description"
|
|
1443
|
+
},
|
|
1444
|
+
"publish_mode": {
|
|
1445
|
+
"type": "TEXT",
|
|
1446
|
+
"notNull": false,
|
|
1447
|
+
"default": "dry_run"
|
|
1448
|
+
},
|
|
1449
|
+
"public_publishing_allowed": {
|
|
1450
|
+
"type": "BOOLEAN",
|
|
1451
|
+
"notNull": false,
|
|
1452
|
+
"default": false
|
|
1453
|
+
},
|
|
1454
|
+
"status": {
|
|
1455
|
+
"type": "TEXT",
|
|
1456
|
+
"notNull": false,
|
|
1457
|
+
"default": "connected"
|
|
1458
|
+
},
|
|
1459
|
+
"error_message": {
|
|
1460
|
+
"type": "TEXT",
|
|
1461
|
+
"notNull": false
|
|
1304
1462
|
}
|
|
1305
1463
|
},
|
|
1306
1464
|
"indexes": [
|
|
1307
1465
|
{
|
|
1308
|
-
"name": "
|
|
1466
|
+
"name": "social_accounts_slug_context_meta_type_idx",
|
|
1309
1467
|
"columns": [
|
|
1468
|
+
"tenant_id",
|
|
1310
1469
|
"slug",
|
|
1311
|
-
"context"
|
|
1470
|
+
"context",
|
|
1471
|
+
"_meta_type"
|
|
1312
1472
|
],
|
|
1313
|
-
"unique": true
|
|
1473
|
+
"unique": true,
|
|
1474
|
+
"nullsNotDistinct": true
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
"name": "social_accounts_meta_type_idx",
|
|
1478
|
+
"columns": [
|
|
1479
|
+
"_meta_type"
|
|
1480
|
+
]
|
|
1314
1481
|
},
|
|
1315
1482
|
{
|
|
1316
|
-
"name": "
|
|
1483
|
+
"name": "social_accounts_tenant_id_created_at_idx",
|
|
1317
1484
|
"columns": [
|
|
1485
|
+
"tenant_id",
|
|
1318
1486
|
"created_at"
|
|
1319
1487
|
]
|
|
1320
1488
|
}
|
|
1321
1489
|
],
|
|
1322
|
-
"version": "
|
|
1490
|
+
"version": "0c175da6"
|
|
1323
1491
|
}
|
|
1324
1492
|
},
|
|
1325
1493
|
"@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection": {
|
|
@@ -1388,8 +1556,8 @@
|
|
|
1388
1556
|
"exportName": "SocialPostAnalyticsSnapshotCollection",
|
|
1389
1557
|
"collectionExportName": "SocialPostAnalyticsSnapshotCollectionCollection",
|
|
1390
1558
|
"schema": {
|
|
1391
|
-
"tableName": "
|
|
1392
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
1559
|
+
"tableName": "social_post_analytics_snapshots",
|
|
1560
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"social_post_analytics_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"social_post_id\" UUID,\n \"platform\" TEXT,\n \"analytics\" JSON,\n \"raw\" JSON,\n \"captured_at\" TIMESTAMP\n);",
|
|
1393
1561
|
"columns": {
|
|
1394
1562
|
"id": {
|
|
1395
1563
|
"type": "UUID",
|
|
@@ -1406,6 +1574,14 @@
|
|
|
1406
1574
|
"notNull": true,
|
|
1407
1575
|
"default": ""
|
|
1408
1576
|
},
|
|
1577
|
+
"_meta_type": {
|
|
1578
|
+
"type": "TEXT",
|
|
1579
|
+
"notNull": true
|
|
1580
|
+
},
|
|
1581
|
+
"_meta_data": {
|
|
1582
|
+
"type": "JSON",
|
|
1583
|
+
"notNull": false
|
|
1584
|
+
},
|
|
1409
1585
|
"created_at": {
|
|
1410
1586
|
"type": "TIMESTAMP",
|
|
1411
1587
|
"notNull": true,
|
|
@@ -1415,25 +1591,73 @@
|
|
|
1415
1591
|
"type": "TIMESTAMP",
|
|
1416
1592
|
"notNull": true,
|
|
1417
1593
|
"default": "current_timestamp"
|
|
1594
|
+
},
|
|
1595
|
+
"tenant_id": {
|
|
1596
|
+
"type": "UUID",
|
|
1597
|
+
"referenceKind": "tenantId",
|
|
1598
|
+
"notNull": false
|
|
1599
|
+
},
|
|
1600
|
+
"social_post_id": {
|
|
1601
|
+
"type": "UUID",
|
|
1602
|
+
"referenceKind": "foreignKey",
|
|
1603
|
+
"notNull": false,
|
|
1604
|
+
"foreignKey": {
|
|
1605
|
+
"table": "social_posts",
|
|
1606
|
+
"column": "id",
|
|
1607
|
+
"onDelete": "NO ACTION",
|
|
1608
|
+
"onUpdate": "CASCADE"
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
"platform": {
|
|
1612
|
+
"type": "TEXT",
|
|
1613
|
+
"notNull": false
|
|
1614
|
+
},
|
|
1615
|
+
"analytics": {
|
|
1616
|
+
"type": "JSON",
|
|
1617
|
+
"notNull": false
|
|
1618
|
+
},
|
|
1619
|
+
"raw": {
|
|
1620
|
+
"type": "JSON",
|
|
1621
|
+
"notNull": false
|
|
1622
|
+
},
|
|
1623
|
+
"captured_at": {
|
|
1624
|
+
"type": "TIMESTAMP",
|
|
1625
|
+
"notNull": false
|
|
1418
1626
|
}
|
|
1419
1627
|
},
|
|
1420
1628
|
"indexes": [
|
|
1421
1629
|
{
|
|
1422
|
-
"name": "
|
|
1630
|
+
"name": "social_post_analytics_snapshots_slug_context_meta_type_idx",
|
|
1423
1631
|
"columns": [
|
|
1632
|
+
"tenant_id",
|
|
1424
1633
|
"slug",
|
|
1425
|
-
"context"
|
|
1634
|
+
"context",
|
|
1635
|
+
"_meta_type"
|
|
1426
1636
|
],
|
|
1427
|
-
"unique": true
|
|
1637
|
+
"unique": true,
|
|
1638
|
+
"nullsNotDistinct": true
|
|
1428
1639
|
},
|
|
1429
1640
|
{
|
|
1430
|
-
"name": "
|
|
1641
|
+
"name": "social_post_analytics_snapshots_meta_type_idx",
|
|
1642
|
+
"columns": [
|
|
1643
|
+
"_meta_type"
|
|
1644
|
+
]
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
"name": "social_post_analytics_snapshots_tenant_id_created_at_idx",
|
|
1431
1648
|
"columns": [
|
|
1649
|
+
"tenant_id",
|
|
1432
1650
|
"created_at"
|
|
1433
1651
|
]
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
"name": "social_post_analytics_snapshots_social_post_id_idx",
|
|
1655
|
+
"columns": [
|
|
1656
|
+
"social_post_id"
|
|
1657
|
+
]
|
|
1434
1658
|
}
|
|
1435
1659
|
],
|
|
1436
|
-
"version": "
|
|
1660
|
+
"version": "bd17983d"
|
|
1437
1661
|
}
|
|
1438
1662
|
},
|
|
1439
1663
|
"@happyvertical/smrt-social:SocialPostCollection": {
|
|
@@ -1578,8 +1802,8 @@
|
|
|
1578
1802
|
"exportName": "SocialPostCollection",
|
|
1579
1803
|
"collectionExportName": "SocialPostCollectionCollection",
|
|
1580
1804
|
"schema": {
|
|
1581
|
-
"tableName": "
|
|
1582
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
1805
|
+
"tableName": "social_posts",
|
|
1806
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"social_posts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"social_account_id\" UUID,\n \"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);",
|
|
1583
1807
|
"columns": {
|
|
1584
1808
|
"id": {
|
|
1585
1809
|
"type": "UUID",
|
|
@@ -1596,6 +1820,14 @@
|
|
|
1596
1820
|
"notNull": true,
|
|
1597
1821
|
"default": ""
|
|
1598
1822
|
},
|
|
1823
|
+
"_meta_type": {
|
|
1824
|
+
"type": "TEXT",
|
|
1825
|
+
"notNull": true
|
|
1826
|
+
},
|
|
1827
|
+
"_meta_data": {
|
|
1828
|
+
"type": "JSON",
|
|
1829
|
+
"notNull": false
|
|
1830
|
+
},
|
|
1599
1831
|
"created_at": {
|
|
1600
1832
|
"type": "TIMESTAMP",
|
|
1601
1833
|
"notNull": true,
|
|
@@ -1605,25 +1837,139 @@
|
|
|
1605
1837
|
"type": "TIMESTAMP",
|
|
1606
1838
|
"notNull": true,
|
|
1607
1839
|
"default": "current_timestamp"
|
|
1840
|
+
},
|
|
1841
|
+
"tenant_id": {
|
|
1842
|
+
"type": "UUID",
|
|
1843
|
+
"referenceKind": "tenantId",
|
|
1844
|
+
"notNull": false
|
|
1845
|
+
},
|
|
1846
|
+
"social_account_id": {
|
|
1847
|
+
"type": "UUID",
|
|
1848
|
+
"referenceKind": "foreignKey",
|
|
1849
|
+
"notNull": false,
|
|
1850
|
+
"foreignKey": {
|
|
1851
|
+
"table": "social_accounts",
|
|
1852
|
+
"column": "id",
|
|
1853
|
+
"onDelete": "NO ACTION",
|
|
1854
|
+
"onUpdate": "CASCADE"
|
|
1855
|
+
}
|
|
1856
|
+
},
|
|
1857
|
+
"video_content_id": {
|
|
1858
|
+
"type": "UUID",
|
|
1859
|
+
"referenceKind": "crossPackageRef",
|
|
1860
|
+
"notNull": false
|
|
1861
|
+
},
|
|
1862
|
+
"content_id": {
|
|
1863
|
+
"type": "UUID",
|
|
1864
|
+
"referenceKind": "crossPackageRef",
|
|
1865
|
+
"notNull": false
|
|
1866
|
+
},
|
|
1867
|
+
"post_type": {
|
|
1868
|
+
"type": "TEXT",
|
|
1869
|
+
"notNull": false,
|
|
1870
|
+
"default": "text"
|
|
1871
|
+
},
|
|
1872
|
+
"media_url": {
|
|
1873
|
+
"type": "TEXT",
|
|
1874
|
+
"notNull": false
|
|
1875
|
+
},
|
|
1876
|
+
"title": {
|
|
1877
|
+
"type": "TEXT",
|
|
1878
|
+
"notNull": false
|
|
1879
|
+
},
|
|
1880
|
+
"description": {
|
|
1881
|
+
"type": "TEXT",
|
|
1882
|
+
"notNull": false,
|
|
1883
|
+
"default": ""
|
|
1884
|
+
},
|
|
1885
|
+
"hashtags": {
|
|
1886
|
+
"type": "JSON",
|
|
1887
|
+
"notNull": false,
|
|
1888
|
+
"default": []
|
|
1889
|
+
},
|
|
1890
|
+
"link_url": {
|
|
1891
|
+
"type": "TEXT",
|
|
1892
|
+
"notNull": false
|
|
1893
|
+
},
|
|
1894
|
+
"platform_post_id": {
|
|
1895
|
+
"type": "TEXT",
|
|
1896
|
+
"notNull": false
|
|
1897
|
+
},
|
|
1898
|
+
"platform_url": {
|
|
1899
|
+
"type": "TEXT",
|
|
1900
|
+
"notNull": false
|
|
1901
|
+
},
|
|
1902
|
+
"scheduled_at": {
|
|
1903
|
+
"type": "TIMESTAMP",
|
|
1904
|
+
"notNull": false
|
|
1905
|
+
},
|
|
1906
|
+
"published_at": {
|
|
1907
|
+
"type": "TIMESTAMP",
|
|
1908
|
+
"notNull": false
|
|
1909
|
+
},
|
|
1910
|
+
"status": {
|
|
1911
|
+
"type": "TEXT",
|
|
1912
|
+
"notNull": false,
|
|
1913
|
+
"default": "draft"
|
|
1914
|
+
},
|
|
1915
|
+
"error_message": {
|
|
1916
|
+
"type": "TEXT",
|
|
1917
|
+
"notNull": false
|
|
1918
|
+
},
|
|
1919
|
+
"analytics": {
|
|
1920
|
+
"type": "JSON",
|
|
1921
|
+
"notNull": false
|
|
1922
|
+
},
|
|
1923
|
+
"analytics_last_synced_at": {
|
|
1924
|
+
"type": "TIMESTAMP",
|
|
1925
|
+
"notNull": false
|
|
1608
1926
|
}
|
|
1609
1927
|
},
|
|
1610
1928
|
"indexes": [
|
|
1611
1929
|
{
|
|
1612
|
-
"name": "
|
|
1930
|
+
"name": "social_posts_slug_context_meta_type_idx",
|
|
1613
1931
|
"columns": [
|
|
1932
|
+
"tenant_id",
|
|
1614
1933
|
"slug",
|
|
1615
|
-
"context"
|
|
1934
|
+
"context",
|
|
1935
|
+
"_meta_type"
|
|
1616
1936
|
],
|
|
1617
|
-
"unique": true
|
|
1937
|
+
"unique": true,
|
|
1938
|
+
"nullsNotDistinct": true
|
|
1618
1939
|
},
|
|
1619
1940
|
{
|
|
1620
|
-
"name": "
|
|
1941
|
+
"name": "social_posts_meta_type_idx",
|
|
1621
1942
|
"columns": [
|
|
1943
|
+
"_meta_type"
|
|
1944
|
+
]
|
|
1945
|
+
},
|
|
1946
|
+
{
|
|
1947
|
+
"name": "social_posts_tenant_id_created_at_idx",
|
|
1948
|
+
"columns": [
|
|
1949
|
+
"tenant_id",
|
|
1622
1950
|
"created_at"
|
|
1623
1951
|
]
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
"name": "social_posts_social_account_id_idx",
|
|
1955
|
+
"columns": [
|
|
1956
|
+
"social_account_id"
|
|
1957
|
+
]
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
"name": "social_posts_video_content_id_idx",
|
|
1961
|
+
"columns": [
|
|
1962
|
+
"video_content_id"
|
|
1963
|
+
]
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
"name": "social_posts_content_id_idx",
|
|
1967
|
+
"columns": [
|
|
1968
|
+
"content_id"
|
|
1969
|
+
]
|
|
1624
1970
|
}
|
|
1625
1971
|
],
|
|
1626
|
-
"version": "
|
|
1972
|
+
"version": "49573fcf"
|
|
1627
1973
|
}
|
|
1628
1974
|
}
|
|
1629
1975
|
},
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-social",
|
|
6
|
-
"packageVersion": "0.49.
|
|
6
|
+
"packageVersion": "0.49.4",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "b39d25e41f21331774fef3df0e61b34f3ac796565f335bb07f9caea0f1b76af8",
|
|
11
|
+
"packageJson": "6049b3279170d0343a5585dbca6ea7e609c00b20260a59158ce910a57894f8c8",
|
|
12
12
|
"agents": "f31b84b31431fcb43ab480fafd9684d91f0e55a935e95aa31fd19ea1f31b0ad4"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
@@ -1046,7 +1046,7 @@
|
|
|
1046
1046
|
"name": "OAuthStateCollection",
|
|
1047
1047
|
"qualifiedName": "@happyvertical/smrt-social:OAuthStateCollection",
|
|
1048
1048
|
"collection": "oauthstates",
|
|
1049
|
-
"tableName": "
|
|
1049
|
+
"tableName": "oauth_states",
|
|
1050
1050
|
"packageName": "@happyvertical/smrt-social",
|
|
1051
1051
|
"extends": "SmrtCollection",
|
|
1052
1052
|
"fields": [],
|
|
@@ -1136,7 +1136,7 @@
|
|
|
1136
1136
|
"name": "SocialAccountCollection",
|
|
1137
1137
|
"qualifiedName": "@happyvertical/smrt-social:SocialAccountCollection",
|
|
1138
1138
|
"collection": "socialaccounts",
|
|
1139
|
-
"tableName": "
|
|
1139
|
+
"tableName": "social_accounts",
|
|
1140
1140
|
"packageName": "@happyvertical/smrt-social",
|
|
1141
1141
|
"extends": "SmrtCollection",
|
|
1142
1142
|
"fields": [],
|
|
@@ -1241,7 +1241,7 @@
|
|
|
1241
1241
|
"name": "SocialPostAnalyticsSnapshotCollection",
|
|
1242
1242
|
"qualifiedName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection",
|
|
1243
1243
|
"collection": "socialpostanalyticssnapshots",
|
|
1244
|
-
"tableName": "
|
|
1244
|
+
"tableName": "social_post_analytics_snapshots",
|
|
1245
1245
|
"packageName": "@happyvertical/smrt-social",
|
|
1246
1246
|
"extends": "SmrtCollection",
|
|
1247
1247
|
"fields": [],
|
|
@@ -1350,7 +1350,7 @@
|
|
|
1350
1350
|
"name": "SocialPostCollection",
|
|
1351
1351
|
"qualifiedName": "@happyvertical/smrt-social:SocialPostCollection",
|
|
1352
1352
|
"collection": "socialposts",
|
|
1353
|
-
"tableName": "
|
|
1353
|
+
"tableName": "social_posts",
|
|
1354
1354
|
"packageName": "@happyvertical/smrt-social",
|
|
1355
1355
|
"extends": "SmrtCollection",
|
|
1356
1356
|
"fields": [],
|
|
@@ -2189,7 +2189,7 @@
|
|
|
2189
2189
|
"junctionCollections": 0,
|
|
2190
2190
|
"hierarchicalObjects": 0,
|
|
2191
2191
|
"polymorphicAssociations": 0,
|
|
2192
|
-
"uuidColumns":
|
|
2192
|
+
"uuidColumns": 24
|
|
2193
2193
|
},
|
|
2194
2194
|
"agentDoc": "# @happyvertical/smrt-social\n\nSocial media account management with OAuth and post scheduling. Supports YouTube, Threads, X (Twitter), Bluesky.\n\n## Models\n\n- **SocialAccount** (STI): `platform`, `accessToken`/`refreshToken`, `tokenExpiresAt`, `status` (connected/expired/error), `linkBehavior` (description/reply/none). `isTokenExpired` checks with 5-min buffer. `isReady` gate checks active + connected + token present + not expired.\n- **SocialPost**: `scheduledAt`, `publishedAt`, `status` (draft/scheduled/publishing/published/failed), `analytics` JSON (views/likes/comments/shares/clicks).\n- **OAuthState** (STI): CSRF token + PKCE `codeVerifier` with 10-min TTL.\n\n## Gotchas\n\n- **Tokens not encrypted**: OAuth tokens stored as plaintext — TODO for smrt-secrets integration\n- **No auto-publishing**: `scheduledAt` is metadata only — app must implement job runner to trigger publishing\n- **Analytics manual**: `analytics` field must be updated by platform sync, not auto-populated\n- **Platform enum hardcoded**: youtube/threads/x/bluesky — extending requires code changes\n- **OAuthState TTL**: 10 minutes, app must clean up expired states\n- **Optional tenancy** on all models\n- **Relationship targets**: `SocialPost.socialAccountId` and\n `SocialPostAnalyticsSnapshot.socialPostId` are same-package `@foreignKey`\n columns; `SocialPost.videoContentId` is a `@crossPackageRef` to\n `@happyvertical/smrt-video:VideoContent` (no value import back into this\n package). They previously used `@foreignKey(() => X)`, whose target resolved\n to `''`, so none of them carried a relationship edge (#2379).\n"
|
|
2195
2195
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-social",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"smrtRawPrimitives": "strict",
|
|
6
6
|
"description": "Social media account management for multi-platform publishing in the SMRT ecosystem",
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
"AGENTS.md"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@happyvertical/smrt-config": "0.49.
|
|
43
|
-
"@happyvertical/smrt-content": "0.49.
|
|
44
|
-
"@happyvertical/smrt-core": "0.49.
|
|
45
|
-
"@happyvertical/smrt-secrets": "0.49.
|
|
46
|
-
"@happyvertical/smrt-tenancy": "0.49.
|
|
47
|
-
"@happyvertical/smrt-ui": "0.49.
|
|
48
|
-
"@happyvertical/smrt-video": "0.49.
|
|
42
|
+
"@happyvertical/smrt-config": "0.49.4",
|
|
43
|
+
"@happyvertical/smrt-content": "0.49.4",
|
|
44
|
+
"@happyvertical/smrt-core": "0.49.4",
|
|
45
|
+
"@happyvertical/smrt-secrets": "0.49.4",
|
|
46
|
+
"@happyvertical/smrt-tenancy": "0.49.4",
|
|
47
|
+
"@happyvertical/smrt-ui": "0.49.4",
|
|
48
|
+
"@happyvertical/smrt-video": "0.49.4",
|
|
49
49
|
"@happyvertical/utils": "^0.89.6"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@happyvertical/logger": "^0.89.6",
|
|
53
|
-
"@happyvertical/smrt-vitest": "0.49.
|
|
53
|
+
"@happyvertical/smrt-vitest": "0.49.4",
|
|
54
54
|
"@happyvertical/sql": "^0.89.6",
|
|
55
55
|
"@sveltejs/package": "^2.5.8",
|
|
56
56
|
"@types/node": "24.13.2",
|