Loading CHANGES.md +19 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ Version 1.1.21 To be released. - Activity Vocabulary API became to accept [RFC 3339] date-time strings without a timezone offset. This is not a bug fix, but improves interoperability with some implementations that do not include a timezone offset in their date-time strings including WordPress. [[#226]] - Added the following default context to `Undo` class: ~~~~ json Loading Loading @@ -427,6 +432,20 @@ Released on October 20, 2024. [#150]: https://github.com/dahlia/fedify/issues/150 Version 1.0.24 -------------- Released on April 8, 2025. - Activity Vocabulary API became to accept [RFC 3339] date-time strings without a timezone offset. This is not a bug fix, but improves interoperability with some implementations that do not include a timezone offset in their date-time strings including WordPress. [[#226]] [RFC 3339]: https://datatracker.ietf.org/doc/html/rfc3339 [#226]: https://github.com/fedify-dev/fedify/issues/226 Version 1.0.23 -------------- Loading src/codegen/__snapshots__/class.test.ts.snap +38 −7 Original line number Diff line number Diff line Loading @@ -5282,7 +5282,11 @@ get urls(): ((URL | Link))[] { : _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime__array ) { if (v == null) continue; _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.push(Temporal.Instant.from(v[\\"@value\\"])) _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; const _86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; Loading Loading @@ -5497,7 +5501,11 @@ get urls(): ((URL | Link))[] { : _5e258TDXtuhaFRPZiGoDfEpjdMr_published__array ) { if (v == null) continue; _5e258TDXtuhaFRPZiGoDfEpjdMr_published.push(Temporal.Instant.from(v[\\"@value\\"])) _5e258TDXtuhaFRPZiGoDfEpjdMr_published.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = _5e258TDXtuhaFRPZiGoDfEpjdMr_published; const _7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; Loading Loading @@ -5538,7 +5546,11 @@ get urls(): ((URL | Link))[] { : _2w3Jmue4up8iVDUA51WZqomEF438_startTime__array ) { if (v == null) continue; _2w3Jmue4up8iVDUA51WZqomEF438_startTime.push(Temporal.Instant.from(v[\\"@value\\"])) _2w3Jmue4up8iVDUA51WZqomEF438_startTime.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = _2w3Jmue4up8iVDUA51WZqomEF438_startTime; const _4LqirZspQbFWWQEbFcXAxm7tTDN1_summary: ((string | LanguageString))[] = []; Loading Loading @@ -5614,7 +5626,11 @@ get urls(): ((URL | Link))[] { : _385aB7ySixcf5Un6z3VsWmThgCzQ_updated__array ) { if (v == null) continue; _385aB7ySixcf5Un6z3VsWmThgCzQ_updated.push(Temporal.Instant.from(v[\\"@value\\"])) _385aB7ySixcf5Un6z3VsWmThgCzQ_updated.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = _385aB7ySixcf5Un6z3VsWmThgCzQ_updated; const _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url: ((URL | Link))[] = []; Loading Loading @@ -11219,7 +11235,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | : _3qzP3ukEZoUziK5FEiA1RhU4aqac__array ) { if (v == null) continue; _3qzP3ukEZoUziK5FEiA1RhU4aqac.push(Temporal.Instant.from(v[\\"@value\\"])) _3qzP3ukEZoUziK5FEiA1RhU4aqac.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = _3qzP3ukEZoUziK5FEiA1RhU4aqac; Loading Loading @@ -44581,7 +44601,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = typeof v === \\"object\\" && \\"@type\\" in v && \\"@value\\" in v && typeof v[\\"@value\\"] === \\"string\\" && v[\\"@type\\"] === \\"http://www.w3.org/2001/XMLSchema#dateTime\\" ? Temporal.Instant.from(v[\\"@value\\"]) : typeof v === \\"object\\" && \\"@value\\" in v && v[\\"@type\\"] === \\"http://www.w3.org/2001/XMLSchema#dateTime\\" // Check if the value is a valid RFC 3339 date-time string && new Date(v[\\"@value\\"]).toString() !== \\"Invalid Date\\" ? Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" ) : typeof v === \\"object\\" && \\"@value\\" in v && typeof v[\\"@value\\"] === \\"boolean\\" ? v[\\"@value\\"] : undefined ; if (typeof decoded === \\"undefined\\") continue; Loading Loading @@ -52132,7 +52159,11 @@ proofs?: (DataIntegrityProof | URL)[];deleted?: Temporal.Instant | null;} : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array ) { if (v == null) continue; _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(Temporal.Instant.from(v[\\"@value\\"])) _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted; src/codegen/type.ts +9 −2 Original line number Diff line number Diff line Loading @@ -184,10 +184,17 @@ const scalarTypes: Record<string, ScalarType> = { dataCheck(v) { return `typeof ${v} === "object" && "@type" in ${v} && "@value" in ${v} && typeof ${v}["@value"] === "string" && ${v}["@type"] === "http://www.w3.org/2001/XMLSchema#dateTime"`; && ${v}["@type"] === "http://www.w3.org/2001/XMLSchema#dateTime" // Check if the value is a valid RFC 3339 date-time string && new Date(${v}["@value"]).toString() !== "Invalid Date" `; }, decoder(v) { return `Temporal.Instant.from(${v}["@value"])`; return `Temporal.Instant.from( ${v}["@value"].substring(19).match(/[Z+-]/) ? ${v}["@value"] : ${v}["@value"] + "Z" )`; }, }, "http://www.w3.org/2001/XMLSchema#duration": { Loading src/vocab/vocab.test.ts +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ test("Object.fromJsonLd()", async () => { "content": "Hello", "mediaType": "text/plain", }, "published": "2025-01-01 12:34:56", }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); assertInstanceOf(obj, Object); assertEquals(obj.name, "Test"); Loading @@ -153,6 +154,7 @@ test("Object.fromJsonLd()", async () => { assertInstanceOf(obj.source, Source); assertEquals(obj.source.content, "Hello"); assertEquals(obj.source.mediaType, "text/plain"); assertEquals(obj.published, Temporal.Instant.from("2025-01-01T12:34:56Z")); const createJsonLd = { "@context": "https://www.w3.org/ns/activitystreams", Loading Loading
CHANGES.md +19 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ Version 1.1.21 To be released. - Activity Vocabulary API became to accept [RFC 3339] date-time strings without a timezone offset. This is not a bug fix, but improves interoperability with some implementations that do not include a timezone offset in their date-time strings including WordPress. [[#226]] - Added the following default context to `Undo` class: ~~~~ json Loading Loading @@ -427,6 +432,20 @@ Released on October 20, 2024. [#150]: https://github.com/dahlia/fedify/issues/150 Version 1.0.24 -------------- Released on April 8, 2025. - Activity Vocabulary API became to accept [RFC 3339] date-time strings without a timezone offset. This is not a bug fix, but improves interoperability with some implementations that do not include a timezone offset in their date-time strings including WordPress. [[#226]] [RFC 3339]: https://datatracker.ietf.org/doc/html/rfc3339 [#226]: https://github.com/fedify-dev/fedify/issues/226 Version 1.0.23 -------------- Loading
src/codegen/__snapshots__/class.test.ts.snap +38 −7 Original line number Diff line number Diff line Loading @@ -5282,7 +5282,11 @@ get urls(): ((URL | Link))[] { : _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime__array ) { if (v == null) continue; _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.push(Temporal.Instant.from(v[\\"@value\\"])) _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_219RwDanjScTv5tYCjwGZVCM7KZ9_endTime = _219RwDanjScTv5tYCjwGZVCM7KZ9_endTime; const _86xFhmgBapoMvYqjbjRuDPayTrS_generator: (Object | Link | URL)[] = []; Loading Loading @@ -5497,7 +5501,11 @@ get urls(): ((URL | Link))[] { : _5e258TDXtuhaFRPZiGoDfEpjdMr_published__array ) { if (v == null) continue; _5e258TDXtuhaFRPZiGoDfEpjdMr_published.push(Temporal.Instant.from(v[\\"@value\\"])) _5e258TDXtuhaFRPZiGoDfEpjdMr_published.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_5e258TDXtuhaFRPZiGoDfEpjdMr_published = _5e258TDXtuhaFRPZiGoDfEpjdMr_published; const _7UpwM3JWcXhADcscukEehBorf6k_replies: (Collection | URL)[] = []; Loading Loading @@ -5538,7 +5546,11 @@ get urls(): ((URL | Link))[] { : _2w3Jmue4up8iVDUA51WZqomEF438_startTime__array ) { if (v == null) continue; _2w3Jmue4up8iVDUA51WZqomEF438_startTime.push(Temporal.Instant.from(v[\\"@value\\"])) _2w3Jmue4up8iVDUA51WZqomEF438_startTime.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_2w3Jmue4up8iVDUA51WZqomEF438_startTime = _2w3Jmue4up8iVDUA51WZqomEF438_startTime; const _4LqirZspQbFWWQEbFcXAxm7tTDN1_summary: ((string | LanguageString))[] = []; Loading Loading @@ -5614,7 +5626,11 @@ get urls(): ((URL | Link))[] { : _385aB7ySixcf5Un6z3VsWmThgCzQ_updated__array ) { if (v == null) continue; _385aB7ySixcf5Un6z3VsWmThgCzQ_updated.push(Temporal.Instant.from(v[\\"@value\\"])) _385aB7ySixcf5Un6z3VsWmThgCzQ_updated.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_385aB7ySixcf5Un6z3VsWmThgCzQ_updated = _385aB7ySixcf5Un6z3VsWmThgCzQ_updated; const _2oPEH9MQ3aj8JVwyYuWkqoVwV865_url: ((URL | Link))[] = []; Loading Loading @@ -11219,7 +11235,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | : _3qzP3ukEZoUziK5FEiA1RhU4aqac__array ) { if (v == null) continue; _3qzP3ukEZoUziK5FEiA1RhU4aqac.push(Temporal.Instant.from(v[\\"@value\\"])) _3qzP3ukEZoUziK5FEiA1RhU4aqac.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_3qzP3ukEZoUziK5FEiA1RhU4aqac = _3qzP3ukEZoUziK5FEiA1RhU4aqac; Loading Loading @@ -44581,7 +44601,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const decoded = typeof v === \\"object\\" && \\"@type\\" in v && \\"@value\\" in v && typeof v[\\"@value\\"] === \\"string\\" && v[\\"@type\\"] === \\"http://www.w3.org/2001/XMLSchema#dateTime\\" ? Temporal.Instant.from(v[\\"@value\\"]) : typeof v === \\"object\\" && \\"@value\\" in v && v[\\"@type\\"] === \\"http://www.w3.org/2001/XMLSchema#dateTime\\" // Check if the value is a valid RFC 3339 date-time string && new Date(v[\\"@value\\"]).toString() !== \\"Invalid Date\\" ? Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" ) : typeof v === \\"object\\" && \\"@value\\" in v && typeof v[\\"@value\\"] === \\"boolean\\" ? v[\\"@value\\"] : undefined ; if (typeof decoded === \\"undefined\\") continue; Loading Loading @@ -52132,7 +52159,11 @@ proofs?: (DataIntegrityProof | URL)[];deleted?: Temporal.Instant | null;} : _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted__array ) { if (v == null) continue; _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(Temporal.Instant.from(v[\\"@value\\"])) _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted.push(Temporal.Instant.from( v[\\"@value\\"].substring(19).match(/[Z+-]/) ? v[\\"@value\\"] : v[\\"@value\\"] + \\"Z\\" )) } instance.#_8g8g4LiVMhFTXskuDEqx4ascxUr_deleted = _8g8g4LiVMhFTXskuDEqx4ascxUr_deleted;
src/codegen/type.ts +9 −2 Original line number Diff line number Diff line Loading @@ -184,10 +184,17 @@ const scalarTypes: Record<string, ScalarType> = { dataCheck(v) { return `typeof ${v} === "object" && "@type" in ${v} && "@value" in ${v} && typeof ${v}["@value"] === "string" && ${v}["@type"] === "http://www.w3.org/2001/XMLSchema#dateTime"`; && ${v}["@type"] === "http://www.w3.org/2001/XMLSchema#dateTime" // Check if the value is a valid RFC 3339 date-time string && new Date(${v}["@value"]).toString() !== "Invalid Date" `; }, decoder(v) { return `Temporal.Instant.from(${v}["@value"])`; return `Temporal.Instant.from( ${v}["@value"].substring(19).match(/[Z+-]/) ? ${v}["@value"] : ${v}["@value"] + "Z" )`; }, }, "http://www.w3.org/2001/XMLSchema#duration": { Loading
src/vocab/vocab.test.ts +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ test("Object.fromJsonLd()", async () => { "content": "Hello", "mediaType": "text/plain", }, "published": "2025-01-01 12:34:56", }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); assertInstanceOf(obj, Object); assertEquals(obj.name, "Test"); Loading @@ -153,6 +154,7 @@ test("Object.fromJsonLd()", async () => { assertInstanceOf(obj.source, Source); assertEquals(obj.source.content, "Hello"); assertEquals(obj.source.mediaType, "text/plain"); assertEquals(obj.published, Temporal.Instant.from("2025-01-01T12:34:56Z")); const createJsonLd = { "@context": "https://www.w3.org/ns/activitystreams", Loading