@molecule/api-resource-follow 1.1.2 → 1.1.3
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/README.md +17 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-19T03:20:25.163Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-resource-follow
|
|
@@ -30,6 +30,22 @@ and `targetId`. For users, `targetId` is the canonical user id, never the userna
|
|
|
30
30
|
A genuinely different relationship schema stays local; these calls do not read a
|
|
31
31
|
custom `followingId` column or a separate table.
|
|
32
32
|
|
|
33
|
+
```typescript
|
|
34
|
+
import { getFollowedIds } from '@molecule/api-resource-follow'
|
|
35
|
+
|
|
36
|
+
export async function projectWatchedNotes(
|
|
37
|
+
notes: readonly { id: string; title: string }[],
|
|
38
|
+
viewerId?: string | null,
|
|
39
|
+
) {
|
|
40
|
+
const followed = await getFollowedIds(
|
|
41
|
+
viewerId,
|
|
42
|
+
'note',
|
|
43
|
+
notes.map(({ id }) => id),
|
|
44
|
+
)
|
|
45
|
+
return notes.map((note) => ({ ...note, watching: followed.has(note.id) }))
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
33
49
|
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
34
50
|
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
35
51
|
> package's source — edit `src/index.ts` JSDoc, not this file.
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,18 @@
|
|
|
21
21
|
* A genuinely different relationship schema stays local; these calls do not read a
|
|
22
22
|
* custom `followingId` column or a separate table.
|
|
23
23
|
*
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { getFollowedIds } from '@molecule/api-resource-follow'
|
|
26
|
+
*
|
|
27
|
+
* export async function projectWatchedNotes(
|
|
28
|
+
* notes: readonly { id: string; title: string }[],
|
|
29
|
+
* viewerId?: string | null,
|
|
30
|
+
* ) {
|
|
31
|
+
* const followed = await getFollowedIds(viewerId, 'note', notes.map(({ id }) => id))
|
|
32
|
+
* return notes.map((note) => ({ ...note, watching: followed.has(note.id) }))
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
24
36
|
* @module
|
|
25
37
|
* @example
|
|
26
38
|
* ```typescript
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,18 @@
|
|
|
21
21
|
* A genuinely different relationship schema stays local; these calls do not read a
|
|
22
22
|
* custom `followingId` column or a separate table.
|
|
23
23
|
*
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { getFollowedIds } from '@molecule/api-resource-follow'
|
|
26
|
+
*
|
|
27
|
+
* export async function projectWatchedNotes(
|
|
28
|
+
* notes: readonly { id: string; title: string }[],
|
|
29
|
+
* viewerId?: string | null,
|
|
30
|
+
* ) {
|
|
31
|
+
* const followed = await getFollowedIds(viewerId, 'note', notes.map(({ id }) => id))
|
|
32
|
+
* return notes.map((note) => ({ ...note, watching: followed.has(note.id) }))
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
24
36
|
* @module
|
|
25
37
|
* @example
|
|
26
38
|
* ```typescript
|