@fedify/vocab 2.0.0-dev.241 → 2.0.0-pr.559.4
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/deno.json +9 -2
- package/dist/actor.test.js +2 -2
- package/dist/{deno-BcC99yBa.js → deno-WgPwii8-.js} +8 -2
- package/dist/lookup.test.js +12 -11
- package/dist/mod.cjs +270 -266
- package/dist/mod.d.cts +66 -66
- package/dist/mod.d.ts +66 -66
- package/dist/mod.js +270 -266
- package/dist/type.test.js +1 -1
- package/dist/{vocab-BmxSLhXr.js → vocab-DBPY77CM.js} +255 -255
- package/dist/vocab.test.js +1 -1
- package/package.json +8 -6
- package/scripts/codegen.ts +147 -11
- package/src/lookup.test.ts +15 -0
- package/src/lookup.ts +4 -4
package/deno.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/vocab",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-pr.559.4+6357309b",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/mod.ts"
|
|
@@ -23,9 +23,16 @@
|
|
|
23
23
|
"src/*.yaml",
|
|
24
24
|
"!src/vocab.ts"
|
|
25
25
|
],
|
|
26
|
+
"publish": {
|
|
27
|
+
"exclude": [
|
|
28
|
+
"**/*.test.ts",
|
|
29
|
+
"tsdown.config.ts",
|
|
30
|
+
"scripts/"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
26
33
|
"tasks": {
|
|
27
34
|
"check": "deno fmt --check && deno lint && deno check src/*.ts",
|
|
28
|
-
"compile": "deno run --allow-read --allow-write --allow-env --
|
|
35
|
+
"compile": "deno run --allow-read --allow-write --allow-env --allow-run scripts/codegen.ts",
|
|
29
36
|
"test": "deno test --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel"
|
|
30
37
|
}
|
|
31
38
|
}
|
package/dist/actor.test.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
|
|
5
5
|
import { __export } from "./chunk-BeeFIeNn.js";
|
|
6
|
-
import { Application, Group, Organization, Person, Service, test } from "./vocab-
|
|
7
|
-
import { deno_default, esm_default } from "./deno-
|
|
6
|
+
import { Application, Group, Organization, Person, Service, test } from "./vocab-DBPY77CM.js";
|
|
7
|
+
import { deno_default, esm_default } from "./deno-WgPwii8-.js";
|
|
8
8
|
import { getTypeId } from "./type-Dnf0m2yO.js";
|
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
10
10
|
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert/strict";
|
|
@@ -1240,7 +1240,7 @@ var esm_default = FetchMock_default;
|
|
|
1240
1240
|
//#endregion
|
|
1241
1241
|
//#region deno.json
|
|
1242
1242
|
var name = "@fedify/vocab";
|
|
1243
|
-
var version = "2.0.0-
|
|
1243
|
+
var version = "2.0.0-pr.559.4+6357309b";
|
|
1244
1244
|
var license = "MIT";
|
|
1245
1245
|
var exports = { ".": "./src/mod.ts" };
|
|
1246
1246
|
var description = "Vocabularies library for @fedify/fedify";
|
|
@@ -1261,9 +1261,14 @@ var exclude = [
|
|
|
1261
1261
|
"src/*.yaml",
|
|
1262
1262
|
"!src/vocab.ts"
|
|
1263
1263
|
];
|
|
1264
|
+
var publish = { "exclude": [
|
|
1265
|
+
"**/*.test.ts",
|
|
1266
|
+
"tsdown.config.ts",
|
|
1267
|
+
"scripts/"
|
|
1268
|
+
] };
|
|
1264
1269
|
var tasks = {
|
|
1265
1270
|
"check": "deno fmt --check && deno lint && deno check src/*.ts",
|
|
1266
|
-
"compile": "deno run --allow-read --allow-write --allow-env --
|
|
1271
|
+
"compile": "deno run --allow-read --allow-write --allow-env --allow-run scripts/codegen.ts",
|
|
1267
1272
|
"test": "deno test --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel"
|
|
1268
1273
|
};
|
|
1269
1274
|
var deno_default = {
|
|
@@ -1275,6 +1280,7 @@ var deno_default = {
|
|
|
1275
1280
|
author,
|
|
1276
1281
|
imports,
|
|
1277
1282
|
exclude,
|
|
1283
|
+
publish,
|
|
1278
1284
|
tasks
|
|
1279
1285
|
};
|
|
1280
1286
|
|
package/dist/lookup.test.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
|
|
5
|
-
import { Collection, Note, Object as Object$1, Person, createTestTracerProvider, getDocumentLoader, mockDocumentLoader, test } from "./vocab-
|
|
6
|
-
import { deno_default, esm_default } from "./deno-
|
|
5
|
+
import { Collection, Note, Object as Object$1, Person, createTestTracerProvider, getDocumentLoader, mockDocumentLoader, test } from "./vocab-DBPY77CM.js";
|
|
6
|
+
import { deno_default, esm_default } from "./deno-WgPwii8-.js";
|
|
7
7
|
import { getTypeId } from "./type-Dnf0m2yO.js";
|
|
8
8
|
import { assertInstanceOf } from "./utils-Dm0Onkcz.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -214,15 +214,13 @@ async function lookupObjectInternal(identifier, options = {}) {
|
|
|
214
214
|
* @since 1.1.0
|
|
215
215
|
*/
|
|
216
216
|
async function* traverseCollection(collection, options = {}) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
page = await page.getNext(options);
|
|
225
|
-
}
|
|
217
|
+
const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 }).total("millisecond");
|
|
218
|
+
let page = await collection.getFirst(options);
|
|
219
|
+
if (page == null) for await (const item of collection.getItems(options)) yield item;
|
|
220
|
+
else while (page != null) {
|
|
221
|
+
for await (const item of page.getItems(options)) yield item;
|
|
222
|
+
if (interval > 0) await delay(interval);
|
|
223
|
+
page = await page.getNext(options);
|
|
226
224
|
}
|
|
227
225
|
}
|
|
228
226
|
|
|
@@ -412,6 +410,9 @@ test("traverseCollection()", {
|
|
|
412
410
|
new Note({ content: "This is another simple note" }),
|
|
413
411
|
new Note({ content: "This is a third simple note" })
|
|
414
412
|
]);
|
|
413
|
+
const inlinePagedCollection = await lookupObject("https://example.com/inline-paged-collection", options);
|
|
414
|
+
assertInstanceOf(inlinePagedCollection, Collection);
|
|
415
|
+
deepStrictEqual(await Array.fromAsync(traverseCollection(inlinePagedCollection, options)), [new Note({ content: "Inline first note" }), new Note({ content: "Inline second note" })]);
|
|
415
416
|
});
|
|
416
417
|
test("FEP-fe34: lookupObject() cross-origin security", {
|
|
417
418
|
sanitizeResources: false,
|