@oxyhq/contracts 0.23.0 → 0.24.0
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/followGraph.js +28 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/followGraph.js +27 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/followGraph.d.ts +144 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The follow graph wire contract (`/v2/follows`).
|
|
4
|
+
*
|
|
5
|
+
* These types are the boundary between the API that owns the graph and every
|
|
6
|
+
* application that reads it. They live here — not in the API and not in the
|
|
7
|
+
* SDK — because both ends have to agree, and a shape defined on one side is a
|
|
8
|
+
* shape the other side re-declares slightly differently within a release or two.
|
|
9
|
+
*
|
|
10
|
+
* ## Why the state is three fields and not a boolean
|
|
11
|
+
*
|
|
12
|
+
* A user can follow something globally and turn it off in ONE application. That
|
|
13
|
+
* is a state the user themselves created, so the client has to be able to see
|
|
14
|
+
* it and say so — "following, but not shown here" is a sentence a boolean
|
|
15
|
+
* cannot express. `globalState`, `applicationMode` and `effectiveState` are
|
|
16
|
+
* therefore reported separately, and only the last one answers "does this
|
|
17
|
+
* appear in my feed right now".
|
|
18
|
+
*
|
|
19
|
+
* ## Why kinds are strings
|
|
20
|
+
*
|
|
21
|
+
* `FollowTargetKind` is a plain `string`, not a union. Applications register
|
|
22
|
+
* their own kinds at runtime (`mercaria.store`, `syra.artist`), so a union here
|
|
23
|
+
* would mean every new application in the ecosystem needs a release of this
|
|
24
|
+
* package before it can follow anything. The namespace rule is enforced by the
|
|
25
|
+
* database, which is the one place that can enforce it for applications this
|
|
26
|
+
* package has never heard of.
|
|
27
|
+
*/
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|