@fedify/vocab 2.0.0-dev.241 → 2.0.0-dev.323

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab",
3
- "version": "2.0.0-dev.241+58c8126c",
3
+ "version": "2.0.0-dev.323+1d796545",
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 --check scripts/codegen.ts && deno fmt src/vocab.ts && deno cache src/vocab.ts && deno check src/vocab.ts",
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
  }
@@ -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-BmxSLhXr.js";
7
- import { deno_default, esm_default } from "./deno-BcC99yBa.js";
6
+ import { Application, Group, Organization, Person, Service, test } from "./vocab-B4nUNXTL.js";
7
+ import { deno_default, esm_default } from "./deno-CpsTU8-l.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-dev.241+58c8126c";
1243
+ var version = "2.0.0-dev.323+1d796545";
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 --check scripts/codegen.ts && deno fmt src/vocab.ts && deno cache src/vocab.ts && deno check src/vocab.ts",
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
 
@@ -2,14 +2,15 @@
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-BmxSLhXr.js";
6
- import { deno_default, esm_default } from "./deno-BcC99yBa.js";
5
+ import { Collection, Note, Object as Object$1, Person, createTestTracerProvider, mockDocumentLoader, test } from "./vocab-B4nUNXTL.js";
6
+ import { deno_default, esm_default } from "./deno-CpsTU8-l.js";
7
7
  import { getTypeId } from "./type-Dnf0m2yO.js";
8
8
  import { assertInstanceOf } from "./utils-Dm0Onkcz.js";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { SpanStatusCode, trace } from "@opentelemetry/api";
11
11
  import { deepStrictEqual, equal, ok, rejects } from "node:assert/strict";
12
12
  import { lookupWebFinger } from "@fedify/webfinger";
13
+ import { getDocumentLoader } from "@fedify/vocab-runtime";
13
14
  import { delay } from "es-toolkit";
14
15
 
15
16
  //#region src/handle.ts
@@ -214,15 +215,13 @@ async function lookupObjectInternal(identifier, options = {}) {
214
215
  * @since 1.1.0
215
216
  */
216
217
  async function* traverseCollection(collection, options = {}) {
217
- if (collection.firstId == null) for await (const item of collection.getItems(options)) yield item;
218
- else {
219
- const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 }).total("millisecond");
220
- let page = await collection.getFirst(options);
221
- while (page != null) {
222
- for await (const item of page.getItems(options)) yield item;
223
- if (interval > 0) await delay(interval);
224
- page = await page.getNext(options);
225
- }
218
+ const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 }).total("millisecond");
219
+ let page = await collection.getFirst(options);
220
+ if (page == null) for await (const item of collection.getItems(options)) yield item;
221
+ else while (page != null) {
222
+ for await (const item of page.getItems(options)) yield item;
223
+ if (interval > 0) await delay(interval);
224
+ page = await page.getNext(options);
226
225
  }
227
226
  }
228
227
 
@@ -412,6 +411,9 @@ test("traverseCollection()", {
412
411
  new Note({ content: "This is another simple note" }),
413
412
  new Note({ content: "This is a third simple note" })
414
413
  ]);
414
+ const inlinePagedCollection = await lookupObject("https://example.com/inline-paged-collection", options);
415
+ assertInstanceOf(inlinePagedCollection, Collection);
416
+ deepStrictEqual(await Array.fromAsync(traverseCollection(inlinePagedCollection, options)), [new Note({ content: "Inline first note" }), new Note({ content: "Inline second note" })]);
415
417
  });
416
418
  test("FEP-fe34: lookupObject() cross-origin security", {
417
419
  sanitizeResources: false,