@estiva-app/interop 0.61.0 → 0.62.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/CHANGELOG.md +26 -0
- package/dist/objectUrl.d.ts +43 -9
- package/dist/objectUrl.d.ts.map +1 -1
- package/dist/objectUrl.js +94 -19
- package/dist/objectUrl.js.map +1 -1
- package/package.json +1 -1
- package/src/objectUrl.ts +105 -17
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,32 @@ how a declaration is read, is a MAJOR — in `0.x`, a MINOR — even when no
|
|
|
6
6
|
TypeScript signature moved. A consumer upgrading must be able to tell whether
|
|
7
7
|
manifests already published still mean what they meant.
|
|
8
8
|
|
|
9
|
+
## 0.62.0 — 2026-10-20
|
|
10
|
+
|
|
11
|
+
**A file's address on any Estiva app's host is that file**
|
|
12
|
+
(LTX-6; record *a-files-path-is-the-same-on-every-apps-host*, SPEC §7.7).
|
|
13
|
+
|
|
14
|
+
- `matchObjectUrl` matches a link's path against every shape passed, whatever
|
|
15
|
+
origin the shape is written on, when the link's origin (scheme, host and
|
|
16
|
+
port) is one some shape is written on. `leaf.estiva.app/issue/<slug>-<d>`
|
|
17
|
+
now names Ship's issue. A link on no declared origin still names nothing. A
|
|
18
|
+
fragment route (`/#/…`), and a shape that names no kind, match only on their
|
|
19
|
+
own origin.
|
|
20
|
+
- A match on the link's own origin wins, as before. On either side, every
|
|
21
|
+
shape reading the same identity adds its kind, whatever order the manifests
|
|
22
|
+
came in (on the own origin the first shape listed used to win a tie): **new
|
|
23
|
+
`MatchedObjectUrl.kinds`**, present (and `kind` absent) when they name more
|
|
24
|
+
than one. A reader resolves under all of them and keeps the one-author rule,
|
|
25
|
+
so a second claim to a word turns the link plain. A consumer that ignores
|
|
26
|
+
`kinds` asks by `#d` alone, which the one-author rule still guards.
|
|
27
|
+
- `urlPatternsOf` drops a `urls` shape whose origin is not one of the
|
|
28
|
+
manifest's `web` templates, and a manifest with no `web` declares none. That
|
|
29
|
+
is consistency, not authentication.
|
|
30
|
+
|
|
31
|
+
Manifests: how a published `urls` declaration is read changed as above. Every
|
|
32
|
+
production manifest's shapes sit on its own `web` origin (checked 2026-10-20),
|
|
33
|
+
so none loses a shape.
|
|
34
|
+
|
|
9
35
|
## 0.61.0 — 2026-10-19
|
|
10
36
|
|
|
11
37
|
**A topic has no text, and a Ship project has a Folder to write into**
|
package/dist/objectUrl.d.ts
CHANGED
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
* That second sentence is the amended one. §7.2 used to say a consumer MUST
|
|
31
31
|
* ignore *everything* before the final uuid, which contradicted the paragraph
|
|
32
32
|
* above it and, read literally, resolves `evil.example.com/issue/<uuid>` as a
|
|
33
|
-
* Ship issue. The
|
|
34
|
-
*
|
|
35
|
-
* corrected rule.
|
|
33
|
+
* Ship issue. The `<type>` segment is what selects the kind, and the host must
|
|
34
|
+
* be one some app declares; only the slug is decoration. `matchObjectUrl`
|
|
35
|
+
* implements the corrected rule.
|
|
36
36
|
*/
|
|
37
37
|
/**
|
|
38
38
|
* A title reduced to URL-safe words. Decorative by contract: nothing resolves
|
|
@@ -90,7 +90,20 @@ export interface UrlPattern {
|
|
|
90
90
|
*/
|
|
91
91
|
kind?: number;
|
|
92
92
|
}
|
|
93
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* The `urls` shapes a manifest event declares, on its own origin.
|
|
95
|
+
*
|
|
96
|
+
* **A manifest declares `urls` only on its own origin** (SPEC §7.7, LTX-6): a
|
|
97
|
+
* shape whose scheme, host and port are not those of one of the manifest's
|
|
98
|
+
* `web` templates is dropped, and a manifest with no `web` declares none.
|
|
99
|
+
* Every declared origin is one some manifest serves from, which is what lets
|
|
100
|
+
* {@link matchObjectUrl} read a path on any of them.
|
|
101
|
+
*
|
|
102
|
+
* That keeps declarations consistent; it is not authentication. A reader
|
|
103
|
+
* trusts a manifest's hosts as far as it trusts the manifest.
|
|
104
|
+
*
|
|
105
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-files-path-is-the-same-on-every-apps-host.md
|
|
106
|
+
*/
|
|
94
107
|
export declare function urlPatternsOf(event: {
|
|
95
108
|
tags: string[][];
|
|
96
109
|
}): UrlPattern[];
|
|
@@ -109,6 +122,13 @@ export interface MatchedObjectUrl {
|
|
|
109
122
|
by: 'd' | 'id';
|
|
110
123
|
/** Present only when the matched pattern named one. */
|
|
111
124
|
kind?: number;
|
|
125
|
+
/**
|
|
126
|
+
* The kinds to resolve under when shapes on other origins claim the path for
|
|
127
|
+
* different kinds (SPEC §7.7, LTX-6); `kind` is then absent. One author must
|
|
128
|
+
* hold the identity across all of them, so a second app's claim to the same
|
|
129
|
+
* word turns the link plain rather than taking it over.
|
|
130
|
+
*/
|
|
131
|
+
kinds?: number[];
|
|
112
132
|
/**
|
|
113
133
|
* The object the path names, when the identity came from the query — the
|
|
114
134
|
* topic a `?thread=<id>` link opens, read off `/topic/<slug>-<d>`. Absent
|
|
@@ -129,12 +149,26 @@ export interface MatchedObjectUrl {
|
|
|
129
149
|
block?: string;
|
|
130
150
|
}
|
|
131
151
|
/**
|
|
132
|
-
* Match a pasted URL against
|
|
152
|
+
* Match a pasted URL against the shapes every manifest declares.
|
|
153
|
+
*
|
|
154
|
+
* **The `<type>` segment is significant; the slug is not.** That is §7.2 as
|
|
155
|
+
* amended: a consumer that matched on the trailing uuid alone would resolve
|
|
156
|
+
* any URL from anywhere as some app's object.
|
|
157
|
+
*
|
|
158
|
+
* **The path is the same on every declared host** (SPEC §7.7, LTX-6). A link
|
|
159
|
+
* whose origin (scheme, host and port) is one some shape is written on matches
|
|
160
|
+
* every path shape by its path and query, whatever origin the shape is on, so
|
|
161
|
+
* `leaf.estiva.app/issue/<slug>-<d>` is Ship's issue as `ship.estiva.app`'s is.
|
|
162
|
+
* A link on no declared origin matches nothing. A fragment route
|
|
163
|
+
* (`/#/issue/<d>`) matches only on its own origin, since no other app serves
|
|
164
|
+
* it, and so does a shape that names no kind.
|
|
165
|
+
* A match on the link's own origin wins whatever the specificity of others.
|
|
166
|
+
* On either side, when shapes claim the path for different kinds, the match
|
|
167
|
+
* carries all of them in `kinds`, and the reader's one-author rule decides.
|
|
168
|
+
* Pass the shapes of every manifest, each read through {@link urlPatternsOf}
|
|
169
|
+
* so that a manifest adds only its own origin.
|
|
133
170
|
*
|
|
134
|
-
*
|
|
135
|
-
* is §7.2 as amended, and it is the whole of the security story here: a
|
|
136
|
-
* consumer that matched on the trailing uuid alone would resolve any URL from
|
|
137
|
-
* anywhere as that app's object.
|
|
171
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-files-path-is-the-same-on-every-apps-host.md
|
|
138
172
|
*
|
|
139
173
|
* **A query parameter may carry the identity too** (FOL-38). Peek opens a
|
|
140
174
|
* thread as `/topic/<slug>-<d>?thread=<id>`: the path names the topic, the
|
package/dist/objectUrl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectUrl.d.ts","sourceRoot":"","sources":["../src/objectUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AA2BH;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7C;AAED,qFAAqF;AACrF,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG5D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;C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CAAA;CACf;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,gBAAgB,GAAG,IAAI,CAuE3F;AAqED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EAAE,EACtB,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjE,MAAM,GAAG,SAAS,CAqBpB"}
|
package/dist/objectUrl.js
CHANGED
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
* That second sentence is the amended one. §7.2 used to say a consumer MUST
|
|
31
31
|
* ignore *everything* before the final uuid, which contradicted the paragraph
|
|
32
32
|
* above it and, read literally, resolves `evil.example.com/issue/<uuid>` as a
|
|
33
|
-
* Ship issue. The
|
|
34
|
-
*
|
|
35
|
-
* corrected rule.
|
|
33
|
+
* Ship issue. The `<type>` segment is what selects the kind, and the host must
|
|
34
|
+
* be one some app declares; only the slug is decoration. `matchObjectUrl`
|
|
35
|
+
* implements the corrected rule.
|
|
36
36
|
*/
|
|
37
37
|
/**
|
|
38
38
|
* A v4 uuid at the very end of a ref.
|
|
@@ -106,12 +106,29 @@ export function eventIdFromRef(ref) {
|
|
|
106
106
|
const match = TRAILING_EVENT_ID_RE.exec(ref);
|
|
107
107
|
return match ? match[1].toLowerCase() : null;
|
|
108
108
|
}
|
|
109
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* The `urls` shapes a manifest event declares, on its own origin.
|
|
111
|
+
*
|
|
112
|
+
* **A manifest declares `urls` only on its own origin** (SPEC §7.7, LTX-6): a
|
|
113
|
+
* shape whose scheme, host and port are not those of one of the manifest's
|
|
114
|
+
* `web` templates is dropped, and a manifest with no `web` declares none.
|
|
115
|
+
* Every declared origin is one some manifest serves from, which is what lets
|
|
116
|
+
* {@link matchObjectUrl} read a path on any of them.
|
|
117
|
+
*
|
|
118
|
+
* That keeps declarations consistent; it is not authentication. A reader
|
|
119
|
+
* trusts a manifest's hosts as far as it trusts the manifest.
|
|
120
|
+
*
|
|
121
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-files-path-is-the-same-on-every-apps-host.md
|
|
122
|
+
*/
|
|
110
123
|
export function urlPatternsOf(event) {
|
|
124
|
+
const own = new Set(event.tags.filter((tag) => tag[0] === 'web' && tag[1]).map((tag) => originOfUrl(tag[1])));
|
|
111
125
|
const out = [];
|
|
112
126
|
for (const tag of event.tags) {
|
|
113
127
|
if (tag[0] !== 'urls' || !tag[1])
|
|
114
128
|
continue;
|
|
129
|
+
const origin = originOfUrl(tag[1]);
|
|
130
|
+
if (origin === null || !own.has(origin))
|
|
131
|
+
continue;
|
|
115
132
|
const kind = tag[2] ? Number(tag[2]) : undefined;
|
|
116
133
|
out.push({ pattern: tag[1], ...(Number.isInteger(kind) ? { kind } : {}) });
|
|
117
134
|
}
|
|
@@ -120,12 +137,26 @@ export function urlPatternsOf(event) {
|
|
|
120
137
|
/** The placeholder a pattern's fragment uses for a block id. */
|
|
121
138
|
const BLOCK_PLACEHOLDER = '<block>';
|
|
122
139
|
/**
|
|
123
|
-
* Match a pasted URL against
|
|
140
|
+
* Match a pasted URL against the shapes every manifest declares.
|
|
124
141
|
*
|
|
125
|
-
* **The
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
142
|
+
* **The `<type>` segment is significant; the slug is not.** That is §7.2 as
|
|
143
|
+
* amended: a consumer that matched on the trailing uuid alone would resolve
|
|
144
|
+
* any URL from anywhere as some app's object.
|
|
145
|
+
*
|
|
146
|
+
* **The path is the same on every declared host** (SPEC §7.7, LTX-6). A link
|
|
147
|
+
* whose origin (scheme, host and port) is one some shape is written on matches
|
|
148
|
+
* every path shape by its path and query, whatever origin the shape is on, so
|
|
149
|
+
* `leaf.estiva.app/issue/<slug>-<d>` is Ship's issue as `ship.estiva.app`'s is.
|
|
150
|
+
* A link on no declared origin matches nothing. A fragment route
|
|
151
|
+
* (`/#/issue/<d>`) matches only on its own origin, since no other app serves
|
|
152
|
+
* it, and so does a shape that names no kind.
|
|
153
|
+
* A match on the link's own origin wins whatever the specificity of others.
|
|
154
|
+
* On either side, when shapes claim the path for different kinds, the match
|
|
155
|
+
* carries all of them in `kinds`, and the reader's one-author rule decides.
|
|
156
|
+
* Pass the shapes of every manifest, each read through {@link urlPatternsOf}
|
|
157
|
+
* so that a manifest adds only its own origin.
|
|
158
|
+
*
|
|
159
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-files-path-is-the-same-on-every-apps-host.md
|
|
129
160
|
*
|
|
130
161
|
* **A query parameter may carry the identity too** (FOL-38). Peek opens a
|
|
131
162
|
* thread as `/topic/<slug>-<d>?thread=<id>`: the path names the topic, the
|
|
@@ -146,16 +177,25 @@ export function matchObjectUrl(url, patterns) {
|
|
|
146
177
|
const target = splitUrl(url);
|
|
147
178
|
if (!target)
|
|
148
179
|
return null;
|
|
149
|
-
|
|
150
|
-
|
|
180
|
+
const origin = `${target.scheme}://${target.host}`;
|
|
181
|
+
const shapes = patterns.flatMap(({ pattern, kind }) => {
|
|
151
182
|
const shape = splitUrl(pattern);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
183
|
+
return shape ? [{ shape, kind, own: `${shape.scheme}://${shape.host}` === origin }] : [];
|
|
184
|
+
});
|
|
185
|
+
// A link on an origin no shape is written on names nothing, whatever its path.
|
|
186
|
+
if (!shapes.some(({ own }) => own))
|
|
187
|
+
return null;
|
|
188
|
+
const onOwn = [];
|
|
189
|
+
const elsewhere = [];
|
|
190
|
+
for (const { shape, kind, own } of shapes) {
|
|
191
|
+
// A fragment route and a path route are different shapes, not one. Off its
|
|
192
|
+
// own origin a shape matches only as a path route that names its kind: no
|
|
193
|
+
// other app serves a fragment route, and a kindless shape would let any
|
|
194
|
+
// manifest turn every swapped link of its word into a bare `#d` lookup.
|
|
157
195
|
if (shape.fragmented !== target.fragmented)
|
|
158
196
|
continue;
|
|
197
|
+
if (!own && (shape.fragmented || kind === undefined))
|
|
198
|
+
continue;
|
|
159
199
|
// The pattern's path up to its final segment: `/issue/` out of
|
|
160
200
|
// `/issue/<slug>-<d>`. Compared literally and at equal depth, so `/issues`
|
|
161
201
|
// never matches `/issue/…` and a nested route never matches a shallower one.
|
|
@@ -204,10 +244,45 @@ export function matchObjectUrl(url, patterns) {
|
|
|
204
244
|
// A filled `<block>` breaks a tie, so an app that declares the block shape
|
|
205
245
|
// beside its older shape loses no block to declaration order.
|
|
206
246
|
const specificity = declared.length * 2 + (block === undefined ? 0 : 1);
|
|
207
|
-
|
|
208
|
-
best = { specificity, match };
|
|
247
|
+
(own ? onOwn : elsewhere).push({ specificity, match });
|
|
209
248
|
}
|
|
210
|
-
return
|
|
249
|
+
return onOwn.length > 0 ? chosen(onOwn) : chosen(elsewhere);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* The match a link earns from the shapes that read it on one side: its own
|
|
253
|
+
* origin, or, when none does, the others.
|
|
254
|
+
*
|
|
255
|
+
* The most specific reading names the object. Its kind is not trusted alone:
|
|
256
|
+
* every shape that reads the same identity adds its kind, whatever its
|
|
257
|
+
* specificity and whatever order the manifests came in, so a second manifest
|
|
258
|
+
* that claims a word — with a `<block>` fragment the owner's shape lacks, say
|
|
259
|
+
* — can only widen the lookup, where the one-author rule turns the link plain.
|
|
260
|
+
* Two equally specific readings of different identities name nothing. A shape
|
|
261
|
+
* that names no kind (only ever on its own origin) leaves the kinds open.
|
|
262
|
+
*/
|
|
263
|
+
function chosen(candidates) {
|
|
264
|
+
if (candidates.length === 0)
|
|
265
|
+
return null;
|
|
266
|
+
const top = Math.max(...candidates.map((c) => c.specificity));
|
|
267
|
+
const [first, ...rest] = candidates.filter((c) => c.specificity === top).map((c) => c.match);
|
|
268
|
+
if (rest.some((match) => identityOf(match) !== identityOf(first)))
|
|
269
|
+
return null;
|
|
270
|
+
const same = candidates.map((c) => c.match).filter((match) => identityOf(match) === identityOf(first));
|
|
271
|
+
const named = { ...first };
|
|
272
|
+
delete named.kind;
|
|
273
|
+
if (same.some((match) => match.kind === undefined))
|
|
274
|
+
return named;
|
|
275
|
+
const kinds = [...new Set(same.map((match) => match.kind))].sort((a, b) => a - b);
|
|
276
|
+
return kinds.length === 1 ? { ...named, kind: kinds[0] } : { ...named, kinds };
|
|
277
|
+
}
|
|
278
|
+
/** What a match names, apart from its kind and block. */
|
|
279
|
+
function identityOf(match) {
|
|
280
|
+
return [match.by, match.identifier, match.within?.by ?? '', match.within?.identifier ?? ''].join(' ');
|
|
281
|
+
}
|
|
282
|
+
/** `scheme://host[:port]` of a URL or a pattern, lowercased; null when it has none. */
|
|
283
|
+
function originOfUrl(raw) {
|
|
284
|
+
const parts = splitUrl(raw);
|
|
285
|
+
return parts ? `${parts.scheme}://${parts.host}` : null;
|
|
211
286
|
}
|
|
212
287
|
/**
|
|
213
288
|
* The block a URL's fragment names, by the pattern's `#…<block>…`; undefined
|
package/dist/objectUrl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectUrl.js","sourceRoot":"","sources":["../src/objectUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAG,gEAAgE,CAAA;AAEzF;;;;;;GAMG;AACH,MAAM,oBAAoB,GAAG,iCAAiC,CAAA;AAE9D;;;;GAIG;AACH,MAAM,eAAe,GAAG,EAAE,CAAA;AAE1B;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,KAAK;SACT,SAAS,CAAC,MAAM,CAAC;SACjB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;S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G,CAAA;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@estiva-app/interop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0",
|
|
4
4
|
"description": "Render and act on another app's objects from its published NIP-89 manifest. The owner defines the projection; the consumer decides how it looks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/objectUrl.ts
CHANGED
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
* That second sentence is the amended one. §7.2 used to say a consumer MUST
|
|
31
31
|
* ignore *everything* before the final uuid, which contradicted the paragraph
|
|
32
32
|
* above it and, read literally, resolves `evil.example.com/issue/<uuid>` as a
|
|
33
|
-
* Ship issue. The
|
|
34
|
-
*
|
|
35
|
-
* corrected rule.
|
|
33
|
+
* Ship issue. The `<type>` segment is what selects the kind, and the host must
|
|
34
|
+
* be one some app declares; only the slug is decoration. `matchObjectUrl`
|
|
35
|
+
* implements the corrected rule.
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -139,11 +139,27 @@ export interface UrlPattern {
|
|
|
139
139
|
kind?: number
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* The `urls` shapes a manifest event declares, on its own origin.
|
|
144
|
+
*
|
|
145
|
+
* **A manifest declares `urls` only on its own origin** (SPEC §7.7, LTX-6): a
|
|
146
|
+
* shape whose scheme, host and port are not those of one of the manifest's
|
|
147
|
+
* `web` templates is dropped, and a manifest with no `web` declares none.
|
|
148
|
+
* Every declared origin is one some manifest serves from, which is what lets
|
|
149
|
+
* {@link matchObjectUrl} read a path on any of them.
|
|
150
|
+
*
|
|
151
|
+
* That keeps declarations consistent; it is not authentication. A reader
|
|
152
|
+
* trusts a manifest's hosts as far as it trusts the manifest.
|
|
153
|
+
*
|
|
154
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-files-path-is-the-same-on-every-apps-host.md
|
|
155
|
+
*/
|
|
143
156
|
export function urlPatternsOf(event: { tags: string[][] }): UrlPattern[] {
|
|
157
|
+
const own = new Set(event.tags.filter((tag) => tag[0] === 'web' && tag[1]).map((tag) => originOfUrl(tag[1])))
|
|
144
158
|
const out: UrlPattern[] = []
|
|
145
159
|
for (const tag of event.tags) {
|
|
146
160
|
if (tag[0] !== 'urls' || !tag[1]) continue
|
|
161
|
+
const origin = originOfUrl(tag[1])
|
|
162
|
+
if (origin === null || !own.has(origin)) continue
|
|
147
163
|
const kind = tag[2] ? Number(tag[2]) : undefined
|
|
148
164
|
out.push({ pattern: tag[1], ...(Number.isInteger(kind) ? { kind } : {}) })
|
|
149
165
|
}
|
|
@@ -165,6 +181,13 @@ export interface MatchedObjectUrl {
|
|
|
165
181
|
by: 'd' | 'id'
|
|
166
182
|
/** Present only when the matched pattern named one. */
|
|
167
183
|
kind?: number
|
|
184
|
+
/**
|
|
185
|
+
* The kinds to resolve under when shapes on other origins claim the path for
|
|
186
|
+
* different kinds (SPEC §7.7, LTX-6); `kind` is then absent. One author must
|
|
187
|
+
* hold the identity across all of them, so a second app's claim to the same
|
|
188
|
+
* word turns the link plain rather than taking it over.
|
|
189
|
+
*/
|
|
190
|
+
kinds?: number[]
|
|
168
191
|
/**
|
|
169
192
|
* The object the path names, when the identity came from the query — the
|
|
170
193
|
* topic a `?thread=<id>` link opens, read off `/topic/<slug>-<d>`. Absent
|
|
@@ -186,12 +209,26 @@ export interface MatchedObjectUrl {
|
|
|
186
209
|
const BLOCK_PLACEHOLDER = '<block>'
|
|
187
210
|
|
|
188
211
|
/**
|
|
189
|
-
* Match a pasted URL against
|
|
212
|
+
* Match a pasted URL against the shapes every manifest declares.
|
|
213
|
+
*
|
|
214
|
+
* **The `<type>` segment is significant; the slug is not.** That is §7.2 as
|
|
215
|
+
* amended: a consumer that matched on the trailing uuid alone would resolve
|
|
216
|
+
* any URL from anywhere as some app's object.
|
|
217
|
+
*
|
|
218
|
+
* **The path is the same on every declared host** (SPEC §7.7, LTX-6). A link
|
|
219
|
+
* whose origin (scheme, host and port) is one some shape is written on matches
|
|
220
|
+
* every path shape by its path and query, whatever origin the shape is on, so
|
|
221
|
+
* `leaf.estiva.app/issue/<slug>-<d>` is Ship's issue as `ship.estiva.app`'s is.
|
|
222
|
+
* A link on no declared origin matches nothing. A fragment route
|
|
223
|
+
* (`/#/issue/<d>`) matches only on its own origin, since no other app serves
|
|
224
|
+
* it, and so does a shape that names no kind.
|
|
225
|
+
* A match on the link's own origin wins whatever the specificity of others.
|
|
226
|
+
* On either side, when shapes claim the path for different kinds, the match
|
|
227
|
+
* carries all of them in `kinds`, and the reader's one-author rule decides.
|
|
228
|
+
* Pass the shapes of every manifest, each read through {@link urlPatternsOf}
|
|
229
|
+
* so that a manifest adds only its own origin.
|
|
190
230
|
*
|
|
191
|
-
*
|
|
192
|
-
* is §7.2 as amended, and it is the whole of the security story here: a
|
|
193
|
-
* consumer that matched on the trailing uuid alone would resolve any URL from
|
|
194
|
-
* anywhere as that app's object.
|
|
231
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-files-path-is-the-same-on-every-apps-host.md
|
|
195
232
|
*
|
|
196
233
|
* **A query parameter may carry the identity too** (FOL-38). Peek opens a
|
|
197
234
|
* thread as `/topic/<slug>-<d>?thread=<id>`: the path names the topic, the
|
|
@@ -211,14 +248,23 @@ const BLOCK_PLACEHOLDER = '<block>'
|
|
|
211
248
|
export function matchObjectUrl(url: string, patterns: UrlPattern[]): MatchedObjectUrl | null {
|
|
212
249
|
const target = splitUrl(url)
|
|
213
250
|
if (!target) return null
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
for (const { pattern, kind } of patterns) {
|
|
251
|
+
const origin = `${target.scheme}://${target.host}`
|
|
252
|
+
const shapes = patterns.flatMap(({ pattern, kind }) => {
|
|
217
253
|
const shape = splitUrl(pattern)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
254
|
+
return shape ? [{ shape, kind, own: `${shape.scheme}://${shape.host}` === origin }] : []
|
|
255
|
+
})
|
|
256
|
+
// A link on an origin no shape is written on names nothing, whatever its path.
|
|
257
|
+
if (!shapes.some(({ own }) => own)) return null
|
|
258
|
+
|
|
259
|
+
const onOwn: Candidate[] = []
|
|
260
|
+
const elsewhere: Candidate[] = []
|
|
261
|
+
for (const { shape, kind, own } of shapes) {
|
|
262
|
+
// A fragment route and a path route are different shapes, not one. Off its
|
|
263
|
+
// own origin a shape matches only as a path route that names its kind: no
|
|
264
|
+
// other app serves a fragment route, and a kindless shape would let any
|
|
265
|
+
// manifest turn every swapped link of its word into a bare `#d` lookup.
|
|
221
266
|
if (shape.fragmented !== target.fragmented) continue
|
|
267
|
+
if (!own && (shape.fragmented || kind === undefined)) continue
|
|
222
268
|
|
|
223
269
|
// The pattern's path up to its final segment: `/issue/` out of
|
|
224
270
|
// `/issue/<slug>-<d>`. Compared literally and at equal depth, so `/issues`
|
|
@@ -267,9 +313,51 @@ export function matchObjectUrl(url: string, patterns: UrlPattern[]): MatchedObje
|
|
|
267
313
|
// A filled `<block>` breaks a tie, so an app that declares the block shape
|
|
268
314
|
// beside its older shape loses no block to declaration order.
|
|
269
315
|
const specificity = declared.length * 2 + (block === undefined ? 0 : 1)
|
|
270
|
-
|
|
316
|
+
;(own ? onOwn : elsewhere).push({ specificity, match })
|
|
271
317
|
}
|
|
272
|
-
return
|
|
318
|
+
return onOwn.length > 0 ? chosen(onOwn) : chosen(elsewhere)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
interface Candidate {
|
|
322
|
+
specificity: number
|
|
323
|
+
match: MatchedObjectUrl
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* The match a link earns from the shapes that read it on one side: its own
|
|
328
|
+
* origin, or, when none does, the others.
|
|
329
|
+
*
|
|
330
|
+
* The most specific reading names the object. Its kind is not trusted alone:
|
|
331
|
+
* every shape that reads the same identity adds its kind, whatever its
|
|
332
|
+
* specificity and whatever order the manifests came in, so a second manifest
|
|
333
|
+
* that claims a word — with a `<block>` fragment the owner's shape lacks, say
|
|
334
|
+
* — can only widen the lookup, where the one-author rule turns the link plain.
|
|
335
|
+
* Two equally specific readings of different identities name nothing. A shape
|
|
336
|
+
* that names no kind (only ever on its own origin) leaves the kinds open.
|
|
337
|
+
*/
|
|
338
|
+
function chosen(candidates: Candidate[]): MatchedObjectUrl | null {
|
|
339
|
+
if (candidates.length === 0) return null
|
|
340
|
+
const top = Math.max(...candidates.map((c) => c.specificity))
|
|
341
|
+
const [first, ...rest] = candidates.filter((c) => c.specificity === top).map((c) => c.match)
|
|
342
|
+
if (rest.some((match) => identityOf(match) !== identityOf(first))) return null
|
|
343
|
+
|
|
344
|
+
const same = candidates.map((c) => c.match).filter((match) => identityOf(match) === identityOf(first))
|
|
345
|
+
const named: MatchedObjectUrl = { ...first }
|
|
346
|
+
delete named.kind
|
|
347
|
+
if (same.some((match) => match.kind === undefined)) return named
|
|
348
|
+
const kinds = [...new Set(same.map((match) => match.kind as number))].sort((a, b) => a - b)
|
|
349
|
+
return kinds.length === 1 ? { ...named, kind: kinds[0] } : { ...named, kinds }
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** What a match names, apart from its kind and block. */
|
|
353
|
+
function identityOf(match: MatchedObjectUrl): string {
|
|
354
|
+
return [match.by, match.identifier, match.within?.by ?? '', match.within?.identifier ?? ''].join(' ')
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** `scheme://host[:port]` of a URL or a pattern, lowercased; null when it has none. */
|
|
358
|
+
function originOfUrl(raw: string): string | null {
|
|
359
|
+
const parts = splitUrl(raw)
|
|
360
|
+
return parts ? `${parts.scheme}://${parts.host}` : null
|
|
273
361
|
}
|
|
274
362
|
|
|
275
363
|
/**
|