@collective-intelligence/external-apps-server-sdk 0.2.5 → 0.2.7
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 +22 -9
- package/dist/admin.d.ts +30 -22
- package/dist/admin.js +2 -2
- package/dist/auth/federated.d.ts +9 -13
- package/dist/auth/federated.js +2 -2
- package/dist/auth.d.ts +52 -45
- package/dist/auth.js +1 -1
- package/dist/chunks/{index-sc1m7s5d.js → index-nm2bnv88.js} +5 -5
- package/dist/effect/next.js +1 -1
- package/dist/effect.d.ts +7 -7
- package/dist/effect.js +1 -1
- package/dist/express.d.ts +3 -1
- package/dist/express.js +1 -1
- package/dist/gateway.d.ts +7 -3
- package/dist/gateway.js +2 -2
- package/dist/index.d.ts +94 -66
- package/dist/index.js +1 -1
- package/dist/knowledge-sources/payload.d.ts +3 -1
- package/dist/knowledge-sources/payload.js +1 -1
- package/dist/knowledge-sources/strapi.d.ts +2 -1
- package/dist/knowledge-sources/strapi.js +1 -1
- package/dist/next.d.ts +77 -14
- package/dist/next.js +1 -1
- package/dist/resources.d.ts +1 -1
- package/dist/resources.js +1 -1
- package/dist/runtime/express.d.ts +3 -1
- package/dist/runtime/express.js +1 -1
- package/dist/runtime/nestjs.d.ts +11 -5
- package/dist/runtime/nestjs.js +1 -1
- package/dist/runtime/web.d.ts +26 -6
- package/dist/runtime/web.js +1 -1
- package/dist/tools/ai-sdk.d.ts +1 -0
- package/dist/tools/ai-sdk.js +2 -2
- package/docs/next-cache.md +6 -4
- package/docs/realtime.md +4 -3
- package/package.json +2 -2
package/docs/next-cache.md
CHANGED
|
@@ -36,8 +36,9 @@ export const getLead = async (organizationId: string, entityId: string) => {
|
|
|
36
36
|
- `schema` is the FQN of the schema.
|
|
37
37
|
- Read a get with `knowledge.query` and `op: "get"`. Return only the answer of
|
|
38
38
|
an ok result, and throw on an error envelope: a thrown read is not cached.
|
|
39
|
-
- Tags: `ciTag.all`, the Schema Tag, and the Entity Tag of a get or the
|
|
40
|
-
Tag of a filtered list. To name a tag
|
|
39
|
+
- Tags: `ciTag.all`, the Schema Tag, and the Entity Tag of a get or the List
|
|
40
|
+
Tag of a list, with the Topic Tag of a filtered list. To name a tag
|
|
41
|
+
yourself, use `ciTag.entity(fqn, id)`, `ciTag.list(fqn)`,
|
|
41
42
|
`ciTag.schema(fqn)` or `ciTag.topic({ schema, filter })`. A tag is a
|
|
42
43
|
`CiTag`, a branded string; the SDK computes it.
|
|
43
44
|
- Lifetime: `life`, by default `{ stale: 60, revalidate: 60, expire: 86400 }`
|
|
@@ -72,8 +73,9 @@ When the app API is an Effect server, keep `next` out of it:
|
|
|
72
73
|
|
|
73
74
|
## Write invalidation
|
|
74
75
|
|
|
75
|
-
After CI confirms a write, the SDK expires the Entity Tag
|
|
76
|
-
of its
|
|
76
|
+
After CI confirms a write, the SDK expires the Entity Tag of its record and
|
|
77
|
+
the List Tag of its schema, so the next read of that record and of each list
|
|
78
|
+
computes the entry again. The gets of other records keep their entries. This covers
|
|
77
79
|
`resources.records` writes and each write through the CI entity proxy
|
|
78
80
|
(`ciResources` of the BFF, `createCiResourceMounts`, `defineCiEntityResource`,
|
|
79
81
|
`CiEntities`). A read, and a write that CI refuses or that fails, expires
|
package/docs/realtime.md
CHANGED
|
@@ -54,11 +54,12 @@ Then give the browser realtime client
|
|
|
54
54
|
|
|
55
55
|
## What the Revalidate Route expires
|
|
56
56
|
|
|
57
|
-
- For each accepted change: the Topic Tag (the
|
|
57
|
+
- For each accepted change: the Topic Tag (the List Tag for a topic without
|
|
58
58
|
a filter) and the Entity Tag. These are the tags that `cacheCiRead` writes;
|
|
59
59
|
see [next-cache.md](next-cache.md).
|
|
60
|
-
- `reset: true`, after a `reset` or `access-changed` event:
|
|
61
|
-
topic
|
|
60
|
+
- `reset: true`, after a `reset` or `access-changed` event: for each topic in
|
|
61
|
+
the token, the Schema Tag of a topic without a filter (the missed changes
|
|
62
|
+
have no ids, so the gets expire too), or the Topic Tag of a filtered topic.
|
|
62
63
|
- It calls `revalidateTag(tag, { expire: 0 })`. On one instance, the first post
|
|
63
64
|
of a tag expires it at once and opens a 1-second window; more posts in the
|
|
64
65
|
window expire it once more at the window end, through `after`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@collective-intelligence/external-apps-server-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Server-side client and proxy adapters for Collective Intelligence external applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -252,5 +252,5 @@
|
|
|
252
252
|
"vitest": "5.0.2",
|
|
253
253
|
"zod": "4.4.3"
|
|
254
254
|
},
|
|
255
|
-
"gitHead": "
|
|
255
|
+
"gitHead": "5c6e6747e229d629d02380e62f0574c3e37d0090"
|
|
256
256
|
}
|