Unverified Commit 526b3abc authored by Hong Minhee's avatar Hong Minhee
Browse files

OrderedCollection{,Page}.items as orderedItems

parent e6775d22
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
+1151 −210

File changed.

Preview size limit exceeded, changes collapsed.

+15 −2
Original line number Diff line number Diff line
@@ -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) {
@@ -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 `
+6 −1
Original line number Diff line number Diff line
@@ -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";
@@ -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";
+1 −1
Original line number Diff line number Diff line
@@ -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