@happyvertical/smrt-social 0.57.46 → 0.57.47

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.
@@ -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.57.46",
6
+ "packageVersion": "0.57.47",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "06e36d2423e4818c4ce7efcf477c75e471eae3f27b7285b0f5b29ba39bff9ce3",
11
- "packageJson": "12bc4aaa7373b2f60aa0185d66785cff4c843988cac4816a6ceafc7fdc81936c",
10
+ "manifest": "a3a8d9d118660b24228ef5b709f209a64520f69971b534001d00c3198251f59d",
11
+ "packageJson": "5802cb5bbdc40b2221761221b574ad7a82e4da6c4bb76739c3d4f550a77af61d",
12
12
  "agents": "dc8a1a9b42e272ff4c9c313dc9d3b6ed0db58d3dece18a2ac23d7f0610645f58"
13
13
  },
14
14
  "exports": [
@@ -70,589 +70,464 @@
70
70
  ],
71
71
  "objects": [
72
72
  {
73
- "name": "OAuthState",
74
- "qualifiedName": "@happyvertical/smrt-social:OAuthState",
73
+ "name": "OAuthStateCollection",
74
+ "qualifiedName": "@happyvertical/smrt-social:OAuthStateCollection",
75
75
  "collection": "oauthstates",
76
- "description": "Temporary OAuth state for social account connection",
77
76
  "tableName": "oauth_states",
78
77
  "packageName": "@happyvertical/smrt-social",
79
- "extends": "SmrtObject",
80
- "fields": [
81
- {
82
- "name": "created_at",
83
- "type": "datetime",
84
- "required": false,
85
- "columnType": "TIMESTAMP"
86
- },
87
- {
88
- "name": "updated_at",
89
- "type": "datetime",
90
- "required": false,
91
- "columnType": "TIMESTAMP"
92
- },
93
- {
94
- "name": "tenantId",
95
- "type": "text",
96
- "required": false,
97
- "columnType": "UUID"
98
- },
99
- {
100
- "name": "platform",
101
- "type": "text",
102
- "required": false,
103
- "columnType": "TEXT",
104
- "default": "youtube"
105
- },
106
- {
107
- "name": "state",
108
- "type": "text",
109
- "required": false,
110
- "columnType": "TEXT",
111
- "default": ""
112
- },
113
- {
114
- "name": "codeVerifier",
115
- "type": "text",
116
- "required": false,
117
- "columnType": "TEXT"
118
- },
119
- {
120
- "name": "redirectUri",
121
- "type": "text",
122
- "required": false,
123
- "columnType": "TEXT",
124
- "default": ""
125
- },
126
- {
127
- "name": "scopes",
128
- "type": "json",
129
- "required": false,
130
- "columnType": "JSON",
131
- "default": []
132
- },
133
- {
134
- "name": "expiresAt",
135
- "type": "datetime",
136
- "required": false,
137
- "columnType": "TIMESTAMP"
138
- },
139
- {
140
- "name": "createdByUserId",
141
- "type": "crossPackageRef",
142
- "required": false,
143
- "related": "@happyvertical/smrt-users:User",
144
- "columnType": "UUID"
145
- },
146
- {
147
- "name": "returnTo",
148
- "type": "text",
149
- "required": false,
150
- "columnType": "TEXT"
151
- }
152
- ],
153
- "relationships": [
154
- {
155
- "name": "createdByUserId",
156
- "type": "crossPackageRef",
157
- "required": false,
158
- "related": "@happyvertical/smrt-users:User",
159
- "columnType": "UUID"
160
- }
161
- ],
78
+ "extends": "SmrtCollection",
79
+ "fields": [],
80
+ "relationships": [],
162
81
  "methods": [
163
- "generateCodeChallenge",
164
- "generateCodeVerifier",
165
- "generateState",
166
- "verifyState"
82
+ "consume",
83
+ "deleteExpired",
84
+ "findByState",
85
+ "findExpired"
167
86
  ],
168
87
  "methodSignatures": [
169
88
  {
170
- "name": "generateCodeChallenge",
89
+ "name": "consume",
171
90
  "async": true,
172
- "static": true,
173
91
  "params": [
174
- "verifier: string"
92
+ "state: OAuthState"
175
93
  ],
176
- "returns": "Promise<string>"
94
+ "returns": "Promise<boolean>"
177
95
  },
178
96
  {
179
- "name": "generateCodeVerifier",
180
- "static": true,
181
- "returns": "string"
97
+ "name": "deleteExpired",
98
+ "async": true,
99
+ "params": [
100
+ "now?: Date"
101
+ ],
102
+ "returns": "Promise<number>"
182
103
  },
183
104
  {
184
- "name": "generateState",
185
- "static": true,
186
- "returns": "string"
105
+ "name": "findByState",
106
+ "async": true,
107
+ "params": [
108
+ "state: string"
109
+ ],
110
+ "returns": "Promise<OAuthState | null>"
187
111
  },
188
112
  {
189
- "name": "verifyState",
113
+ "name": "findExpired",
114
+ "async": true,
190
115
  "params": [
191
- "callbackState: string"
116
+ "now?: Date"
192
117
  ],
193
- "returns": "boolean"
118
+ "returns": "Promise<OAuthState[]>"
194
119
  }
195
120
  ],
196
- "tenant": {
197
- "scoped": true,
198
- "mode": "optional",
199
- "field": "tenantId"
200
- },
201
- "tableStrategy": "sti",
202
- "conflictColumns": [
203
- "tenant_id",
204
- "slug",
205
- "context",
206
- "_meta_type"
207
- ],
208
121
  "surfaces": [
209
- {
210
- "kind": "api",
211
- "name": "oauthstates.list",
212
- "operation": "list",
213
- "objectName": "@happyvertical/smrt-social:OAuthState",
214
- "path": "/oauthstates",
215
- "method": "GET"
216
- },
217
- {
218
- "kind": "api",
219
- "name": "oauthstates.get",
220
- "operation": "get",
221
- "objectName": "@happyvertical/smrt-social:OAuthState",
222
- "path": "/oauthstates/[id]",
223
- "method": "GET"
224
- },
225
- {
226
- "kind": "api",
227
- "name": "oauthstates.create",
228
- "operation": "create",
229
- "objectName": "@happyvertical/smrt-social:OAuthState",
230
- "path": "/oauthstates",
231
- "method": "POST"
232
- },
233
- {
234
- "kind": "api",
235
- "name": "oauthstates.delete",
236
- "operation": "delete",
237
- "objectName": "@happyvertical/smrt-social:OAuthState",
238
- "path": "/oauthstates/[id]",
239
- "method": "DELETE"
240
- },
241
- {
242
- "kind": "cli",
243
- "name": "oauthstate_list",
244
- "operation": "list",
245
- "objectName": "@happyvertical/smrt-social:OAuthState"
246
- },
247
- {
248
- "kind": "cli",
249
- "name": "oauthstate_get",
250
- "operation": "get",
251
- "objectName": "@happyvertical/smrt-social:OAuthState"
252
- },
253
- {
254
- "kind": "cli",
255
- "name": "oauthstate_create",
256
- "operation": "create",
257
- "objectName": "@happyvertical/smrt-social:OAuthState"
258
- },
259
- {
260
- "kind": "cli",
261
- "name": "oauthstate_update",
262
- "operation": "update",
263
- "objectName": "@happyvertical/smrt-social:OAuthState"
264
- },
265
- {
266
- "kind": "cli",
267
- "name": "oauthstate_delete",
268
- "operation": "delete",
269
- "objectName": "@happyvertical/smrt-social:OAuthState"
270
- },
271
122
  {
272
123
  "kind": "cli",
273
- "name": "oauthstate_verifyState",
274
- "operation": "verifyState",
275
- "objectName": "@happyvertical/smrt-social:OAuthState"
124
+ "name": "oauthstatecollection_findByState",
125
+ "operation": "findByState",
126
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
276
127
  },
277
128
  {
278
129
  "kind": "cli",
279
- "name": "oauthstate_generateState",
280
- "operation": "generateState",
281
- "objectName": "@happyvertical/smrt-social:OAuthState"
130
+ "name": "oauthstatecollection_consume",
131
+ "operation": "consume",
132
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
282
133
  },
283
134
  {
284
135
  "kind": "cli",
285
- "name": "oauthstate_generateCodeVerifier",
286
- "operation": "generateCodeVerifier",
287
- "objectName": "@happyvertical/smrt-social:OAuthState"
136
+ "name": "oauthstatecollection_findExpired",
137
+ "operation": "findExpired",
138
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
288
139
  },
289
140
  {
290
141
  "kind": "cli",
291
- "name": "oauthstate_generateCodeChallenge",
292
- "operation": "generateCodeChallenge",
293
- "objectName": "@happyvertical/smrt-social:OAuthState"
142
+ "name": "oauthstatecollection_deleteExpired",
143
+ "operation": "deleteExpired",
144
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
294
145
  }
295
146
  ],
296
147
  "withheldSurfaces": [
297
148
  {
298
149
  "kind": "api",
299
- "operation": "generateCodeChallenge",
150
+ "operation": "consume",
300
151
  "code": "not-included",
301
152
  "reason": "not listed in api.include",
302
- "objectName": "@happyvertical/smrt-social:OAuthState"
153
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
303
154
  },
304
155
  {
305
156
  "kind": "api",
306
- "operation": "generateCodeVerifier",
157
+ "operation": "deleteExpired",
307
158
  "code": "not-included",
308
159
  "reason": "not listed in api.include",
309
- "objectName": "@happyvertical/smrt-social:OAuthState"
160
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
310
161
  },
311
162
  {
312
163
  "kind": "api",
313
- "operation": "generateState",
164
+ "operation": "findByState",
314
165
  "code": "not-included",
315
166
  "reason": "not listed in api.include",
316
- "objectName": "@happyvertical/smrt-social:OAuthState"
167
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
317
168
  },
318
169
  {
319
170
  "kind": "api",
320
- "operation": "verifyState",
171
+ "operation": "findExpired",
321
172
  "code": "not-included",
322
173
  "reason": "not listed in api.include",
323
- "objectName": "@happyvertical/smrt-social:OAuthState"
174
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
324
175
  }
325
176
  ],
326
177
  "relationshipFeatures": [
327
- "crossPackageRef",
328
178
  "uuidColumns"
329
179
  ],
330
180
  "tags": [],
331
181
  "risks": []
332
182
  },
333
183
  {
334
- "name": "SocialAccount",
335
- "qualifiedName": "@happyvertical/smrt-social:SocialAccount",
336
- "displayLabelField": "name",
184
+ "name": "SocialAccountCollection",
185
+ "qualifiedName": "@happyvertical/smrt-social:SocialAccountCollection",
337
186
  "collection": "socialaccounts",
338
- "description": "Connected social media account for publishing",
339
187
  "tableName": "social_accounts",
340
188
  "packageName": "@happyvertical/smrt-social",
341
- "extends": "SmrtObject",
342
- "fields": [
343
- {
344
- "name": "created_at",
345
- "type": "datetime",
346
- "required": false,
347
- "columnType": "TIMESTAMP"
348
- },
349
- {
350
- "name": "updated_at",
351
- "type": "datetime",
352
- "required": false,
353
- "columnType": "TIMESTAMP"
354
- },
355
- {
356
- "name": "tenantId",
357
- "type": "text",
358
- "required": false,
359
- "columnType": "UUID"
360
- },
361
- {
362
- "name": "name",
363
- "type": "text",
364
- "required": false,
365
- "columnType": "TEXT",
366
- "default": "",
367
- "description": "A name you will recognise this account by."
368
- },
369
- {
370
- "name": "platform",
371
- "type": "text",
372
- "required": false,
373
- "columnType": "TEXT",
374
- "default": "youtube",
375
- "description": "Which platform it is on: YouTube, X, Threads or Bluesky."
376
- },
189
+ "extends": "SmrtCollection",
190
+ "fields": [],
191
+ "relationships": [],
192
+ "methods": [
193
+ "findActive",
194
+ "findNeedsAttention",
195
+ "findReady"
196
+ ],
197
+ "methodSignatures": [
377
198
  {
378
- "name": "platformUserId",
379
- "type": "text",
380
- "required": false,
381
- "columnType": "TEXT"
199
+ "name": "findActive",
200
+ "async": true,
201
+ "params": [
202
+ "platform?: SocialPlatformType"
203
+ ],
204
+ "returns": "Promise<SocialAccount[]>"
382
205
  },
383
206
  {
384
- "name": "platformUsername",
385
- "type": "text",
386
- "required": false,
387
- "columnType": "TEXT",
388
- "description": "The username or handle you post under."
207
+ "name": "findNeedsAttention",
208
+ "async": true,
209
+ "returns": "Promise<SocialAccount[]>"
389
210
  },
390
211
  {
391
- "name": "platformUrl",
392
- "type": "text",
393
- "required": false,
394
- "columnType": "TEXT",
395
- "description": "The web address of your profile on the platform."
396
- },
212
+ "name": "findReady",
213
+ "async": true,
214
+ "params": [
215
+ "platform?: SocialPlatformType"
216
+ ],
217
+ "returns": "Promise<SocialAccount[]>"
218
+ }
219
+ ],
220
+ "surfaces": [
397
221
  {
398
- "name": "accessToken",
399
- "type": "text",
400
- "required": false,
401
- "columnType": "TEXT"
222
+ "kind": "cli",
223
+ "name": "socialaccountcollection_findActive",
224
+ "operation": "findActive",
225
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
402
226
  },
403
227
  {
404
- "name": "refreshToken",
405
- "type": "text",
406
- "required": false,
407
- "columnType": "TEXT"
228
+ "kind": "cli",
229
+ "name": "socialaccountcollection_findReady",
230
+ "operation": "findReady",
231
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
408
232
  },
409
233
  {
410
- "name": "credentialSecretId",
411
- "type": "text",
412
- "required": false,
413
- "columnType": "TEXT"
414
- },
234
+ "kind": "cli",
235
+ "name": "socialaccountcollection_findNeedsAttention",
236
+ "operation": "findNeedsAttention",
237
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
238
+ }
239
+ ],
240
+ "withheldSurfaces": [
415
241
  {
416
- "name": "accessTokenSecretName",
417
- "type": "text",
418
- "required": false,
419
- "columnType": "TEXT"
242
+ "kind": "api",
243
+ "operation": "findActive",
244
+ "code": "not-included",
245
+ "reason": "not listed in api.include",
246
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
420
247
  },
421
248
  {
422
- "name": "refreshTokenSecretName",
423
- "type": "text",
424
- "required": false,
425
- "columnType": "TEXT"
249
+ "kind": "api",
250
+ "operation": "findNeedsAttention",
251
+ "code": "not-included",
252
+ "reason": "not listed in api.include",
253
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
426
254
  },
427
255
  {
428
- "name": "tokenExpiresAt",
429
- "type": "datetime",
430
- "required": false,
431
- "columnType": "TIMESTAMP"
432
- },
256
+ "kind": "api",
257
+ "operation": "findReady",
258
+ "code": "not-included",
259
+ "reason": "not listed in api.include",
260
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
261
+ }
262
+ ],
263
+ "relationshipFeatures": [
264
+ "uuidColumns"
265
+ ],
266
+ "tags": [],
267
+ "risks": []
268
+ },
269
+ {
270
+ "name": "SocialPostAnalyticsSnapshotCollection",
271
+ "qualifiedName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection",
272
+ "collection": "socialpostanalyticssnapshots",
273
+ "tableName": "social_post_analytics_snapshots",
274
+ "packageName": "@happyvertical/smrt-social",
275
+ "extends": "SmrtCollection",
276
+ "fields": [],
277
+ "relationships": [],
278
+ "methods": [
279
+ "findForPost",
280
+ "findLatestForPost",
281
+ "recordSnapshot"
282
+ ],
283
+ "methodSignatures": [
433
284
  {
434
- "name": "isActive",
435
- "type": "boolean",
436
- "required": false,
437
- "columnType": "BOOLEAN",
438
- "default": true,
439
- "description": "Whether posts can still go out from this account."
285
+ "name": "findForPost",
286
+ "async": true,
287
+ "params": [
288
+ "socialPostId: string"
289
+ ],
290
+ "returns": "Promise<SocialPostAnalyticsSnapshot[]>"
440
291
  },
441
292
  {
442
- "name": "defaultHashtags",
443
- "type": "json",
444
- "required": false,
445
- "columnType": "JSON",
446
- "default": [],
447
- "description": "Hashtags added to every post from this account."
293
+ "name": "findLatestForPost",
294
+ "async": true,
295
+ "params": [
296
+ "socialPostId: string"
297
+ ],
298
+ "returns": "Promise<SocialPostAnalyticsSnapshot | null>"
448
299
  },
449
300
  {
450
- "name": "scopes",
451
- "type": "json",
452
- "required": false,
453
- "columnType": "JSON",
454
- "default": []
455
- },
301
+ "name": "recordSnapshot",
302
+ "async": true,
303
+ "params": [
304
+ "options: object"
305
+ ],
306
+ "returns": "Promise<SocialPostAnalyticsSnapshot>"
307
+ }
308
+ ],
309
+ "surfaces": [
456
310
  {
457
- "name": "missingPermissions",
458
- "type": "json",
459
- "required": false,
460
- "columnType": "JSON",
461
- "default": []
311
+ "kind": "cli",
312
+ "name": "socialpostanalyticssnapshotcollection_recordSnapshot",
313
+ "operation": "recordSnapshot",
314
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
462
315
  },
463
316
  {
464
- "name": "linkBehavior",
465
- "type": "text",
466
- "required": false,
467
- "columnType": "TEXT",
468
- "default": "description",
469
- "description": "Where a shared link goes: in the text, as a reply, or left out."
317
+ "kind": "cli",
318
+ "name": "socialpostanalyticssnapshotcollection_findForPost",
319
+ "operation": "findForPost",
320
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
470
321
  },
471
322
  {
472
- "name": "publishMode",
473
- "type": "text",
474
- "required": false,
475
- "columnType": "TEXT",
476
- "default": "dry_run"
477
- },
323
+ "kind": "cli",
324
+ "name": "socialpostanalyticssnapshotcollection_findLatestForPost",
325
+ "operation": "findLatestForPost",
326
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
327
+ }
328
+ ],
329
+ "withheldSurfaces": [
478
330
  {
479
- "name": "publicPublishingAllowed",
480
- "type": "boolean",
481
- "required": false,
482
- "columnType": "BOOLEAN",
483
- "default": false
331
+ "kind": "api",
332
+ "operation": "findForPost",
333
+ "code": "not-included",
334
+ "reason": "not listed in api.include",
335
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
484
336
  },
485
337
  {
486
- "name": "status",
487
- "type": "text",
488
- "required": false,
489
- "columnType": "TEXT",
490
- "default": "connected",
491
- "description": "Whether the account is connected, or needs signing in again."
338
+ "kind": "api",
339
+ "operation": "findLatestForPost",
340
+ "code": "not-included",
341
+ "reason": "not listed in api.include",
342
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
492
343
  },
493
344
  {
494
- "name": "errorMessage",
495
- "type": "text",
496
- "required": false,
497
- "columnType": "TEXT"
345
+ "kind": "api",
346
+ "operation": "recordSnapshot",
347
+ "code": "not-included",
348
+ "reason": "not listed in api.include",
349
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
498
350
  }
499
351
  ],
352
+ "relationshipFeatures": [
353
+ "uuidColumns"
354
+ ],
355
+ "tags": [],
356
+ "risks": []
357
+ },
358
+ {
359
+ "name": "SocialPostCollection",
360
+ "qualifiedName": "@happyvertical/smrt-social:SocialPostCollection",
361
+ "collection": "socialposts",
362
+ "tableName": "social_posts",
363
+ "packageName": "@happyvertical/smrt-social",
364
+ "extends": "SmrtCollection",
365
+ "fields": [],
500
366
  "relationships": [],
501
367
  "methods": [
502
- "getCredentials",
503
- "getSlug",
504
- "setCredentials"
368
+ "createDraft",
369
+ "findByStatus",
370
+ "findDueForPublish",
371
+ "findForAccount",
372
+ "recordPublishFailure",
373
+ "recordPublishSuccess",
374
+ "updateLatestAnalytics"
505
375
  ],
506
376
  "methodSignatures": [
507
377
  {
508
- "name": "getCredentials",
378
+ "name": "createDraft",
509
379
  "async": true,
510
- "returns": "Promise<Record<string, unknown> | null>"
380
+ "params": [
381
+ "options: CreateSocialPostDraftOptions"
382
+ ],
383
+ "returns": "Promise<SocialPost>"
511
384
  },
512
385
  {
513
- "name": "getSlug",
386
+ "name": "findByStatus",
514
387
  "async": true,
515
- "returns": "Promise<string | null | undefined>"
388
+ "params": [
389
+ "status: PostStatus"
390
+ ],
391
+ "returns": "Promise<SocialPost[]>"
516
392
  },
517
393
  {
518
- "name": "setCredentials",
394
+ "name": "findDueForPublish",
519
395
  "async": true,
520
396
  "params": [
521
- "credentials: Record<string, unknown>",
522
- "options?: object"
397
+ "now?: Date"
523
398
  ],
524
- "returns": "Promise<void>"
525
- }
526
- ],
527
- "tenant": {
528
- "scoped": true,
529
- "mode": "optional",
530
- "field": "tenantId"
531
- },
532
- "tableStrategy": "sti",
533
- "conflictColumns": [
534
- "tenant_id",
535
- "slug",
536
- "context",
537
- "_meta_type"
538
- ],
539
- "surfaces": [
540
- {
541
- "kind": "api",
542
- "name": "socialaccounts.list",
543
- "operation": "list",
544
- "objectName": "@happyvertical/smrt-social:SocialAccount",
545
- "path": "/socialaccounts",
546
- "method": "GET"
547
- },
548
- {
549
- "kind": "api",
550
- "name": "socialaccounts.get",
551
- "operation": "get",
552
- "objectName": "@happyvertical/smrt-social:SocialAccount",
553
- "path": "/socialaccounts/[id]",
554
- "method": "GET"
399
+ "returns": "Promise<SocialPost[]>"
555
400
  },
556
401
  {
557
- "kind": "api",
558
- "name": "socialaccounts.create",
559
- "operation": "create",
560
- "objectName": "@happyvertical/smrt-social:SocialAccount",
561
- "path": "/socialaccounts",
562
- "method": "POST"
402
+ "name": "findForAccount",
403
+ "async": true,
404
+ "params": [
405
+ "socialAccountId: string"
406
+ ],
407
+ "returns": "Promise<SocialPost[]>"
563
408
  },
564
409
  {
565
- "kind": "api",
566
- "name": "socialaccounts.update",
567
- "operation": "update",
568
- "objectName": "@happyvertical/smrt-social:SocialAccount",
569
- "path": "/socialaccounts/[id]",
570
- "method": "PATCH"
410
+ "name": "recordPublishFailure",
411
+ "async": true,
412
+ "params": [
413
+ "post: SocialPost",
414
+ "error: Error | string"
415
+ ],
416
+ "returns": "Promise<SocialPost>"
571
417
  },
572
418
  {
573
- "kind": "api",
574
- "name": "socialaccounts.delete",
575
- "operation": "delete",
576
- "objectName": "@happyvertical/smrt-social:SocialAccount",
577
- "path": "/socialaccounts/[id]",
578
- "method": "DELETE"
419
+ "name": "recordPublishSuccess",
420
+ "async": true,
421
+ "params": [
422
+ "post: SocialPost",
423
+ "data: PublishSuccessData"
424
+ ],
425
+ "returns": "Promise<SocialPost>"
579
426
  },
427
+ {
428
+ "name": "updateLatestAnalytics",
429
+ "async": true,
430
+ "params": [
431
+ "post: SocialPost",
432
+ "analytics: PostAnalytics",
433
+ "syncedAt?: Date"
434
+ ],
435
+ "returns": "Promise<SocialPost>"
436
+ }
437
+ ],
438
+ "surfaces": [
580
439
  {
581
440
  "kind": "cli",
582
- "name": "socialaccount_list",
583
- "operation": "list",
584
- "objectName": "@happyvertical/smrt-social:SocialAccount"
441
+ "name": "socialpostcollection_createDraft",
442
+ "operation": "createDraft",
443
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
585
444
  },
586
445
  {
587
446
  "kind": "cli",
588
- "name": "socialaccount_get",
589
- "operation": "get",
590
- "objectName": "@happyvertical/smrt-social:SocialAccount"
447
+ "name": "socialpostcollection_findByStatus",
448
+ "operation": "findByStatus",
449
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
591
450
  },
592
451
  {
593
452
  "kind": "cli",
594
- "name": "socialaccount_create",
595
- "operation": "create",
596
- "objectName": "@happyvertical/smrt-social:SocialAccount"
453
+ "name": "socialpostcollection_findForAccount",
454
+ "operation": "findForAccount",
455
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
597
456
  },
598
457
  {
599
458
  "kind": "cli",
600
- "name": "socialaccount_update",
601
- "operation": "update",
602
- "objectName": "@happyvertical/smrt-social:SocialAccount"
459
+ "name": "socialpostcollection_findDueForPublish",
460
+ "operation": "findDueForPublish",
461
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
603
462
  },
604
463
  {
605
464
  "kind": "cli",
606
- "name": "socialaccount_delete",
607
- "operation": "delete",
608
- "objectName": "@happyvertical/smrt-social:SocialAccount"
465
+ "name": "socialpostcollection_recordPublishSuccess",
466
+ "operation": "recordPublishSuccess",
467
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
609
468
  },
610
469
  {
611
470
  "kind": "cli",
612
- "name": "socialaccount_setCredentials",
613
- "operation": "setCredentials",
614
- "objectName": "@happyvertical/smrt-social:SocialAccount"
471
+ "name": "socialpostcollection_recordPublishFailure",
472
+ "operation": "recordPublishFailure",
473
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
615
474
  },
616
475
  {
617
476
  "kind": "cli",
618
- "name": "socialaccount_getCredentials",
619
- "operation": "getCredentials",
620
- "objectName": "@happyvertical/smrt-social:SocialAccount"
477
+ "name": "socialpostcollection_updateLatestAnalytics",
478
+ "operation": "updateLatestAnalytics",
479
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
480
+ }
481
+ ],
482
+ "withheldSurfaces": [
483
+ {
484
+ "kind": "api",
485
+ "operation": "createDraft",
486
+ "code": "not-included",
487
+ "reason": "not listed in api.include",
488
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
621
489
  },
622
490
  {
623
- "kind": "mcp",
624
- "name": "socialaccount_list",
625
- "operation": "list",
626
- "objectName": "@happyvertical/smrt-social:SocialAccount"
491
+ "kind": "api",
492
+ "operation": "findByStatus",
493
+ "code": "not-included",
494
+ "reason": "not listed in api.include",
495
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
627
496
  },
628
497
  {
629
- "kind": "mcp",
630
- "name": "socialaccount_get",
631
- "operation": "get",
632
- "objectName": "@happyvertical/smrt-social:SocialAccount"
633
- }
634
- ],
635
- "withheldSurfaces": [
498
+ "kind": "api",
499
+ "operation": "findDueForPublish",
500
+ "code": "not-included",
501
+ "reason": "not listed in api.include",
502
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
503
+ },
636
504
  {
637
505
  "kind": "api",
638
- "operation": "getCredentials",
506
+ "operation": "findForAccount",
639
507
  "code": "not-included",
640
508
  "reason": "not listed in api.include",
641
- "objectName": "@happyvertical/smrt-social:SocialAccount"
509
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
642
510
  },
643
511
  {
644
512
  "kind": "api",
645
- "operation": "getSlug",
646
- "code": "lifecycle-method",
647
- "reason": "`getSlug` is a framework lifecycle method, not a distinct operation",
648
- "objectName": "@happyvertical/smrt-social:SocialAccount"
513
+ "operation": "recordPublishFailure",
514
+ "code": "not-included",
515
+ "reason": "not listed in api.include",
516
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
649
517
  },
650
518
  {
651
519
  "kind": "api",
652
- "operation": "setCredentials",
520
+ "operation": "recordPublishSuccess",
653
521
  "code": "not-included",
654
522
  "reason": "not listed in api.include",
655
- "objectName": "@happyvertical/smrt-social:SocialAccount"
523
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
524
+ },
525
+ {
526
+ "kind": "api",
527
+ "operation": "updateLatestAnalytics",
528
+ "code": "not-included",
529
+ "reason": "not listed in api.include",
530
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
656
531
  }
657
532
  ],
658
533
  "relationshipFeatures": [
@@ -662,10 +537,11 @@
662
537
  "risks": []
663
538
  },
664
539
  {
665
- "name": "SocialPostAnalyticsSnapshot",
666
- "qualifiedName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
667
- "collection": "socialpostanalyticssnapshots",
668
- "tableName": "social_post_analytics_snapshots",
540
+ "name": "OAuthState",
541
+ "qualifiedName": "@happyvertical/smrt-social:OAuthState",
542
+ "collection": "oauthstates",
543
+ "description": "Temporary OAuth state for social account connection",
544
+ "tableName": "oauth_states",
669
545
  "packageName": "@happyvertical/smrt-social",
670
546
  "extends": "SmrtObject",
671
547
  "fields": [
@@ -688,51 +564,102 @@
688
564
  "columnType": "UUID"
689
565
  },
690
566
  {
691
- "name": "socialPostId",
692
- "type": "foreignKey",
567
+ "name": "platform",
568
+ "type": "text",
693
569
  "required": false,
694
- "related": "SocialPost",
695
- "columnType": "UUID",
696
- "description": "The post these numbers are for."
570
+ "columnType": "TEXT",
571
+ "default": "youtube"
697
572
  },
698
573
  {
699
- "name": "platform",
574
+ "name": "state",
700
575
  "type": "text",
701
- "required": true,
576
+ "required": false,
702
577
  "columnType": "TEXT",
703
- "description": "The platform that reported the numbers."
578
+ "default": ""
704
579
  },
705
580
  {
706
- "name": "analytics",
707
- "type": "json",
581
+ "name": "codeVerifier",
582
+ "type": "text",
708
583
  "required": false,
709
- "columnType": "JSON",
710
- "description": "The views, likes, comments, shares and clicks the platform reported."
584
+ "columnType": "TEXT"
711
585
  },
712
586
  {
713
- "name": "raw",
587
+ "name": "redirectUri",
588
+ "type": "text",
589
+ "required": false,
590
+ "columnType": "TEXT",
591
+ "default": ""
592
+ },
593
+ {
594
+ "name": "scopes",
714
595
  "type": "json",
715
596
  "required": false,
716
- "columnType": "JSON"
597
+ "columnType": "JSON",
598
+ "default": []
717
599
  },
718
600
  {
719
- "name": "capturedAt",
601
+ "name": "expiresAt",
720
602
  "type": "datetime",
721
603
  "required": false,
722
- "columnType": "TIMESTAMP",
723
- "description": "When these numbers were taken from the platform."
604
+ "columnType": "TIMESTAMP"
605
+ },
606
+ {
607
+ "name": "createdByUserId",
608
+ "type": "crossPackageRef",
609
+ "required": false,
610
+ "related": "@happyvertical/smrt-users:User",
611
+ "columnType": "UUID"
612
+ },
613
+ {
614
+ "name": "returnTo",
615
+ "type": "text",
616
+ "required": false,
617
+ "columnType": "TEXT"
724
618
  }
725
619
  ],
726
620
  "relationships": [
727
621
  {
728
- "name": "socialPostId",
729
- "type": "foreignKey",
622
+ "name": "createdByUserId",
623
+ "type": "crossPackageRef",
730
624
  "required": false,
731
- "related": "SocialPost",
625
+ "related": "@happyvertical/smrt-users:User",
732
626
  "columnType": "UUID"
733
627
  }
734
628
  ],
735
- "methods": [],
629
+ "methods": [
630
+ "generateCodeChallenge",
631
+ "generateCodeVerifier",
632
+ "generateState",
633
+ "verifyState"
634
+ ],
635
+ "methodSignatures": [
636
+ {
637
+ "name": "generateCodeChallenge",
638
+ "async": true,
639
+ "static": true,
640
+ "params": [
641
+ "verifier: string"
642
+ ],
643
+ "returns": "Promise<string>"
644
+ },
645
+ {
646
+ "name": "generateCodeVerifier",
647
+ "static": true,
648
+ "returns": "string"
649
+ },
650
+ {
651
+ "name": "generateState",
652
+ "static": true,
653
+ "returns": "string"
654
+ },
655
+ {
656
+ "name": "verifyState",
657
+ "params": [
658
+ "callbackState: string"
659
+ ],
660
+ "returns": "boolean"
661
+ }
662
+ ],
736
663
  "tenant": {
737
664
  "scoped": true,
738
665
  "mode": "optional",
@@ -748,93 +675,135 @@
748
675
  "surfaces": [
749
676
  {
750
677
  "kind": "api",
751
- "name": "socialpostanalyticssnapshots.list",
678
+ "name": "oauthstates.list",
752
679
  "operation": "list",
753
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
754
- "path": "/socialpostanalyticssnapshots",
680
+ "objectName": "@happyvertical/smrt-social:OAuthState",
681
+ "path": "/oauthstates",
755
682
  "method": "GET"
756
683
  },
757
684
  {
758
685
  "kind": "api",
759
- "name": "socialpostanalyticssnapshots.get",
686
+ "name": "oauthstates.get",
760
687
  "operation": "get",
761
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
762
- "path": "/socialpostanalyticssnapshots/[id]",
688
+ "objectName": "@happyvertical/smrt-social:OAuthState",
689
+ "path": "/oauthstates/[id]",
763
690
  "method": "GET"
764
691
  },
765
692
  {
766
693
  "kind": "api",
767
- "name": "socialpostanalyticssnapshots.create",
768
- "operation": "create",
769
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
770
- "path": "/socialpostanalyticssnapshots",
694
+ "name": "oauthstates.create",
695
+ "operation": "create",
696
+ "objectName": "@happyvertical/smrt-social:OAuthState",
697
+ "path": "/oauthstates",
771
698
  "method": "POST"
772
699
  },
773
700
  {
774
701
  "kind": "api",
775
- "name": "socialpostanalyticssnapshots.delete",
702
+ "name": "oauthstates.delete",
776
703
  "operation": "delete",
777
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
778
- "path": "/socialpostanalyticssnapshots/[id]",
704
+ "objectName": "@happyvertical/smrt-social:OAuthState",
705
+ "path": "/oauthstates/[id]",
779
706
  "method": "DELETE"
780
707
  },
781
708
  {
782
709
  "kind": "cli",
783
- "name": "socialpostanalyticssnapshot_list",
710
+ "name": "oauthstate_list",
784
711
  "operation": "list",
785
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
712
+ "objectName": "@happyvertical/smrt-social:OAuthState"
786
713
  },
787
714
  {
788
715
  "kind": "cli",
789
- "name": "socialpostanalyticssnapshot_get",
716
+ "name": "oauthstate_get",
790
717
  "operation": "get",
791
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
718
+ "objectName": "@happyvertical/smrt-social:OAuthState"
792
719
  },
793
720
  {
794
721
  "kind": "cli",
795
- "name": "socialpostanalyticssnapshot_create",
722
+ "name": "oauthstate_create",
796
723
  "operation": "create",
797
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
724
+ "objectName": "@happyvertical/smrt-social:OAuthState"
798
725
  },
799
726
  {
800
727
  "kind": "cli",
801
- "name": "socialpostanalyticssnapshot_update",
728
+ "name": "oauthstate_update",
802
729
  "operation": "update",
803
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
730
+ "objectName": "@happyvertical/smrt-social:OAuthState"
804
731
  },
805
732
  {
806
733
  "kind": "cli",
807
- "name": "socialpostanalyticssnapshot_delete",
734
+ "name": "oauthstate_delete",
808
735
  "operation": "delete",
809
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
736
+ "objectName": "@happyvertical/smrt-social:OAuthState"
810
737
  },
811
738
  {
812
- "kind": "mcp",
813
- "name": "socialpostanalyticssnapshot_list",
814
- "operation": "list",
815
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
739
+ "kind": "cli",
740
+ "name": "oauthstate_verifyState",
741
+ "operation": "verifyState",
742
+ "objectName": "@happyvertical/smrt-social:OAuthState"
816
743
  },
817
744
  {
818
- "kind": "mcp",
819
- "name": "socialpostanalyticssnapshot_get",
820
- "operation": "get",
821
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
745
+ "kind": "cli",
746
+ "name": "oauthstate_generateState",
747
+ "operation": "generateState",
748
+ "objectName": "@happyvertical/smrt-social:OAuthState"
749
+ },
750
+ {
751
+ "kind": "cli",
752
+ "name": "oauthstate_generateCodeVerifier",
753
+ "operation": "generateCodeVerifier",
754
+ "objectName": "@happyvertical/smrt-social:OAuthState"
755
+ },
756
+ {
757
+ "kind": "cli",
758
+ "name": "oauthstate_generateCodeChallenge",
759
+ "operation": "generateCodeChallenge",
760
+ "objectName": "@happyvertical/smrt-social:OAuthState"
761
+ }
762
+ ],
763
+ "withheldSurfaces": [
764
+ {
765
+ "kind": "api",
766
+ "operation": "generateCodeChallenge",
767
+ "code": "not-included",
768
+ "reason": "not listed in api.include",
769
+ "objectName": "@happyvertical/smrt-social:OAuthState"
770
+ },
771
+ {
772
+ "kind": "api",
773
+ "operation": "generateCodeVerifier",
774
+ "code": "not-included",
775
+ "reason": "not listed in api.include",
776
+ "objectName": "@happyvertical/smrt-social:OAuthState"
777
+ },
778
+ {
779
+ "kind": "api",
780
+ "operation": "generateState",
781
+ "code": "not-included",
782
+ "reason": "not listed in api.include",
783
+ "objectName": "@happyvertical/smrt-social:OAuthState"
784
+ },
785
+ {
786
+ "kind": "api",
787
+ "operation": "verifyState",
788
+ "code": "not-included",
789
+ "reason": "not listed in api.include",
790
+ "objectName": "@happyvertical/smrt-social:OAuthState"
822
791
  }
823
792
  ],
824
793
  "relationshipFeatures": [
825
- "foreignKey",
794
+ "crossPackageRef",
826
795
  "uuidColumns"
827
796
  ],
828
797
  "tags": [],
829
798
  "risks": []
830
799
  },
831
800
  {
832
- "name": "SocialPost",
833
- "qualifiedName": "@happyvertical/smrt-social:SocialPost",
834
- "displayLabelField": "title",
835
- "collection": "socialposts",
836
- "description": "Social media post for multi-platform publishing",
837
- "tableName": "social_posts",
801
+ "name": "SocialAccount",
802
+ "qualifiedName": "@happyvertical/smrt-social:SocialAccount",
803
+ "displayLabelField": "name",
804
+ "collection": "socialaccounts",
805
+ "description": "Connected social media account for publishing",
806
+ "tableName": "social_accounts",
838
807
  "packageName": "@happyvertical/smrt-social",
839
808
  "extends": "SmrtObject",
840
809
  "fields": [
@@ -857,163 +826,171 @@
857
826
  "columnType": "UUID"
858
827
  },
859
828
  {
860
- "name": "socialAccountId",
861
- "type": "foreignKey",
829
+ "name": "name",
830
+ "type": "text",
862
831
  "required": false,
863
- "related": "SocialAccount",
864
- "columnType": "UUID",
865
- "description": "The connected account this post goes out from."
832
+ "columnType": "TEXT",
833
+ "default": "",
834
+ "description": "A name you will recognise this account by."
866
835
  },
867
836
  {
868
- "name": "createdByUserId",
869
- "type": "crossPackageRef",
837
+ "name": "platform",
838
+ "type": "text",
870
839
  "required": false,
871
- "related": "@happyvertical/smrt-users:User",
872
- "columnType": "UUID"
840
+ "columnType": "TEXT",
841
+ "default": "youtube",
842
+ "description": "Which platform it is on: YouTube, X, Threads or Bluesky."
873
843
  },
874
844
  {
875
- "name": "videoContentId",
876
- "type": "crossPackageRef",
845
+ "name": "platformUserId",
846
+ "type": "text",
877
847
  "required": false,
878
- "related": "@happyvertical/smrt-video:VideoContent",
879
- "columnType": "UUID"
848
+ "columnType": "TEXT"
880
849
  },
881
850
  {
882
- "name": "contentId",
883
- "type": "crossPackageRef",
851
+ "name": "platformUsername",
852
+ "type": "text",
884
853
  "required": false,
885
- "related": "@happyvertical/smrt-content:Content",
886
- "columnType": "UUID"
854
+ "columnType": "TEXT",
855
+ "description": "The username or handle you post under."
887
856
  },
888
857
  {
889
- "name": "postType",
858
+ "name": "platformUrl",
890
859
  "type": "text",
891
860
  "required": false,
892
861
  "columnType": "TEXT",
893
- "default": "text",
894
- "description": "What kind of post it is: text, link, image or video."
862
+ "description": "The web address of your profile on the platform."
895
863
  },
896
864
  {
897
- "name": "mediaUrl",
865
+ "name": "accessToken",
898
866
  "type": "text",
899
867
  "required": false,
900
868
  "columnType": "TEXT"
901
869
  },
902
870
  {
903
- "name": "title",
871
+ "name": "refreshToken",
904
872
  "type": "text",
905
873
  "required": false,
906
- "columnType": "TEXT",
907
- "description": "A title, for platforms that show one."
874
+ "columnType": "TEXT"
908
875
  },
909
876
  {
910
- "name": "description",
877
+ "name": "credentialSecretId",
911
878
  "type": "text",
912
879
  "required": false,
913
- "columnType": "TEXT",
914
- "default": "",
915
- "description": "The words of the post."
880
+ "columnType": "TEXT"
916
881
  },
917
882
  {
918
- "name": "hashtags",
919
- "type": "json",
883
+ "name": "accessTokenSecretName",
884
+ "type": "text",
920
885
  "required": false,
921
- "columnType": "JSON",
922
- "default": [],
923
- "description": "Hashtags added to the end of the post."
886
+ "columnType": "TEXT"
924
887
  },
925
888
  {
926
- "name": "linkUrl",
889
+ "name": "refreshTokenSecretName",
927
890
  "type": "text",
928
891
  "required": false,
929
- "columnType": "TEXT",
930
- "description": "A web address to share with the post."
892
+ "columnType": "TEXT"
931
893
  },
932
894
  {
933
- "name": "platformPostId",
934
- "type": "text",
895
+ "name": "tokenExpiresAt",
896
+ "type": "datetime",
935
897
  "required": false,
936
- "columnType": "TEXT"
898
+ "columnType": "TIMESTAMP"
937
899
  },
938
900
  {
939
- "name": "platformUrl",
940
- "type": "text",
901
+ "name": "isActive",
902
+ "type": "boolean",
941
903
  "required": false,
942
- "columnType": "TEXT",
943
- "description": "Where the post can be seen on the platform, once it is out."
904
+ "columnType": "BOOLEAN",
905
+ "default": true,
906
+ "description": "Whether posts can still go out from this account."
944
907
  },
945
908
  {
946
- "name": "scheduledAt",
947
- "type": "datetime",
909
+ "name": "defaultHashtags",
910
+ "type": "json",
948
911
  "required": false,
949
- "columnType": "TIMESTAMP",
950
- "description": "The date and time you have in mind for putting the post out. Only a note of the plan: publishing is a separate step your application has to run."
912
+ "columnType": "JSON",
913
+ "default": [],
914
+ "description": "Hashtags added to every post from this account."
951
915
  },
952
916
  {
953
- "name": "publishedAt",
954
- "type": "datetime",
917
+ "name": "scopes",
918
+ "type": "json",
955
919
  "required": false,
956
- "columnType": "TIMESTAMP",
957
- "description": "When the post actually went out."
920
+ "columnType": "JSON",
921
+ "default": []
958
922
  },
959
923
  {
960
- "name": "status",
961
- "type": "text",
924
+ "name": "missingPermissions",
925
+ "type": "json",
962
926
  "required": false,
963
- "columnType": "TEXT",
964
- "default": "draft",
965
- "description": "Where the post stands: draft, waiting to go out, published or failed."
927
+ "columnType": "JSON",
928
+ "default": []
966
929
  },
967
930
  {
968
- "name": "errorMessage",
931
+ "name": "linkBehavior",
969
932
  "type": "text",
970
933
  "required": false,
971
- "columnType": "TEXT"
934
+ "columnType": "TEXT",
935
+ "default": "description",
936
+ "description": "Where a shared link goes: in the text, as a reply, or left out."
972
937
  },
973
938
  {
974
- "name": "analytics",
975
- "type": "json",
939
+ "name": "publishMode",
940
+ "type": "text",
976
941
  "required": false,
977
- "columnType": "JSON"
942
+ "columnType": "TEXT",
943
+ "default": "dry_run"
978
944
  },
979
945
  {
980
- "name": "analyticsLastSyncedAt",
981
- "type": "datetime",
946
+ "name": "publicPublishingAllowed",
947
+ "type": "boolean",
982
948
  "required": false,
983
- "columnType": "TIMESTAMP"
984
- }
985
- ],
986
- "relationships": [
949
+ "columnType": "BOOLEAN",
950
+ "default": false
951
+ },
987
952
  {
988
- "name": "socialAccountId",
989
- "type": "foreignKey",
953
+ "name": "status",
954
+ "type": "text",
990
955
  "required": false,
991
- "related": "SocialAccount",
992
- "columnType": "UUID"
956
+ "columnType": "TEXT",
957
+ "default": "connected",
958
+ "description": "Whether the account is connected, or needs signing in again."
993
959
  },
994
960
  {
995
- "name": "createdByUserId",
996
- "type": "crossPackageRef",
961
+ "name": "errorMessage",
962
+ "type": "text",
997
963
  "required": false,
998
- "related": "@happyvertical/smrt-users:User",
999
- "columnType": "UUID"
964
+ "columnType": "TEXT"
965
+ }
966
+ ],
967
+ "relationships": [],
968
+ "methods": [
969
+ "getCredentials",
970
+ "getSlug",
971
+ "setCredentials"
972
+ ],
973
+ "methodSignatures": [
974
+ {
975
+ "name": "getCredentials",
976
+ "async": true,
977
+ "returns": "Promise<Record<string, unknown> | null>"
1000
978
  },
1001
979
  {
1002
- "name": "videoContentId",
1003
- "type": "crossPackageRef",
1004
- "required": false,
1005
- "related": "@happyvertical/smrt-video:VideoContent",
1006
- "columnType": "UUID"
980
+ "name": "getSlug",
981
+ "async": true,
982
+ "returns": "Promise<string | null | undefined>"
1007
983
  },
1008
984
  {
1009
- "name": "contentId",
1010
- "type": "crossPackageRef",
1011
- "required": false,
1012
- "related": "@happyvertical/smrt-content:Content",
1013
- "columnType": "UUID"
985
+ "name": "setCredentials",
986
+ "async": true,
987
+ "params": [
988
+ "credentials: Record<string, unknown>",
989
+ "options?: object"
990
+ ],
991
+ "returns": "Promise<void>"
1014
992
  }
1015
993
  ],
1016
- "methods": [],
1017
994
  "tenant": {
1018
995
  "scoped": true,
1019
996
  "mode": "optional",
@@ -1029,557 +1006,580 @@
1029
1006
  "surfaces": [
1030
1007
  {
1031
1008
  "kind": "api",
1032
- "name": "socialposts.list",
1009
+ "name": "socialaccounts.list",
1033
1010
  "operation": "list",
1034
- "objectName": "@happyvertical/smrt-social:SocialPost",
1035
- "path": "/socialposts",
1011
+ "objectName": "@happyvertical/smrt-social:SocialAccount",
1012
+ "path": "/socialaccounts",
1036
1013
  "method": "GET"
1037
1014
  },
1038
1015
  {
1039
1016
  "kind": "api",
1040
- "name": "socialposts.get",
1017
+ "name": "socialaccounts.get",
1041
1018
  "operation": "get",
1042
- "objectName": "@happyvertical/smrt-social:SocialPost",
1043
- "path": "/socialposts/[id]",
1019
+ "objectName": "@happyvertical/smrt-social:SocialAccount",
1020
+ "path": "/socialaccounts/[id]",
1044
1021
  "method": "GET"
1045
1022
  },
1046
1023
  {
1047
1024
  "kind": "api",
1048
- "name": "socialposts.create",
1025
+ "name": "socialaccounts.create",
1049
1026
  "operation": "create",
1050
- "objectName": "@happyvertical/smrt-social:SocialPost",
1051
- "path": "/socialposts",
1027
+ "objectName": "@happyvertical/smrt-social:SocialAccount",
1028
+ "path": "/socialaccounts",
1052
1029
  "method": "POST"
1053
1030
  },
1054
1031
  {
1055
1032
  "kind": "api",
1056
- "name": "socialposts.update",
1033
+ "name": "socialaccounts.update",
1057
1034
  "operation": "update",
1058
- "objectName": "@happyvertical/smrt-social:SocialPost",
1059
- "path": "/socialposts/[id]",
1035
+ "objectName": "@happyvertical/smrt-social:SocialAccount",
1036
+ "path": "/socialaccounts/[id]",
1060
1037
  "method": "PATCH"
1061
1038
  },
1062
1039
  {
1063
1040
  "kind": "api",
1064
- "name": "socialposts.delete",
1041
+ "name": "socialaccounts.delete",
1065
1042
  "operation": "delete",
1066
- "objectName": "@happyvertical/smrt-social:SocialPost",
1067
- "path": "/socialposts/[id]",
1043
+ "objectName": "@happyvertical/smrt-social:SocialAccount",
1044
+ "path": "/socialaccounts/[id]",
1068
1045
  "method": "DELETE"
1069
1046
  },
1070
1047
  {
1071
1048
  "kind": "cli",
1072
- "name": "socialpost_list",
1049
+ "name": "socialaccount_list",
1073
1050
  "operation": "list",
1074
- "objectName": "@happyvertical/smrt-social:SocialPost"
1051
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1075
1052
  },
1076
1053
  {
1077
1054
  "kind": "cli",
1078
- "name": "socialpost_get",
1055
+ "name": "socialaccount_get",
1079
1056
  "operation": "get",
1080
- "objectName": "@happyvertical/smrt-social:SocialPost"
1057
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1081
1058
  },
1082
1059
  {
1083
1060
  "kind": "cli",
1084
- "name": "socialpost_create",
1061
+ "name": "socialaccount_create",
1085
1062
  "operation": "create",
1086
- "objectName": "@happyvertical/smrt-social:SocialPost"
1063
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1087
1064
  },
1088
1065
  {
1089
1066
  "kind": "cli",
1090
- "name": "socialpost_update",
1067
+ "name": "socialaccount_update",
1091
1068
  "operation": "update",
1092
- "objectName": "@happyvertical/smrt-social:SocialPost"
1069
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1093
1070
  },
1094
1071
  {
1095
1072
  "kind": "cli",
1096
- "name": "socialpost_delete",
1073
+ "name": "socialaccount_delete",
1097
1074
  "operation": "delete",
1098
- "objectName": "@happyvertical/smrt-social:SocialPost"
1075
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1076
+ },
1077
+ {
1078
+ "kind": "cli",
1079
+ "name": "socialaccount_setCredentials",
1080
+ "operation": "setCredentials",
1081
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1082
+ },
1083
+ {
1084
+ "kind": "cli",
1085
+ "name": "socialaccount_getCredentials",
1086
+ "operation": "getCredentials",
1087
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1099
1088
  },
1100
1089
  {
1101
1090
  "kind": "mcp",
1102
- "name": "socialpost_list",
1091
+ "name": "socialaccount_list",
1103
1092
  "operation": "list",
1104
- "objectName": "@happyvertical/smrt-social:SocialPost"
1093
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1105
1094
  },
1106
1095
  {
1107
1096
  "kind": "mcp",
1108
- "name": "socialpost_get",
1097
+ "name": "socialaccount_get",
1109
1098
  "operation": "get",
1110
- "objectName": "@happyvertical/smrt-social:SocialPost"
1099
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1100
+ }
1101
+ ],
1102
+ "withheldSurfaces": [
1103
+ {
1104
+ "kind": "api",
1105
+ "operation": "getCredentials",
1106
+ "code": "not-included",
1107
+ "reason": "not listed in api.include",
1108
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1109
+ },
1110
+ {
1111
+ "kind": "api",
1112
+ "operation": "getSlug",
1113
+ "code": "lifecycle-method",
1114
+ "reason": "`getSlug` is a framework lifecycle method, not a distinct operation",
1115
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1116
+ },
1117
+ {
1118
+ "kind": "api",
1119
+ "operation": "setCredentials",
1120
+ "code": "not-included",
1121
+ "reason": "not listed in api.include",
1122
+ "objectName": "@happyvertical/smrt-social:SocialAccount"
1111
1123
  }
1112
1124
  ],
1113
1125
  "relationshipFeatures": [
1114
- "crossPackageRef",
1115
- "foreignKey",
1116
1126
  "uuidColumns"
1117
1127
  ],
1118
1128
  "tags": [],
1119
1129
  "risks": []
1120
1130
  },
1121
1131
  {
1122
- "name": "OAuthStateCollection",
1123
- "qualifiedName": "@happyvertical/smrt-social:OAuthStateCollection",
1124
- "collection": "oauthstates",
1125
- "tableName": "oauth_states",
1132
+ "name": "SocialPostAnalyticsSnapshot",
1133
+ "qualifiedName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
1134
+ "collection": "socialpostanalyticssnapshots",
1135
+ "tableName": "social_post_analytics_snapshots",
1126
1136
  "packageName": "@happyvertical/smrt-social",
1127
- "extends": "SmrtCollection",
1128
- "fields": [],
1129
- "relationships": [],
1130
- "methods": [
1131
- "consume",
1132
- "deleteExpired",
1133
- "findByState",
1134
- "findExpired"
1137
+ "extends": "SmrtObject",
1138
+ "fields": [
1139
+ {
1140
+ "name": "created_at",
1141
+ "type": "datetime",
1142
+ "required": false,
1143
+ "columnType": "TIMESTAMP"
1144
+ },
1145
+ {
1146
+ "name": "updated_at",
1147
+ "type": "datetime",
1148
+ "required": false,
1149
+ "columnType": "TIMESTAMP"
1150
+ },
1151
+ {
1152
+ "name": "tenantId",
1153
+ "type": "text",
1154
+ "required": false,
1155
+ "columnType": "UUID"
1156
+ },
1157
+ {
1158
+ "name": "socialPostId",
1159
+ "type": "foreignKey",
1160
+ "required": false,
1161
+ "related": "SocialPost",
1162
+ "columnType": "UUID",
1163
+ "description": "The post these numbers are for."
1164
+ },
1165
+ {
1166
+ "name": "platform",
1167
+ "type": "text",
1168
+ "required": true,
1169
+ "columnType": "TEXT",
1170
+ "description": "The platform that reported the numbers."
1171
+ },
1172
+ {
1173
+ "name": "analytics",
1174
+ "type": "json",
1175
+ "required": false,
1176
+ "columnType": "JSON",
1177
+ "description": "The views, likes, comments, shares and clicks the platform reported."
1178
+ },
1179
+ {
1180
+ "name": "raw",
1181
+ "type": "json",
1182
+ "required": false,
1183
+ "columnType": "JSON"
1184
+ },
1185
+ {
1186
+ "name": "capturedAt",
1187
+ "type": "datetime",
1188
+ "required": false,
1189
+ "columnType": "TIMESTAMP",
1190
+ "description": "When these numbers were taken from the platform."
1191
+ }
1135
1192
  ],
1136
- "methodSignatures": [
1193
+ "relationships": [
1137
1194
  {
1138
- "name": "consume",
1139
- "async": true,
1140
- "params": [
1141
- "state: OAuthState"
1142
- ],
1143
- "returns": "Promise<boolean>"
1195
+ "name": "socialPostId",
1196
+ "type": "foreignKey",
1197
+ "required": false,
1198
+ "related": "SocialPost",
1199
+ "columnType": "UUID"
1200
+ }
1201
+ ],
1202
+ "methods": [],
1203
+ "tenant": {
1204
+ "scoped": true,
1205
+ "mode": "optional",
1206
+ "field": "tenantId"
1207
+ },
1208
+ "tableStrategy": "sti",
1209
+ "conflictColumns": [
1210
+ "tenant_id",
1211
+ "slug",
1212
+ "context",
1213
+ "_meta_type"
1214
+ ],
1215
+ "surfaces": [
1216
+ {
1217
+ "kind": "api",
1218
+ "name": "socialpostanalyticssnapshots.list",
1219
+ "operation": "list",
1220
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
1221
+ "path": "/socialpostanalyticssnapshots",
1222
+ "method": "GET"
1144
1223
  },
1145
1224
  {
1146
- "name": "deleteExpired",
1147
- "async": true,
1148
- "params": [
1149
- "now?: Date"
1150
- ],
1151
- "returns": "Promise<number>"
1225
+ "kind": "api",
1226
+ "name": "socialpostanalyticssnapshots.get",
1227
+ "operation": "get",
1228
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
1229
+ "path": "/socialpostanalyticssnapshots/[id]",
1230
+ "method": "GET"
1152
1231
  },
1153
1232
  {
1154
- "name": "findByState",
1155
- "async": true,
1156
- "params": [
1157
- "state: string"
1158
- ],
1159
- "returns": "Promise<OAuthState | null>"
1233
+ "kind": "api",
1234
+ "name": "socialpostanalyticssnapshots.create",
1235
+ "operation": "create",
1236
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
1237
+ "path": "/socialpostanalyticssnapshots",
1238
+ "method": "POST"
1239
+ },
1240
+ {
1241
+ "kind": "api",
1242
+ "name": "socialpostanalyticssnapshots.delete",
1243
+ "operation": "delete",
1244
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot",
1245
+ "path": "/socialpostanalyticssnapshots/[id]",
1246
+ "method": "DELETE"
1160
1247
  },
1161
- {
1162
- "name": "findExpired",
1163
- "async": true,
1164
- "params": [
1165
- "now?: Date"
1166
- ],
1167
- "returns": "Promise<OAuthState[]>"
1168
- }
1169
- ],
1170
- "surfaces": [
1171
1248
  {
1172
1249
  "kind": "cli",
1173
- "name": "oauthstatecollection_findByState",
1174
- "operation": "findByState",
1175
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1250
+ "name": "socialpostanalyticssnapshot_list",
1251
+ "operation": "list",
1252
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
1176
1253
  },
1177
1254
  {
1178
1255
  "kind": "cli",
1179
- "name": "oauthstatecollection_consume",
1180
- "operation": "consume",
1181
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1256
+ "name": "socialpostanalyticssnapshot_get",
1257
+ "operation": "get",
1258
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
1182
1259
  },
1183
1260
  {
1184
1261
  "kind": "cli",
1185
- "name": "oauthstatecollection_findExpired",
1186
- "operation": "findExpired",
1187
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1262
+ "name": "socialpostanalyticssnapshot_create",
1263
+ "operation": "create",
1264
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
1188
1265
  },
1189
1266
  {
1190
1267
  "kind": "cli",
1191
- "name": "oauthstatecollection_deleteExpired",
1192
- "operation": "deleteExpired",
1193
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1194
- }
1195
- ],
1196
- "withheldSurfaces": [
1197
- {
1198
- "kind": "api",
1199
- "operation": "consume",
1200
- "code": "not-included",
1201
- "reason": "not listed in api.include",
1202
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1268
+ "name": "socialpostanalyticssnapshot_update",
1269
+ "operation": "update",
1270
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
1203
1271
  },
1204
1272
  {
1205
- "kind": "api",
1206
- "operation": "deleteExpired",
1207
- "code": "not-included",
1208
- "reason": "not listed in api.include",
1209
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1273
+ "kind": "cli",
1274
+ "name": "socialpostanalyticssnapshot_delete",
1275
+ "operation": "delete",
1276
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
1210
1277
  },
1211
1278
  {
1212
- "kind": "api",
1213
- "operation": "findByState",
1214
- "code": "not-included",
1215
- "reason": "not listed in api.include",
1216
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1279
+ "kind": "mcp",
1280
+ "name": "socialpostanalyticssnapshot_list",
1281
+ "operation": "list",
1282
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
1217
1283
  },
1218
1284
  {
1219
- "kind": "api",
1220
- "operation": "findExpired",
1221
- "code": "not-included",
1222
- "reason": "not listed in api.include",
1223
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1285
+ "kind": "mcp",
1286
+ "name": "socialpostanalyticssnapshot_get",
1287
+ "operation": "get",
1288
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshot"
1224
1289
  }
1225
1290
  ],
1226
1291
  "relationshipFeatures": [
1292
+ "foreignKey",
1227
1293
  "uuidColumns"
1228
1294
  ],
1229
1295
  "tags": [],
1230
1296
  "risks": []
1231
1297
  },
1232
1298
  {
1233
- "name": "SocialAccountCollection",
1234
- "qualifiedName": "@happyvertical/smrt-social:SocialAccountCollection",
1235
- "collection": "socialaccounts",
1236
- "tableName": "social_accounts",
1299
+ "name": "SocialPost",
1300
+ "qualifiedName": "@happyvertical/smrt-social:SocialPost",
1301
+ "displayLabelField": "title",
1302
+ "collection": "socialposts",
1303
+ "description": "Social media post for multi-platform publishing",
1304
+ "tableName": "social_posts",
1237
1305
  "packageName": "@happyvertical/smrt-social",
1238
- "extends": "SmrtCollection",
1239
- "fields": [],
1240
- "relationships": [],
1241
- "methods": [
1242
- "findActive",
1243
- "findNeedsAttention",
1244
- "findReady"
1245
- ],
1246
- "methodSignatures": [
1306
+ "extends": "SmrtObject",
1307
+ "fields": [
1247
1308
  {
1248
- "name": "findActive",
1249
- "async": true,
1250
- "params": [
1251
- "platform?: SocialPlatformType"
1252
- ],
1253
- "returns": "Promise<SocialAccount[]>"
1309
+ "name": "created_at",
1310
+ "type": "datetime",
1311
+ "required": false,
1312
+ "columnType": "TIMESTAMP"
1254
1313
  },
1255
1314
  {
1256
- "name": "findNeedsAttention",
1257
- "async": true,
1258
- "returns": "Promise<SocialAccount[]>"
1315
+ "name": "updated_at",
1316
+ "type": "datetime",
1317
+ "required": false,
1318
+ "columnType": "TIMESTAMP"
1259
1319
  },
1260
1320
  {
1261
- "name": "findReady",
1262
- "async": true,
1263
- "params": [
1264
- "platform?: SocialPlatformType"
1265
- ],
1266
- "returns": "Promise<SocialAccount[]>"
1267
- }
1268
- ],
1269
- "surfaces": [
1270
- {
1271
- "kind": "cli",
1272
- "name": "socialaccountcollection_findActive",
1273
- "operation": "findActive",
1274
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1321
+ "name": "tenantId",
1322
+ "type": "text",
1323
+ "required": false,
1324
+ "columnType": "UUID"
1275
1325
  },
1276
1326
  {
1277
- "kind": "cli",
1278
- "name": "socialaccountcollection_findReady",
1279
- "operation": "findReady",
1280
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1327
+ "name": "socialAccountId",
1328
+ "type": "foreignKey",
1329
+ "required": false,
1330
+ "related": "SocialAccount",
1331
+ "columnType": "UUID",
1332
+ "description": "The connected account this post goes out from."
1281
1333
  },
1282
1334
  {
1283
- "kind": "cli",
1284
- "name": "socialaccountcollection_findNeedsAttention",
1285
- "operation": "findNeedsAttention",
1286
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1287
- }
1288
- ],
1289
- "withheldSurfaces": [
1290
- {
1291
- "kind": "api",
1292
- "operation": "findActive",
1293
- "code": "not-included",
1294
- "reason": "not listed in api.include",
1295
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1335
+ "name": "createdByUserId",
1336
+ "type": "crossPackageRef",
1337
+ "required": false,
1338
+ "related": "@happyvertical/smrt-users:User",
1339
+ "columnType": "UUID"
1296
1340
  },
1297
1341
  {
1298
- "kind": "api",
1299
- "operation": "findNeedsAttention",
1300
- "code": "not-included",
1301
- "reason": "not listed in api.include",
1302
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1342
+ "name": "videoContentId",
1343
+ "type": "crossPackageRef",
1344
+ "required": false,
1345
+ "related": "@happyvertical/smrt-video:VideoContent",
1346
+ "columnType": "UUID"
1303
1347
  },
1304
1348
  {
1305
- "kind": "api",
1306
- "operation": "findReady",
1307
- "code": "not-included",
1308
- "reason": "not listed in api.include",
1309
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1310
- }
1311
- ],
1312
- "relationshipFeatures": [
1313
- "uuidColumns"
1314
- ],
1315
- "tags": [],
1316
- "risks": []
1317
- },
1318
- {
1319
- "name": "SocialPostAnalyticsSnapshotCollection",
1320
- "qualifiedName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection",
1321
- "collection": "socialpostanalyticssnapshots",
1322
- "tableName": "social_post_analytics_snapshots",
1323
- "packageName": "@happyvertical/smrt-social",
1324
- "extends": "SmrtCollection",
1325
- "fields": [],
1326
- "relationships": [],
1327
- "methods": [
1328
- "findForPost",
1329
- "findLatestForPost",
1330
- "recordSnapshot"
1331
- ],
1332
- "methodSignatures": [
1333
- {
1334
- "name": "findForPost",
1335
- "async": true,
1336
- "params": [
1337
- "socialPostId: string"
1338
- ],
1339
- "returns": "Promise<SocialPostAnalyticsSnapshot[]>"
1349
+ "name": "contentId",
1350
+ "type": "crossPackageRef",
1351
+ "required": false,
1352
+ "related": "@happyvertical/smrt-content:Content",
1353
+ "columnType": "UUID"
1340
1354
  },
1341
1355
  {
1342
- "name": "findLatestForPost",
1343
- "async": true,
1344
- "params": [
1345
- "socialPostId: string"
1346
- ],
1347
- "returns": "Promise<SocialPostAnalyticsSnapshot | null>"
1356
+ "name": "postType",
1357
+ "type": "text",
1358
+ "required": false,
1359
+ "columnType": "TEXT",
1360
+ "default": "text",
1361
+ "description": "What kind of post it is: text, link, image or video."
1348
1362
  },
1349
1363
  {
1350
- "name": "recordSnapshot",
1351
- "async": true,
1352
- "params": [
1353
- "options: object"
1354
- ],
1355
- "returns": "Promise<SocialPostAnalyticsSnapshot>"
1356
- }
1357
- ],
1358
- "surfaces": [
1359
- {
1360
- "kind": "cli",
1361
- "name": "socialpostanalyticssnapshotcollection_recordSnapshot",
1362
- "operation": "recordSnapshot",
1363
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1364
+ "name": "mediaUrl",
1365
+ "type": "text",
1366
+ "required": false,
1367
+ "columnType": "TEXT"
1364
1368
  },
1365
1369
  {
1366
- "kind": "cli",
1367
- "name": "socialpostanalyticssnapshotcollection_findForPost",
1368
- "operation": "findForPost",
1369
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1370
+ "name": "title",
1371
+ "type": "text",
1372
+ "required": false,
1373
+ "columnType": "TEXT",
1374
+ "description": "A title, for platforms that show one."
1370
1375
  },
1371
1376
  {
1372
- "kind": "cli",
1373
- "name": "socialpostanalyticssnapshotcollection_findLatestForPost",
1374
- "operation": "findLatestForPost",
1375
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1376
- }
1377
- ],
1378
- "withheldSurfaces": [
1377
+ "name": "description",
1378
+ "type": "text",
1379
+ "required": false,
1380
+ "columnType": "TEXT",
1381
+ "default": "",
1382
+ "description": "The words of the post."
1383
+ },
1379
1384
  {
1380
- "kind": "api",
1381
- "operation": "findForPost",
1382
- "code": "not-included",
1383
- "reason": "not listed in api.include",
1384
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1385
+ "name": "hashtags",
1386
+ "type": "json",
1387
+ "required": false,
1388
+ "columnType": "JSON",
1389
+ "default": [],
1390
+ "description": "Hashtags added to the end of the post."
1385
1391
  },
1386
1392
  {
1387
- "kind": "api",
1388
- "operation": "findLatestForPost",
1389
- "code": "not-included",
1390
- "reason": "not listed in api.include",
1391
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1393
+ "name": "linkUrl",
1394
+ "type": "text",
1395
+ "required": false,
1396
+ "columnType": "TEXT",
1397
+ "description": "A web address to share with the post."
1392
1398
  },
1393
1399
  {
1394
- "kind": "api",
1395
- "operation": "recordSnapshot",
1396
- "code": "not-included",
1397
- "reason": "not listed in api.include",
1398
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1399
- }
1400
- ],
1401
- "relationshipFeatures": [
1402
- "uuidColumns"
1403
- ],
1404
- "tags": [],
1405
- "risks": []
1406
- },
1407
- {
1408
- "name": "SocialPostCollection",
1409
- "qualifiedName": "@happyvertical/smrt-social:SocialPostCollection",
1410
- "collection": "socialposts",
1411
- "tableName": "social_posts",
1412
- "packageName": "@happyvertical/smrt-social",
1413
- "extends": "SmrtCollection",
1414
- "fields": [],
1415
- "relationships": [],
1416
- "methods": [
1417
- "createDraft",
1418
- "findByStatus",
1419
- "findDueForPublish",
1420
- "findForAccount",
1421
- "recordPublishFailure",
1422
- "recordPublishSuccess",
1423
- "updateLatestAnalytics"
1424
- ],
1425
- "methodSignatures": [
1400
+ "name": "platformPostId",
1401
+ "type": "text",
1402
+ "required": false,
1403
+ "columnType": "TEXT"
1404
+ },
1426
1405
  {
1427
- "name": "createDraft",
1428
- "async": true,
1429
- "params": [
1430
- "options: CreateSocialPostDraftOptions"
1431
- ],
1432
- "returns": "Promise<SocialPost>"
1406
+ "name": "platformUrl",
1407
+ "type": "text",
1408
+ "required": false,
1409
+ "columnType": "TEXT",
1410
+ "description": "Where the post can be seen on the platform, once it is out."
1433
1411
  },
1434
1412
  {
1435
- "name": "findByStatus",
1436
- "async": true,
1437
- "params": [
1438
- "status: PostStatus"
1439
- ],
1440
- "returns": "Promise<SocialPost[]>"
1413
+ "name": "scheduledAt",
1414
+ "type": "datetime",
1415
+ "required": false,
1416
+ "columnType": "TIMESTAMP",
1417
+ "description": "The date and time you have in mind for putting the post out. Only a note of the plan: publishing is a separate step your application has to run."
1441
1418
  },
1442
1419
  {
1443
- "name": "findDueForPublish",
1444
- "async": true,
1445
- "params": [
1446
- "now?: Date"
1447
- ],
1448
- "returns": "Promise<SocialPost[]>"
1420
+ "name": "publishedAt",
1421
+ "type": "datetime",
1422
+ "required": false,
1423
+ "columnType": "TIMESTAMP",
1424
+ "description": "When the post actually went out."
1449
1425
  },
1450
1426
  {
1451
- "name": "findForAccount",
1452
- "async": true,
1453
- "params": [
1454
- "socialAccountId: string"
1455
- ],
1456
- "returns": "Promise<SocialPost[]>"
1427
+ "name": "status",
1428
+ "type": "text",
1429
+ "required": false,
1430
+ "columnType": "TEXT",
1431
+ "default": "draft",
1432
+ "description": "Where the post stands: draft, waiting to go out, published or failed."
1457
1433
  },
1458
1434
  {
1459
- "name": "recordPublishFailure",
1460
- "async": true,
1461
- "params": [
1462
- "post: SocialPost",
1463
- "error: Error | string"
1464
- ],
1465
- "returns": "Promise<SocialPost>"
1435
+ "name": "errorMessage",
1436
+ "type": "text",
1437
+ "required": false,
1438
+ "columnType": "TEXT"
1466
1439
  },
1467
1440
  {
1468
- "name": "recordPublishSuccess",
1469
- "async": true,
1470
- "params": [
1471
- "post: SocialPost",
1472
- "data: PublishSuccessData"
1473
- ],
1474
- "returns": "Promise<SocialPost>"
1441
+ "name": "analytics",
1442
+ "type": "json",
1443
+ "required": false,
1444
+ "columnType": "JSON"
1475
1445
  },
1476
1446
  {
1477
- "name": "updateLatestAnalytics",
1478
- "async": true,
1479
- "params": [
1480
- "post: SocialPost",
1481
- "analytics: PostAnalytics",
1482
- "syncedAt?: Date"
1483
- ],
1484
- "returns": "Promise<SocialPost>"
1447
+ "name": "analyticsLastSyncedAt",
1448
+ "type": "datetime",
1449
+ "required": false,
1450
+ "columnType": "TIMESTAMP"
1485
1451
  }
1486
1452
  ],
1487
- "surfaces": [
1453
+ "relationships": [
1488
1454
  {
1489
- "kind": "cli",
1490
- "name": "socialpostcollection_createDraft",
1491
- "operation": "createDraft",
1492
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1455
+ "name": "socialAccountId",
1456
+ "type": "foreignKey",
1457
+ "required": false,
1458
+ "related": "SocialAccount",
1459
+ "columnType": "UUID"
1493
1460
  },
1494
1461
  {
1495
- "kind": "cli",
1496
- "name": "socialpostcollection_findByStatus",
1497
- "operation": "findByStatus",
1498
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1462
+ "name": "createdByUserId",
1463
+ "type": "crossPackageRef",
1464
+ "required": false,
1465
+ "related": "@happyvertical/smrt-users:User",
1466
+ "columnType": "UUID"
1499
1467
  },
1500
1468
  {
1501
- "kind": "cli",
1502
- "name": "socialpostcollection_findForAccount",
1503
- "operation": "findForAccount",
1504
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1469
+ "name": "videoContentId",
1470
+ "type": "crossPackageRef",
1471
+ "required": false,
1472
+ "related": "@happyvertical/smrt-video:VideoContent",
1473
+ "columnType": "UUID"
1505
1474
  },
1506
1475
  {
1507
- "kind": "cli",
1508
- "name": "socialpostcollection_findDueForPublish",
1509
- "operation": "findDueForPublish",
1510
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1511
- },
1476
+ "name": "contentId",
1477
+ "type": "crossPackageRef",
1478
+ "required": false,
1479
+ "related": "@happyvertical/smrt-content:Content",
1480
+ "columnType": "UUID"
1481
+ }
1482
+ ],
1483
+ "methods": [],
1484
+ "tenant": {
1485
+ "scoped": true,
1486
+ "mode": "optional",
1487
+ "field": "tenantId"
1488
+ },
1489
+ "tableStrategy": "sti",
1490
+ "conflictColumns": [
1491
+ "tenant_id",
1492
+ "slug",
1493
+ "context",
1494
+ "_meta_type"
1495
+ ],
1496
+ "surfaces": [
1512
1497
  {
1513
- "kind": "cli",
1514
- "name": "socialpostcollection_recordPublishSuccess",
1515
- "operation": "recordPublishSuccess",
1516
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1498
+ "kind": "api",
1499
+ "name": "socialposts.list",
1500
+ "operation": "list",
1501
+ "objectName": "@happyvertical/smrt-social:SocialPost",
1502
+ "path": "/socialposts",
1503
+ "method": "GET"
1517
1504
  },
1518
1505
  {
1519
- "kind": "cli",
1520
- "name": "socialpostcollection_recordPublishFailure",
1521
- "operation": "recordPublishFailure",
1522
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1506
+ "kind": "api",
1507
+ "name": "socialposts.get",
1508
+ "operation": "get",
1509
+ "objectName": "@happyvertical/smrt-social:SocialPost",
1510
+ "path": "/socialposts/[id]",
1511
+ "method": "GET"
1523
1512
  },
1524
1513
  {
1525
- "kind": "cli",
1526
- "name": "socialpostcollection_updateLatestAnalytics",
1527
- "operation": "updateLatestAnalytics",
1528
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1529
- }
1530
- ],
1531
- "withheldSurfaces": [
1514
+ "kind": "api",
1515
+ "name": "socialposts.create",
1516
+ "operation": "create",
1517
+ "objectName": "@happyvertical/smrt-social:SocialPost",
1518
+ "path": "/socialposts",
1519
+ "method": "POST"
1520
+ },
1532
1521
  {
1533
1522
  "kind": "api",
1534
- "operation": "createDraft",
1535
- "code": "not-included",
1536
- "reason": "not listed in api.include",
1537
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1523
+ "name": "socialposts.update",
1524
+ "operation": "update",
1525
+ "objectName": "@happyvertical/smrt-social:SocialPost",
1526
+ "path": "/socialposts/[id]",
1527
+ "method": "PATCH"
1538
1528
  },
1539
1529
  {
1540
1530
  "kind": "api",
1541
- "operation": "findByStatus",
1542
- "code": "not-included",
1543
- "reason": "not listed in api.include",
1544
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1531
+ "name": "socialposts.delete",
1532
+ "operation": "delete",
1533
+ "objectName": "@happyvertical/smrt-social:SocialPost",
1534
+ "path": "/socialposts/[id]",
1535
+ "method": "DELETE"
1536
+ },
1537
+ {
1538
+ "kind": "cli",
1539
+ "name": "socialpost_list",
1540
+ "operation": "list",
1541
+ "objectName": "@happyvertical/smrt-social:SocialPost"
1542
+ },
1543
+ {
1544
+ "kind": "cli",
1545
+ "name": "socialpost_get",
1546
+ "operation": "get",
1547
+ "objectName": "@happyvertical/smrt-social:SocialPost"
1545
1548
  },
1546
1549
  {
1547
- "kind": "api",
1548
- "operation": "findDueForPublish",
1549
- "code": "not-included",
1550
- "reason": "not listed in api.include",
1551
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1550
+ "kind": "cli",
1551
+ "name": "socialpost_create",
1552
+ "operation": "create",
1553
+ "objectName": "@happyvertical/smrt-social:SocialPost"
1552
1554
  },
1553
1555
  {
1554
- "kind": "api",
1555
- "operation": "findForAccount",
1556
- "code": "not-included",
1557
- "reason": "not listed in api.include",
1558
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1556
+ "kind": "cli",
1557
+ "name": "socialpost_update",
1558
+ "operation": "update",
1559
+ "objectName": "@happyvertical/smrt-social:SocialPost"
1559
1560
  },
1560
1561
  {
1561
- "kind": "api",
1562
- "operation": "recordPublishFailure",
1563
- "code": "not-included",
1564
- "reason": "not listed in api.include",
1565
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1562
+ "kind": "cli",
1563
+ "name": "socialpost_delete",
1564
+ "operation": "delete",
1565
+ "objectName": "@happyvertical/smrt-social:SocialPost"
1566
1566
  },
1567
1567
  {
1568
- "kind": "api",
1569
- "operation": "recordPublishSuccess",
1570
- "code": "not-included",
1571
- "reason": "not listed in api.include",
1572
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1568
+ "kind": "mcp",
1569
+ "name": "socialpost_list",
1570
+ "operation": "list",
1571
+ "objectName": "@happyvertical/smrt-social:SocialPost"
1573
1572
  },
1574
1573
  {
1575
- "kind": "api",
1576
- "operation": "updateLatestAnalytics",
1577
- "code": "not-included",
1578
- "reason": "not listed in api.include",
1579
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1574
+ "kind": "mcp",
1575
+ "name": "socialpost_get",
1576
+ "operation": "get",
1577
+ "objectName": "@happyvertical/smrt-social:SocialPost"
1580
1578
  }
1581
1579
  ],
1582
1580
  "relationshipFeatures": [
1581
+ "crossPackageRef",
1582
+ "foreignKey",
1583
1583
  "uuidColumns"
1584
1584
  ],
1585
1585
  "tags": [],
@@ -1587,6 +1587,108 @@
1587
1587
  }
1588
1588
  ],
1589
1589
  "surfaces": [
1590
+ {
1591
+ "kind": "cli",
1592
+ "name": "oauthstatecollection_findByState",
1593
+ "operation": "findByState",
1594
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1595
+ },
1596
+ {
1597
+ "kind": "cli",
1598
+ "name": "oauthstatecollection_consume",
1599
+ "operation": "consume",
1600
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1601
+ },
1602
+ {
1603
+ "kind": "cli",
1604
+ "name": "oauthstatecollection_findExpired",
1605
+ "operation": "findExpired",
1606
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1607
+ },
1608
+ {
1609
+ "kind": "cli",
1610
+ "name": "oauthstatecollection_deleteExpired",
1611
+ "operation": "deleteExpired",
1612
+ "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1613
+ },
1614
+ {
1615
+ "kind": "cli",
1616
+ "name": "socialaccountcollection_findActive",
1617
+ "operation": "findActive",
1618
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1619
+ },
1620
+ {
1621
+ "kind": "cli",
1622
+ "name": "socialaccountcollection_findReady",
1623
+ "operation": "findReady",
1624
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1625
+ },
1626
+ {
1627
+ "kind": "cli",
1628
+ "name": "socialaccountcollection_findNeedsAttention",
1629
+ "operation": "findNeedsAttention",
1630
+ "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1631
+ },
1632
+ {
1633
+ "kind": "cli",
1634
+ "name": "socialpostanalyticssnapshotcollection_recordSnapshot",
1635
+ "operation": "recordSnapshot",
1636
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1637
+ },
1638
+ {
1639
+ "kind": "cli",
1640
+ "name": "socialpostanalyticssnapshotcollection_findForPost",
1641
+ "operation": "findForPost",
1642
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1643
+ },
1644
+ {
1645
+ "kind": "cli",
1646
+ "name": "socialpostanalyticssnapshotcollection_findLatestForPost",
1647
+ "operation": "findLatestForPost",
1648
+ "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1649
+ },
1650
+ {
1651
+ "kind": "cli",
1652
+ "name": "socialpostcollection_createDraft",
1653
+ "operation": "createDraft",
1654
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1655
+ },
1656
+ {
1657
+ "kind": "cli",
1658
+ "name": "socialpostcollection_findByStatus",
1659
+ "operation": "findByStatus",
1660
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1661
+ },
1662
+ {
1663
+ "kind": "cli",
1664
+ "name": "socialpostcollection_findForAccount",
1665
+ "operation": "findForAccount",
1666
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1667
+ },
1668
+ {
1669
+ "kind": "cli",
1670
+ "name": "socialpostcollection_findDueForPublish",
1671
+ "operation": "findDueForPublish",
1672
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1673
+ },
1674
+ {
1675
+ "kind": "cli",
1676
+ "name": "socialpostcollection_recordPublishSuccess",
1677
+ "operation": "recordPublishSuccess",
1678
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1679
+ },
1680
+ {
1681
+ "kind": "cli",
1682
+ "name": "socialpostcollection_recordPublishFailure",
1683
+ "operation": "recordPublishFailure",
1684
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1685
+ },
1686
+ {
1687
+ "kind": "cli",
1688
+ "name": "socialpostcollection_updateLatestAnalytics",
1689
+ "operation": "updateLatestAnalytics",
1690
+ "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1691
+ },
1590
1692
  {
1591
1693
  "kind": "api",
1592
1694
  "name": "oauthstates.list",
@@ -1922,108 +2024,6 @@
1922
2024
  "name": "socialpost_get",
1923
2025
  "operation": "get",
1924
2026
  "objectName": "@happyvertical/smrt-social:SocialPost"
1925
- },
1926
- {
1927
- "kind": "cli",
1928
- "name": "oauthstatecollection_findByState",
1929
- "operation": "findByState",
1930
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1931
- },
1932
- {
1933
- "kind": "cli",
1934
- "name": "oauthstatecollection_consume",
1935
- "operation": "consume",
1936
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1937
- },
1938
- {
1939
- "kind": "cli",
1940
- "name": "oauthstatecollection_findExpired",
1941
- "operation": "findExpired",
1942
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1943
- },
1944
- {
1945
- "kind": "cli",
1946
- "name": "oauthstatecollection_deleteExpired",
1947
- "operation": "deleteExpired",
1948
- "objectName": "@happyvertical/smrt-social:OAuthStateCollection"
1949
- },
1950
- {
1951
- "kind": "cli",
1952
- "name": "socialaccountcollection_findActive",
1953
- "operation": "findActive",
1954
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1955
- },
1956
- {
1957
- "kind": "cli",
1958
- "name": "socialaccountcollection_findReady",
1959
- "operation": "findReady",
1960
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1961
- },
1962
- {
1963
- "kind": "cli",
1964
- "name": "socialaccountcollection_findNeedsAttention",
1965
- "operation": "findNeedsAttention",
1966
- "objectName": "@happyvertical/smrt-social:SocialAccountCollection"
1967
- },
1968
- {
1969
- "kind": "cli",
1970
- "name": "socialpostanalyticssnapshotcollection_recordSnapshot",
1971
- "operation": "recordSnapshot",
1972
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1973
- },
1974
- {
1975
- "kind": "cli",
1976
- "name": "socialpostanalyticssnapshotcollection_findForPost",
1977
- "operation": "findForPost",
1978
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1979
- },
1980
- {
1981
- "kind": "cli",
1982
- "name": "socialpostanalyticssnapshotcollection_findLatestForPost",
1983
- "operation": "findLatestForPost",
1984
- "objectName": "@happyvertical/smrt-social:SocialPostAnalyticsSnapshotCollection"
1985
- },
1986
- {
1987
- "kind": "cli",
1988
- "name": "socialpostcollection_createDraft",
1989
- "operation": "createDraft",
1990
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1991
- },
1992
- {
1993
- "kind": "cli",
1994
- "name": "socialpostcollection_findByStatus",
1995
- "operation": "findByStatus",
1996
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
1997
- },
1998
- {
1999
- "kind": "cli",
2000
- "name": "socialpostcollection_findForAccount",
2001
- "operation": "findForAccount",
2002
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
2003
- },
2004
- {
2005
- "kind": "cli",
2006
- "name": "socialpostcollection_findDueForPublish",
2007
- "operation": "findDueForPublish",
2008
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
2009
- },
2010
- {
2011
- "kind": "cli",
2012
- "name": "socialpostcollection_recordPublishSuccess",
2013
- "operation": "recordPublishSuccess",
2014
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
2015
- },
2016
- {
2017
- "kind": "cli",
2018
- "name": "socialpostcollection_recordPublishFailure",
2019
- "operation": "recordPublishFailure",
2020
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
2021
- },
2022
- {
2023
- "kind": "cli",
2024
- "name": "socialpostcollection_updateLatestAnalytics",
2025
- "operation": "updateLatestAnalytics",
2026
- "objectName": "@happyvertical/smrt-social:SocialPostCollection"
2027
2027
  }
2028
2028
  ],
2029
2029
  "prompts": [],