@happyvertical/smrt-social 0.57.36 → 0.57.38

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/AGENTS.md CHANGED
@@ -8,6 +8,8 @@ Social media account management with OAuth and post scheduling. Supports YouTube
8
8
  - **SocialPost**: `scheduledAt`, `publishedAt`, `status` (draft/scheduled/publishing/published/failed), `analytics` JSON (views/likes/comments/shares/clicks). `createdByUserId` (nullable `@crossPackageRef` to `smrt-users:User`, uuid on PostgreSQL) records the poster; pass it to `createDraft()` so a failed publish can be reported to that person. Agent/schedule posts leave it null; `recordPublishSuccess`/`Failure` never change it. Adding the column is additive: consumers run `db:migrate`.
9
9
  - **OAuthState** (STI): CSRF token + PKCE `codeVerifier` with 10-min TTL. `createdByUserId` (nullable `@crossPackageRef` to `smrt-users:User`) binds the flow to its initiator and `returnTo` stores an opaque host path; a host with one fixed callback for every tenant must reject a different user and validate `returnTo` as same-origin. `OAuthStateCollection.consume(state)` is the single-use arbiter (revision-guarded delete; `false` when another caller already consumed it). Both columns are additive: consumers run `db:migrate`.
10
10
 
11
+ - **Recipe `social.posts`** (`src/recipes.ts`, help in `src/posts.recipe.md`): Posts and Connected accounts over `SocialPost` and `SocialAccount`, with `SocialPostAnalyticsSnapshot` as a child record of the post (no menu entry); `OAuthState` stays out. Token and secret-name fields on `SocialAccount` are hidden in its options and never named in the help, and the help never promises auto-publishing or live metrics (see Gotchas).
12
+
11
13
  ## Gotchas
12
14
 
13
15
  - **Tokens not encrypted**: OAuth tokens stored as plaintext — TODO for smrt-secrets integration
package/dist/index.d.ts CHANGED
@@ -34,6 +34,7 @@
34
34
  import './__smrt-register__.js';
35
35
  export * from './collections/index.js';
36
36
  export { OAuthState, type OAuthStateOptions, } from './oauth-state.js';
37
+ export { SocialPostsRecipe } from './recipes.js';
37
38
  export { type AccountStatus, type LinkBehavior, type PublishMode, SocialAccount, type SocialAccountOptions, type SocialPlatformType, } from './social-account.js';
38
39
  export { type PostAnalytics, type PostStatus, SocialPost, type SocialPostOptions, type SocialPostType, } from './social-post.js';
39
40
  export { type RawAnalyticsPayload, SocialPostAnalyticsSnapshot, type SocialPostAnalyticsSnapshotOptions, } from './social-post-analytics-snapshot.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAKH,OAAO,wBAAwB,CAAC;AAEhC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,mBAAmB,EACxB,2BAA2B,EAC3B,KAAK,kCAAkC,GACxC,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAKH,OAAO,wBAAwB,CAAC;AAEhC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,mBAAmB,EACxB,2BAA2B,EAC3B,KAAK,kCAAkC,GACxC,MAAM,qCAAqC,CAAC"}