Loading CHANGES.md +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ To be released. - `Activity.clone()` method now accepts `instrument` option. - `Activity.clone()` method now accepts `instruments` option. - The `items` property of `OrderedCollection` and `OrderedCollectionPage` in Activity Vocabulary API is now represented as `orderedItems` (was `items`) in JSON-LD. - The key pair or the key pair for signing outgoing HTTP requests made from the shared inbox now can be configured. This improves the compatibility with other ActivityPub implementations that require authorized fetches Loading codegen/__snapshots__/class.test.ts.snap +1151 −210 File changed.Preview size limit exceeded, changes collapsed. Show changes codegen/codec.ts +15 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,10 @@ export async function* generateEncoder( ...options, expand: true, }) as unknown[]; const values = baseValues[0] as Record<string, unknown[] | string>; const values = baseValues[0] as Record< string, unknown[] | { "@list": unknown[] } | string >; `; } for (const property of type.properties) { Loading @@ -63,7 +66,17 @@ export async function* generateEncoder( } yield `; } if (array.length > 0) values[${JSON.stringify(property.uri)}] = array; if (array.length > 0) { values[${JSON.stringify(property.uri)}] = ( `; if (!property.functional && property.container === "list") { yield `{ "@list": array }`; } else { yield `array`; } yield ` ); } `; } yield ` Loading codegen/constructor.ts +6 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ async function* generateParametersType( typeUri: string, types: Record<string, TypeSchema>, parentheses = true, excludeProperties: string[] = [], ): AsyncIterable<string> { const type = types[typeUri]; if (parentheses) yield "{\n"; Loading @@ -47,12 +48,16 @@ async function* generateParametersType( yield `id?: URL | null;\n`; } else { for await ( const code of generateParametersType(type.extends, types, false) const code of generateParametersType(type.extends, types, false, [ ...excludeProperties, ...type.properties.map((p) => p.singularName), ]) ) { yield code; } } for (const property of type.properties) { if (excludeProperties.includes(property.singularName)) continue; yield generateParameterType(property, types); } if (parentheses) yield "}\n"; Loading codegen/schema.ts +1 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ export type PropertySchema = /** * The container type of the property values. It can be unspecified. */ container?: "graph"; container?: "graph" | "list"; } | PropertySchemaBase & PropertySchemaTyping & { /** Loading Loading
CHANGES.md +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ To be released. - `Activity.clone()` method now accepts `instrument` option. - `Activity.clone()` method now accepts `instruments` option. - The `items` property of `OrderedCollection` and `OrderedCollectionPage` in Activity Vocabulary API is now represented as `orderedItems` (was `items`) in JSON-LD. - The key pair or the key pair for signing outgoing HTTP requests made from the shared inbox now can be configured. This improves the compatibility with other ActivityPub implementations that require authorized fetches Loading
codegen/__snapshots__/class.test.ts.snap +1151 −210 File changed.Preview size limit exceeded, changes collapsed. Show changes
codegen/codec.ts +15 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,10 @@ export async function* generateEncoder( ...options, expand: true, }) as unknown[]; const values = baseValues[0] as Record<string, unknown[] | string>; const values = baseValues[0] as Record< string, unknown[] | { "@list": unknown[] } | string >; `; } for (const property of type.properties) { Loading @@ -63,7 +66,17 @@ export async function* generateEncoder( } yield `; } if (array.length > 0) values[${JSON.stringify(property.uri)}] = array; if (array.length > 0) { values[${JSON.stringify(property.uri)}] = ( `; if (!property.functional && property.container === "list") { yield `{ "@list": array }`; } else { yield `array`; } yield ` ); } `; } yield ` Loading
codegen/constructor.ts +6 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ async function* generateParametersType( typeUri: string, types: Record<string, TypeSchema>, parentheses = true, excludeProperties: string[] = [], ): AsyncIterable<string> { const type = types[typeUri]; if (parentheses) yield "{\n"; Loading @@ -47,12 +48,16 @@ async function* generateParametersType( yield `id?: URL | null;\n`; } else { for await ( const code of generateParametersType(type.extends, types, false) const code of generateParametersType(type.extends, types, false, [ ...excludeProperties, ...type.properties.map((p) => p.singularName), ]) ) { yield code; } } for (const property of type.properties) { if (excludeProperties.includes(property.singularName)) continue; yield generateParameterType(property, types); } if (parentheses) yield "}\n"; Loading
codegen/schema.ts +1 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ export type PropertySchema = /** * The container type of the property values. It can be unspecified. */ container?: "graph"; container?: "graph" | "list"; } | PropertySchemaBase & PropertySchemaTyping & { /** Loading