@fedify/fedify 0.13.0-dev.312 → 0.13.0-dev.313

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGES.md CHANGED
@@ -8,6 +8,12 @@ Version 0.13.0
8
8
 
9
9
  To be released.
10
10
 
11
+ - Added `closed` property to `Question` class in Activity Vocabulary API.
12
+
13
+ - Added `Question.closed` property.
14
+ - `new Question()` constructor now accepts `closed` option.
15
+ - `Question.clone()` method now accepts `closed` option.
16
+
11
17
  - Added `voters` property to `Question` class in Activity Vocabulary API.
12
18
 
13
19
  - Added `Question.voters` property.
@@ -9,8 +9,9 @@ description: |
9
9
  but the direct object is the question itself and therefore it would not
10
10
  contain an `object` property.
11
11
 
12
- Either of the `anyOf` and `oneOf` properties *may* be used to express possible
13
- answers, but a Question object *must not* have both properties.
12
+ Either of the `inclusiveOptions` and `exclusiveOptions` properties *may* be
13
+ used to express possible answers, but a Question object *must not* have both
14
+ properties.
14
15
  defaultContext:
15
16
  - "https://www.w3.org/ns/activitystreams"
16
17
  - "https://w3id.org/security/data-integrity/v1"
@@ -43,6 +44,16 @@ properties:
43
44
  range:
44
45
  - "https://www.w3.org/ns/activitystreams#Object"
45
46
 
47
+ - singularName: closed
48
+ functional: true
49
+ uri: "https://www.w3.org/ns/activitystreams#closed"
50
+ description: |
51
+ Indicates that a question has been closed, and answers are no longer
52
+ accepted.
53
+ range:
54
+ - "http://www.w3.org/2001/XMLSchema#dateTime"
55
+ - "http://www.w3.org/2001/XMLSchema#boolean"
56
+
46
57
  - singularName: voters
47
58
  functional: true
48
59
  uri: "http://joinmastodon.org/ns#votersCount"
@@ -23906,8 +23906,9 @@ export class Profile extends Object {
23906
23906
  * but the direct object is the question itself and therefore it would not
23907
23907
  * contain an `object` property.
23908
23908
  *
23909
- * Either of the `anyOf` and `oneOf` properties *may* be used to express possible
23910
- * answers, but a Question object *must not* have both properties.
23909
+ * Either of the `inclusiveOptions` and `exclusiveOptions` properties *may* be
23910
+ * used to express possible answers, but a Question object *must not* have both
23911
+ * properties.
23911
23912
  */
23912
23913
  export class Question extends IntransitiveActivity {
23913
23914
  /**
@@ -23918,6 +23919,7 @@ export class Question extends IntransitiveActivity {
23918
23919
  }
23919
23920
  #_2N5scKaVEcdYHFmfKYYacAwUhUgQ = [];
23920
23921
  #_2mV6isMTPRKbWdLCjcpiEysq5dAY = [];
23922
+ #_3KronwL8DiiKBRcJFKQPiEHm8xb6 = [];
23921
23923
  #_3H4RdST7dxfmghccvE3rKD3KgcxG = [];
23922
23924
  /**
23923
23925
  * Constructs a new instance of Question with the given values.
@@ -23948,6 +23950,17 @@ export class Question extends IntransitiveActivity {
23948
23950
  "Object | URL" + ".");
23949
23951
  }
23950
23952
  }
23953
+ if ("closed" in values && values.closed != null) {
23954
+ if (values.closed instanceof dntShim.Temporal.Instant ||
23955
+ typeof values.closed === "boolean") {
23956
+ // @ts-ignore: type is checked above.
23957
+ this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6 = [values.closed];
23958
+ }
23959
+ else {
23960
+ throw new TypeError("The closed must be of type " +
23961
+ "Temporal.Instant | boolean" + ".");
23962
+ }
23963
+ }
23951
23964
  if ("voters" in values && values.voters != null) {
23952
23965
  if (typeof values.voters === "number" && Number.isInteger(values.voters) &&
23953
23966
  values.voters >= 0) {
@@ -23992,6 +24005,18 @@ export class Question extends IntransitiveActivity {
23992
24005
  "Object | URL" + ".");
23993
24006
  }
23994
24007
  }
24008
+ clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6 = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6;
24009
+ if ("closed" in values && values.closed != null) {
24010
+ if (values.closed instanceof dntShim.Temporal.Instant ||
24011
+ typeof values.closed === "boolean") {
24012
+ // @ts-ignore: type is checked above.
24013
+ clone.#_3KronwL8DiiKBRcJFKQPiEHm8xb6 = [values.closed];
24014
+ }
24015
+ else {
24016
+ throw new TypeError("The closed must be of type " +
24017
+ "Temporal.Instant | boolean" + ".");
24018
+ }
24019
+ }
23995
24020
  clone.#_3H4RdST7dxfmghccvE3rKD3KgcxG = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG;
23996
24021
  if ("voters" in values && values.voters != null) {
23997
24022
  if (typeof values.voters === "number" && Number.isInteger(values.voters) &&
@@ -24114,6 +24139,14 @@ export class Question extends IntransitiveActivity {
24114
24139
  yield v;
24115
24140
  }
24116
24141
  }
24142
+ /** Indicates that a question has been closed, and answers are no longer
24143
+ * accepted.
24144
+ */
24145
+ get closed() {
24146
+ if (this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6.length < 1)
24147
+ return null;
24148
+ return this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6[0];
24149
+ }
24117
24150
  /** How many people have voted in the poll. Distinct from how many votes have
24118
24151
  * been cast (in the case of multiple-choice polls).
24119
24152
  */
@@ -24159,6 +24192,19 @@ export class Question extends IntransitiveActivity {
24159
24192
  values["https://www.w3.org/ns/activitystreams#anyOf"] = array;
24160
24193
  }
24161
24194
  array = [];
24195
+ for (const v of this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6) {
24196
+ const element = v instanceof dntShim.Temporal.Instant
24197
+ ? {
24198
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
24199
+ "@value": v.toString(),
24200
+ }
24201
+ : { "@value": v };
24202
+ array.push(element);
24203
+ }
24204
+ if (array.length > 0) {
24205
+ values["https://www.w3.org/ns/activitystreams#closed"] = array;
24206
+ }
24207
+ array = [];
24162
24208
  for (const v of this.#_3H4RdST7dxfmghccvE3rKD3KgcxG) {
24163
24209
  const element = {
24164
24210
  "@type": "http://www.w3.org/2001/XMLSchema#nonNegativeInteger",
@@ -24280,6 +24326,29 @@ export class Question extends IntransitiveActivity {
24280
24326
  _2mV6isMTPRKbWdLCjcpiEysq5dAY.push(await Object.fromJsonLd(v, options));
24281
24327
  }
24282
24328
  instance.#_2mV6isMTPRKbWdLCjcpiEysq5dAY = _2mV6isMTPRKbWdLCjcpiEysq5dAY;
24329
+ const _3KronwL8DiiKBRcJFKQPiEHm8xb6 = [];
24330
+ const _3KronwL8DiiKBRcJFKQPiEHm8xb6__array = values["https://www.w3.org/ns/activitystreams#closed"];
24331
+ for (const v of _3KronwL8DiiKBRcJFKQPiEHm8xb6__array == null
24332
+ ? []
24333
+ : _3KronwL8DiiKBRcJFKQPiEHm8xb6__array.length === 1 &&
24334
+ "@list" in _3KronwL8DiiKBRcJFKQPiEHm8xb6__array[0]
24335
+ ? _3KronwL8DiiKBRcJFKQPiEHm8xb6__array[0]["@list"]
24336
+ : _3KronwL8DiiKBRcJFKQPiEHm8xb6__array) {
24337
+ if (v == null)
24338
+ continue;
24339
+ const decoded = typeof v === "object" && "@type" in v &&
24340
+ "@value" in v && typeof v["@value"] === "string" &&
24341
+ v["@type"] === "http://www.w3.org/2001/XMLSchema#dateTime"
24342
+ ? dntShim.Temporal.Instant.from(v["@value"])
24343
+ : typeof v === "object" && "@value" in v &&
24344
+ typeof v["@value"] === "boolean"
24345
+ ? v["@value"]
24346
+ : undefined;
24347
+ if (typeof decoded === "undefined")
24348
+ continue;
24349
+ _3KronwL8DiiKBRcJFKQPiEHm8xb6.push(decoded);
24350
+ }
24351
+ instance.#_3KronwL8DiiKBRcJFKQPiEHm8xb6 = _3KronwL8DiiKBRcJFKQPiEHm8xb6;
24283
24352
  const _3H4RdST7dxfmghccvE3rKD3KgcxG = [];
24284
24353
  const _3H4RdST7dxfmghccvE3rKD3KgcxG__array = values["http://joinmastodon.org/ns#votersCount"];
24285
24354
  for (const v of _3H4RdST7dxfmghccvE3rKD3KgcxG__array == null
@@ -24323,6 +24392,17 @@ export class Question extends IntransitiveActivity {
24323
24392
  _2mV6isMTPRKbWdLCjcpiEysq5dAY.length > 0) {
24324
24393
  proxy.inclusiveOptions = _2mV6isMTPRKbWdLCjcpiEysq5dAY;
24325
24394
  }
24395
+ const _3KronwL8DiiKBRcJFKQPiEHm8xb6 = this.#_3KronwL8DiiKBRcJFKQPiEHm8xb6
24396
+ // deno-lint-ignore no-explicit-any
24397
+ .map((v) => v instanceof URL
24398
+ ? {
24399
+ [Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
24400
+ [Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
24401
+ }
24402
+ : v);
24403
+ if (_3KronwL8DiiKBRcJFKQPiEHm8xb6.length == 1) {
24404
+ proxy.closed = _3KronwL8DiiKBRcJFKQPiEHm8xb6[0];
24405
+ }
24326
24406
  const _3H4RdST7dxfmghccvE3rKD3KgcxG = this.#_3H4RdST7dxfmghccvE3rKD3KgcxG
24327
24407
  // deno-lint-ignore no-explicit-any
24328
24408
  .map((v) => v instanceof URL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "0.13.0-dev.312+fdc60db3",
3
+ "version": "0.13.0-dev.313+a50df0be",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -8903,8 +8903,9 @@ export declare class Profile extends Object {
8903
8903
  * but the direct object is the question itself and therefore it would not
8904
8904
  * contain an `object` property.
8905
8905
  *
8906
- * Either of the `anyOf` and `oneOf` properties *may* be used to express possible
8907
- * answers, but a Question object *must not* have both properties.
8906
+ * Either of the `inclusiveOptions` and `exclusiveOptions` properties *may* be
8907
+ * used to express possible answers, but a Question object *must not* have both
8908
+ * properties.
8908
8909
  */
8909
8910
  export declare class Question extends IntransitiveActivity {
8910
8911
  #private;
@@ -8977,6 +8978,7 @@ export declare class Question extends IntransitiveActivity {
8977
8978
  instruments?: (Object | URL)[];
8978
8979
  exclusiveOptions?: (Object | URL)[];
8979
8980
  inclusiveOptions?: (Object | URL)[];
8981
+ closed?: dntShim.Temporal.Instant | boolean | null;
8980
8982
  voters?: number | null;
8981
8983
  }, { documentLoader, contextLoader, }?: {
8982
8984
  documentLoader?: DocumentLoader;
@@ -9048,6 +9050,7 @@ export declare class Question extends IntransitiveActivity {
9048
9050
  instruments?: (Object | URL)[];
9049
9051
  exclusiveOptions?: (Object | URL)[];
9050
9052
  inclusiveOptions?: (Object | URL)[];
9053
+ closed?: dntShim.Temporal.Instant | boolean | null;
9051
9054
  voters?: number | null;
9052
9055
  }, options?: {
9053
9056
  documentLoader?: DocumentLoader;
@@ -9083,6 +9086,10 @@ export declare class Question extends IntransitiveActivity {
9083
9086
  contextLoader?: DocumentLoader;
9084
9087
  suppressError?: boolean;
9085
9088
  }): AsyncIterable<Object>;
9089
+ /** Indicates that a question has been closed, and answers are no longer
9090
+ * accepted.
9091
+ */
9092
+ get closed(): dntShim.Temporal.Instant | boolean | null;
9086
9093
  /** How many people have voted in the poll. Distinct from how many votes have
9087
9094
  * been cast (in the case of multiple-choice polls).
9088
9095
  */