@webref/xref 1.1.1 → 1.2.1
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 +77 -0
- package/ed/dfns/attribution.json +17 -17
- package/ed/dfns/connection-allowlists.json +780 -0
- package/ed/dfns/did-resolution.json +17 -17
- package/ed/dfns/ecmascript.json +2 -2
- package/ed/dfns/encoding.json +20 -0
- package/ed/dfns/picture-in-picture.json +58 -18
- package/ed/dfns/pointerevents4.json +27 -0
- package/ed/dfns/rfc8610.json +6 -5
- package/ed/dfns/sanitizer-api.json +20 -0
- package/ed/dfns/shacl12-rules.json +181 -86
- package/ed/dfns/speech-api.json +22 -0
- package/ed/dfns/vc-recognized-entities.json +6 -6
- package/ed/dfns/web-smart-card.json +1065 -1151
- package/ed/dfns/webdriver-bidi.json +1748 -679
- package/ed/dfns/webmcp.json +164 -3
- package/ed/dfns/webnn.json +20 -0
- package/ed/dfns/webrtc-encoded-transform.json +28 -28
- package/ed/dfns/webrtc-ice.json +2 -2
- package/ed/headings/attribution.json +21 -0
- package/ed/headings/connection-allowlists.json +228 -0
- package/ed/headings/did-resolution.json +161 -92
- package/ed/headings/dom.json +1 -1
- package/ed/headings/ecmascript.json +1 -1
- package/ed/headings/encoding.json +1 -1
- package/ed/headings/picture-in-picture.json +5 -5
- package/ed/headings/rfc2397.json +33 -9
- package/ed/headings/rfc4120.json +164 -134
- package/ed/headings/rfc6386.json +128 -104
- package/ed/headings/rfc6454.json +62 -38
- package/ed/headings/rfc6455.json +120 -90
- package/ed/headings/rfc6797.json +104 -80
- package/ed/headings/rfc7034.json +52 -28
- package/ed/headings/rfc7239.json +55 -31
- package/ed/headings/rfc7469.json +63 -39
- package/ed/headings/rfc7578.json +54 -30
- package/ed/headings/rfc7932.json +70 -40
- package/ed/headings/rfc8610.json +93 -63
- package/ed/headings/rfc8878.json +97 -88
- package/ed/headings/rfc9163.json +62 -59
- package/ed/headings/rfc9649.json +82 -79
- package/ed/headings/rfc9659.json +33 -30
- package/ed/headings/secure-payment-confirmation.json +1 -1
- package/ed/headings/selectors-5.json +8 -1
- package/ed/headings/service-workers.json +1 -1
- package/ed/headings/shacl12-rules.json +125 -85
- package/ed/headings/soft-navigations.json +1 -1
- package/ed/headings/storage-access.json +2 -2
- package/ed/headings/vc-data-model-2.1.json +72 -72
- package/ed/headings/vc-jose-cose.json +70 -70
- package/ed/headings/vc-recognized-entities.json +62 -32
- package/ed/headings/web-smart-card.json +106 -217
- package/ed/headings/webdriver-bidi.json +25 -4
- package/ed/headings/webidl.json +1 -1
- package/ed/headings/webmcp.json +14 -0
- package/ed/headings/webnn.json +1 -1
- package/ed/headings/webrtc-encoded-transform.json +1 -1
- package/ed/headings/webusb.json +1 -1
- package/ed/headings/webvtt1.json +2 -2
- package/index.js +56 -8
- package/package.json +1 -1
- package/specs.json +28925 -0
- package/tr/dfns/attribution.json +17 -17
- package/tr/dfns/did-resolution.json +17 -17
- package/tr/dfns/picture-in-picture.json +58 -18
- package/tr/dfns/pointerevents4.json +27 -0
- package/tr/dfns/shacl12-rules.json +181 -86
- package/tr/dfns/webdriver-bidi.json +1748 -679
- package/tr/dfns/webnn.json +20 -0
- package/tr/dfns/webrtc-encoded-transform.json +28 -28
- package/tr/dfns/webvtt1.json +82 -95
- package/tr/headings/attribution.json +21 -0
- package/tr/headings/did-resolution.json +161 -92
- package/tr/headings/picture-in-picture.json +5 -5
- package/tr/headings/secure-payment-confirmation.json +1 -1
- package/tr/headings/service-workers.json +1 -1
- package/tr/headings/shacl12-rules.json +125 -85
- package/tr/headings/webauthn-3.json +9 -2
- package/tr/headings/webdriver-bidi.json +25 -4
- package/tr/headings/webnn.json +1 -1
- package/tr/headings/webrtc-encoded-transform.json +1 -1
- package/tr/headings/webvtt1.json +3 -9
package/ed/headings/webidl.json
CHANGED
package/ed/headings/webmcp.json
CHANGED
|
@@ -101,6 +101,20 @@
|
|
|
101
101
|
"title": "Declarative WebMCP",
|
|
102
102
|
"number": "4.3"
|
|
103
103
|
},
|
|
104
|
+
{
|
|
105
|
+
"id": "events",
|
|
106
|
+
"href": "https://webmachinelearning.github.io/webmcp/#events",
|
|
107
|
+
"level": 3,
|
|
108
|
+
"title": "Events",
|
|
109
|
+
"number": "4.4"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "permissions-policy",
|
|
113
|
+
"href": "https://webmachinelearning.github.io/webmcp/#permissions-policy",
|
|
114
|
+
"level": 3,
|
|
115
|
+
"title": "Permissions policy integration",
|
|
116
|
+
"number": "4.5"
|
|
117
|
+
},
|
|
104
118
|
{
|
|
105
119
|
"id": "interaction-with-agents",
|
|
106
120
|
"href": "https://webmachinelearning.github.io/webmcp/#interaction-with-agents",
|
package/ed/headings/webnn.json
CHANGED
package/ed/headings/webusb.json
CHANGED
package/ed/headings/webvtt1.json
CHANGED
package/index.js
CHANGED
|
@@ -9,7 +9,8 @@ const scriptPath = path.dirname(fileURLToPath(import.meta.url));
|
|
|
9
9
|
*/
|
|
10
10
|
const xref = {
|
|
11
11
|
dfns: [],
|
|
12
|
-
headings: []
|
|
12
|
+
headings: [],
|
|
13
|
+
specs: []
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -83,6 +84,18 @@ export function setup(rootFolder = scriptPath) {
|
|
|
83
84
|
if (initialized) {
|
|
84
85
|
return;
|
|
85
86
|
}
|
|
87
|
+
if (rootFolder === scriptPath) {
|
|
88
|
+
// We're in "package" mode, the root folder contains a `specs.json` file.
|
|
89
|
+
xref.specs = JSON.parse(fs.readFileSync(path.join(rootFolder, 'specs.json'), 'utf8'));
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// We're in "use crawl results" mode, the root folder won't contain a
|
|
93
|
+
// `specs.json` file, but the `ed` folder should have a crawl index with a
|
|
94
|
+
// list of specs.
|
|
95
|
+
const crawl = JSON.parse(fs.readFileSync(path.join(rootFolder, 'ed', 'index.json'), 'utf8'));
|
|
96
|
+
xref.specs = crawl.results;
|
|
97
|
+
}
|
|
98
|
+
|
|
86
99
|
for (const type of ['dfns', 'headings']) {
|
|
87
100
|
setupExtracts(type, rootFolder);
|
|
88
101
|
}
|
|
@@ -94,11 +107,14 @@ export function setup(rootFolder = scriptPath) {
|
|
|
94
107
|
* Lookup a URL in the loaded database
|
|
95
108
|
*
|
|
96
109
|
* The function returns an array of entries. Each entry is an object with a
|
|
97
|
-
* `source` key set to "dfns"
|
|
98
|
-
* `
|
|
99
|
-
*
|
|
110
|
+
* `source` key set to "dfns" or "headings"; and a `entry` key set to either a
|
|
111
|
+
* dfn object when `source` is "dfns" or a heading object when `source` is
|
|
112
|
+
* "headings".
|
|
113
|
+
*
|
|
114
|
+
* The function accepts a lookup options object as second parameter that sets
|
|
115
|
+
* lookup capabilities and filters. Check the README for details.
|
|
100
116
|
*/
|
|
101
|
-
export function lookup(url) {
|
|
117
|
+
export function lookup(url, { standing, version, series } = {}) {
|
|
102
118
|
if (!initialized) {
|
|
103
119
|
throw new Error('The `lookup()` function was called before `setup()`.');
|
|
104
120
|
}
|
|
@@ -125,8 +141,40 @@ export function lookup(url) {
|
|
|
125
141
|
decodedHash = parsedUrl.hash;
|
|
126
142
|
}
|
|
127
143
|
parsedUrl.hash = encodeURIComponent(decodedHash.replace(/^#/, ''));
|
|
128
|
-
|
|
144
|
+
let lookupUrl = parsedUrl.toString();
|
|
129
145
|
|
|
130
|
-
|
|
131
|
-
|
|
146
|
+
// If the series flag is set, the provided URL may also be a spec series URL,
|
|
147
|
+
// which we need to convert to the URL of the current spec in the series.
|
|
148
|
+
if (series && !urlIndex[lookupUrl.toString()]) {
|
|
149
|
+
// Drop the hash to match spec URLs
|
|
150
|
+
const hash = parsedUrl.hash;
|
|
151
|
+
parsedUrl.hash = '';
|
|
152
|
+
const specUrl = parsedUrl.toString();
|
|
153
|
+
const spec = xref.specs.find(spec =>
|
|
154
|
+
spec.shortname === spec.series.currentSpecification &&
|
|
155
|
+
(spec.series.nightlyUrl === specUrl || spec.series.releaseUrl === specUrl)
|
|
156
|
+
);
|
|
157
|
+
if (spec) {
|
|
158
|
+
// The lookup URL matches a series URL indeed, let's change it to the URL
|
|
159
|
+
// of the current spec in the series
|
|
160
|
+
const currentUrl = new URL(
|
|
161
|
+
(spec.series.nightlyUrl === specUrl) ? spec.nightly.url : spec.release.url
|
|
162
|
+
);
|
|
163
|
+
currentUrl.hash = hash;
|
|
164
|
+
lookupUrl = currentUrl.toString();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Look for the resulting URL and filter results as needed
|
|
169
|
+
let res = urlIndex[lookupUrl.toString()] ?? [];
|
|
170
|
+
const hasSpecFilter = standing || version;
|
|
171
|
+
if (hasSpecFilter) {
|
|
172
|
+
res = res.filter(match => {
|
|
173
|
+
const entry = match.entry;
|
|
174
|
+
const spec = xref.specs.find(spec => spec.shortname === entry.spec);
|
|
175
|
+
return (!standing || spec.standing === standing) &&
|
|
176
|
+
(!version || entry.version === version);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return structuredClone(res);
|
|
132
180
|
}
|