@fedify/vocab 2.0.0-dev.279 → 2.0.0-dev.335

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.
@@ -2,9 +2,10 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
 
5
- import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag, LanguageString, Link, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, decodeMultibase, mockDocumentLoader, test, vocab_exports } from "./vocab-fPKUeh35.js";
5
+ import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag, Link, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, mockDocumentLoader, test, vocab_exports } from "./vocab-B4nUNXTL.js";
6
6
  import { assertInstanceOf } from "./utils-Dm0Onkcz.js";
7
7
  import { deepStrictEqual, notDeepStrictEqual, ok, rejects, throws } from "node:assert/strict";
8
+ import { LanguageString, decodeMultibase } from "@fedify/vocab-runtime";
8
9
  import { pascalCase } from "es-toolkit";
9
10
  import { areAllScalarTypes, loadSchemaFiles } from "@fedify/vocab-tools";
10
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab",
3
- "version": "2.0.0-dev.279+ce1bdc22",
3
+ "version": "2.0.0-dev.335+6fe86704",
4
4
  "homepage": "https://fedify.dev/",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,8 +47,9 @@
47
47
  "jsonld": "^9.0.0",
48
48
  "multicodec": "^3.2.1",
49
49
  "pkijs": "^3.3.3",
50
- "@fedify/vocab-tools": "2.0.0-dev.279+ce1bdc22",
51
- "@fedify/webfinger": "2.0.0-dev.279+ce1bdc22"
50
+ "@fedify/webfinger": "2.0.0-dev.335+6fe86704",
51
+ "@fedify/vocab-runtime": "2.0.0-dev.335+6fe86704",
52
+ "@fedify/vocab-tools": "2.0.0-dev.335+6fe86704"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@types/node": "^22.17.0",
@@ -56,8 +57,7 @@
56
57
  "fetch-mock": "^12.5.4",
57
58
  "tsdown": "^0.12.9",
58
59
  "typescript": "^5.9.3",
59
- "@fedify/fixture": "2.0.0",
60
- "@fedify/vocab-runtime": "2.0.0-dev.279+ce1bdc22"
60
+ "@fedify/fixture": "2.0.0"
61
61
  },
62
62
  "keywords": [
63
63
  "Fedify",
@@ -267,6 +267,21 @@ test("traverseCollection()", {
267
267
  new Note({ content: "This is a third simple note" }),
268
268
  ],
269
269
  );
270
+ // Inline-paged collection (CollectionPage embedded without id, with next)
271
+ const inlinePagedCollection = await lookupObject(
272
+ "https://example.com/inline-paged-collection",
273
+ options,
274
+ );
275
+ assertInstanceOf(inlinePagedCollection, Collection);
276
+ deepStrictEqual(
277
+ await Array.fromAsync(
278
+ traverseCollection(inlinePagedCollection, options),
279
+ ),
280
+ [
281
+ new Note({ content: "Inline first note" }),
282
+ new Note({ content: "Inline second note" }),
283
+ ],
284
+ );
270
285
  });
271
286
 
272
287
  test("FEP-fe34: lookupObject() cross-origin security", {
package/src/lookup.ts CHANGED
@@ -299,14 +299,14 @@ export async function* traverseCollection(
299
299
  collection: Collection,
300
300
  options: TraverseCollectionOptions = {},
301
301
  ): AsyncIterable<Object | Link> {
302
- if (collection.firstId == null) {
302
+ const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 })
303
+ .total("millisecond");
304
+ let page = await collection.getFirst(options);
305
+ if (page == null) {
303
306
  for await (const item of collection.getItems(options)) {
304
307
  yield item;
305
308
  }
306
309
  } else {
307
- const interval = Temporal.Duration.from(options.interval ?? { seconds: 0 })
308
- .total("millisecond");
309
- let page = await collection.getFirst(options);
310
310
  while (page != null) {
311
311
  for await (const item of page.getItems(options)) {
312
312
  yield item;
package/src/mod.ts CHANGED
@@ -55,3 +55,9 @@ export * from "./handle.ts";
55
55
  export * from "./lookup.ts";
56
56
  export * from "./type.ts";
57
57
  export * from "./vocab.ts";
58
+ export { LanguageString } from "@fedify/vocab-runtime";
59
+ export type {
60
+ DocumentLoader,
61
+ GetUserAgentOptions,
62
+ RemoteDocument,
63
+ } from "@fedify/vocab-runtime";