Unverified Commit a3f56b91 authored by Hong Minhee's avatar Hong Minhee
Browse files

Add sensitive property to Object class

parent 41c77142
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -47,6 +47,12 @@ To be released.
     -  `Object.clone()` method's `images` option no more accepts `Link`
        objects.

 -  Added `sensitive` property to `Object` class.

     -  `new Object()` constructor now accepts `sensitive` option.
     -  Added `Object.sensitive` attribute.
     -  `Object.clone()` method now accepts `sensitive` option.

 -  Now `lookupWebFinger()` follows redirections.

[Fresh]: https://fresh.deno.dev/
+112 −77

File changed.

Preview size limit exceeded, changes collapsed.

+141 −27

File changed.

Preview size limit exceeded, changes collapsed.

+10 −1
Original line number Diff line number Diff line
@@ -8,7 +8,9 @@ description: |
  including other Core types such as {@link Activity},
  {@link IntransitiveActivity}, {@link Collection} and
  {@link OrderedCollection}.
defaultContext: "https://www.w3.org/ns/activitystreams"
defaultContext:
- "https://www.w3.org/ns/activitystreams"
- sensitive: "as:sensitive"

properties:
- pluralName: attachments
@@ -286,3 +288,10 @@ properties:
    3.3.6 (e.g. a period of 5 seconds is represented as `PT5S`).
  range:
  - "http://www.w3.org/2001/XMLSchema#duration"

- singularName: sensitive
  functional: true
  uri: "https://www.w3.org/ns/activitystreams#sensitive"
  description: Whether it contains any sensitive contents.
  range:
  - "http://www.w3.org/2001/XMLSchema#boolean"
+9 −6
Original line number Diff line number Diff line
@@ -132,12 +132,15 @@ Deno.test("Object.toJsonLd()", async () => {
    ],
  );
  assertEquals(await obj.toJsonLd({ documentLoader: mockDocumentLoader }), {
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Object",
    "name": "Test",
    "contentMap": {
      "en": "Hello",
      "zh": "你好",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      { sensitive: "as:sensitive" },
    ],
    type: "Object",
    name: "Test",
    contentMap: {
      en: "Hello",
      zh: "你好",
    },
  });
});