@fedify/fedify 0.11.0-dev.223 → 0.11.0-dev.228
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGES.md +4 -0
- package/FEDERATION.md +1 -0
- package/README.md +3 -3
- package/esm/vocab/actor.js +2 -2
- package/esm/vocab/lookup.js +3 -3
- package/esm/vocab/offer.yaml +13 -0
- package/esm/vocab/vocab.js +129 -0
- package/package.json +1 -1
- package/types/vocab/actor.d.ts +2 -2
- package/types/vocab/lookup.d.ts +3 -3
- package/types/vocab/vocab.d.ts +149 -0
- package/types/vocab/vocab.d.ts.map +1 -1
package/CHANGES.md
CHANGED
@@ -22,7 +22,11 @@ To be released.
|
|
22
22
|
- The default `rules` for `kvCache()` function are now 5 minutes for all
|
23
23
|
URLs.
|
24
24
|
|
25
|
+
- Added `Offer` class to Activity Vocabulary API.
|
26
|
+
[[#65], [#76]]
|
27
|
+
|
25
28
|
[#74]: https://github.com/dahlia/fedify/issues/74
|
29
|
+
[#76]: https://github.com/dahlia/fedify/pull/76
|
26
30
|
|
27
31
|
|
28
32
|
Version 0.10.0
|
package/FEDERATION.md
CHANGED
@@ -57,6 +57,7 @@ lists the activity types that Fedify provides:
|
|
57
57
|
- [`Follow`](https://jsr.io/@fedify/fedify/doc/vocab/~/Follow)
|
58
58
|
- [`Ignore`](https://jsr.io/@fedify/fedify/doc/vocab/~/Ignore)
|
59
59
|
- [`Like`](https://jsr.io/@fedify/fedify/doc/vocab/~/Like)
|
60
|
+
- [`Offer`](https://jsr.io/@fedify/fedify/doc/vocab/~/Offer)
|
60
61
|
- [`Question`](https://jsr.io/@fedify/fedify/doc/vocab/~/Question)
|
61
62
|
- [`Reject`](https://jsr.io/@fedify/fedify/doc/vocab/~/Reject)
|
62
63
|
- [`Remove`](https://jsr.io/@fedify/fedify/doc/vocab/~/Remove)
|
package/README.md
CHANGED
@@ -8,7 +8,7 @@ Fedify: an ActivityPub server framework
|
|
8
8
|
[![npm][npm badge]][npm]
|
9
9
|
[![GitHub Actions][GitHub Actions badge]][GitHub Actions]
|
10
10
|
[![Matrix][Matrix badge]][Matrix]
|
11
|
-
[![Follow @hongminhee@
|
11
|
+
[![Follow @hongminhee@fosstodon.org][@hongminhee@fosstodon.org badge]][@hongminhee@fosstodon.org]
|
12
12
|
|
13
13
|
> [!NOTE]
|
14
14
|
> Looking for a quick demo? Here it is: [Fedify Demo] on Deno Playground.
|
@@ -54,8 +54,8 @@ join our [Matrix chat space][Matrix] or [GitHub Discussions]. Or tag
|
|
54
54
|
[GitHub Actions badge]: https://github.com/dahlia/fedify/actions/workflows/build.yaml/badge.svg
|
55
55
|
[Matrix]: https://matrix.to/#/#fedify:matrix.org
|
56
56
|
[Matrix badge]: https://img.shields.io/matrix/fedify%3Amatrix.org
|
57
|
-
[@hongminhee.
|
58
|
-
[@hongminhee.
|
57
|
+
[@hongminhee@fosstodon.org badge]: https://fedi-badge.deno.dev/@hongminhee@fosstodon.org/followers.svg
|
58
|
+
[@hongminhee@fosstodon.org]: https://fosstodon.org/@hongminhee
|
59
59
|
[Fedify Demo]: https://dash.deno.com/playground/fedify-demo
|
60
60
|
[ActivityPub]: https://www.w3.org/TR/activitypub/
|
61
61
|
[fediverse]: https://en.wikipedia.org/wiki/Fediverse
|
package/esm/vocab/actor.js
CHANGED
@@ -59,11 +59,11 @@ export function getActorClassByTypeName(typeName) {
|
|
59
59
|
* ``` typescript
|
60
60
|
* // Get the handle of an actor object:
|
61
61
|
* await getActorHandle(
|
62
|
-
* new Person({ id: new URL("https://
|
62
|
+
* new Person({ id: new URL("https://fosstodon.org/users/hongminhee") })
|
63
63
|
* );
|
64
64
|
*
|
65
65
|
* // Get the handle of an actor URI:
|
66
|
-
* await getActorHandle(new URL("https://
|
66
|
+
* await getActorHandle(new URL("https://fosstodon.org/users/hongminhee"));
|
67
67
|
* ```
|
68
68
|
*
|
69
69
|
* @param actor The actor or actor URI to get the handle from.
|
package/esm/vocab/lookup.js
CHANGED
@@ -11,15 +11,15 @@ const handleRegexp = /^@?((?:[-A-Za-z0-9._~!$&'()*+,;=]|%[A-Fa-f0-9]{2})+)@([^@]
|
|
11
11
|
* @example
|
12
12
|
* ``` typescript
|
13
13
|
* // Look up an actor by its fediverse handle:
|
14
|
-
* await lookupObject("@hongminhee@
|
14
|
+
* await lookupObject("@hongminhee@fosstodon.org");
|
15
15
|
* // returning a `Person` object.
|
16
16
|
*
|
17
17
|
* // A fediverse handle can omit the leading '@':
|
18
|
-
* await lookupObject("hongminhee@
|
18
|
+
* await lookupObject("hongminhee@fosstodon.org");
|
19
19
|
* // returning a `Person` object.
|
20
20
|
*
|
21
21
|
* // A `acct:` URI can be used as well:
|
22
|
-
* await lookupObject("acct:hongminhee@
|
22
|
+
* await lookupObject("acct:hongminhee@fosstodon.org");
|
23
23
|
* // returning a `Person` object.
|
24
24
|
*
|
25
25
|
* // Look up an object by its URI:
|
@@ -0,0 +1,13 @@
|
|
1
|
+
$schema: ../codegen/schema.yaml
|
2
|
+
name: Offer
|
3
|
+
uri: "https://www.w3.org/ns/activitystreams#Offer"
|
4
|
+
extends: "https://www.w3.org/ns/activitystreams#Activity"
|
5
|
+
entity: true
|
6
|
+
description: |
|
7
|
+
Indicates that the actor is offering the object.
|
8
|
+
If specified, the target indicates the entity to which
|
9
|
+
the object is being offered.
|
10
|
+
defaultContext:
|
11
|
+
- "https://www.w3.org/ns/activitystreams"
|
12
|
+
- "https://w3id.org/security/data-integrity/v1"
|
13
|
+
properties: []
|
package/esm/vocab/vocab.js
CHANGED
@@ -2210,6 +2210,10 @@ export class Object {
|
|
2210
2210
|
delete values["@type"];
|
2211
2211
|
return await Like.fromJsonLd(values, options);
|
2212
2212
|
}
|
2213
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
|
2214
|
+
delete values["@type"];
|
2215
|
+
return await Offer.fromJsonLd(values, options);
|
2216
|
+
}
|
2213
2217
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Reject")) {
|
2214
2218
|
delete values["@type"];
|
2215
2219
|
return await Reject.fromJsonLd(values, options);
|
@@ -2345,6 +2349,7 @@ export class Object {
|
|
2345
2349
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
2346
2350
|
"https://www.w3.org/ns/activitystreams#Question",
|
2347
2351
|
"https://www.w3.org/ns/activitystreams#Like",
|
2352
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
2348
2353
|
"https://www.w3.org/ns/activitystreams#Reject",
|
2349
2354
|
"https://www.w3.org/ns/activitystreams#Remove",
|
2350
2355
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -2484,6 +2489,7 @@ export class Object {
|
|
2484
2489
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
2485
2490
|
"https://www.w3.org/ns/activitystreams#Question",
|
2486
2491
|
"https://www.w3.org/ns/activitystreams#Like",
|
2492
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
2487
2493
|
"https://www.w3.org/ns/activitystreams#Reject",
|
2488
2494
|
"https://www.w3.org/ns/activitystreams#Remove",
|
2489
2495
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -2578,6 +2584,7 @@ export class Object {
|
|
2578
2584
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
2579
2585
|
"https://www.w3.org/ns/activitystreams#Question",
|
2580
2586
|
"https://www.w3.org/ns/activitystreams#Like",
|
2587
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
2581
2588
|
"https://www.w3.org/ns/activitystreams#Reject",
|
2582
2589
|
"https://www.w3.org/ns/activitystreams#Remove",
|
2583
2590
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -2672,6 +2679,7 @@ export class Object {
|
|
2672
2679
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
2673
2680
|
"https://www.w3.org/ns/activitystreams#Question",
|
2674
2681
|
"https://www.w3.org/ns/activitystreams#Like",
|
2682
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
2675
2683
|
"https://www.w3.org/ns/activitystreams#Reject",
|
2676
2684
|
"https://www.w3.org/ns/activitystreams#Remove",
|
2677
2685
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -2742,6 +2750,7 @@ export class Object {
|
|
2742
2750
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
2743
2751
|
"https://www.w3.org/ns/activitystreams#Question",
|
2744
2752
|
"https://www.w3.org/ns/activitystreams#Like",
|
2753
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
2745
2754
|
"https://www.w3.org/ns/activitystreams#Reject",
|
2746
2755
|
"https://www.w3.org/ns/activitystreams#Remove",
|
2747
2756
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -2820,6 +2829,7 @@ export class Object {
|
|
2820
2829
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
2821
2830
|
"https://www.w3.org/ns/activitystreams#Question",
|
2822
2831
|
"https://www.w3.org/ns/activitystreams#Like",
|
2832
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
2823
2833
|
"https://www.w3.org/ns/activitystreams#Reject",
|
2824
2834
|
"https://www.w3.org/ns/activitystreams#Remove",
|
2825
2835
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -2925,6 +2935,7 @@ export class Object {
|
|
2925
2935
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
2926
2936
|
"https://www.w3.org/ns/activitystreams#Question",
|
2927
2937
|
"https://www.w3.org/ns/activitystreams#Like",
|
2938
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
2928
2939
|
"https://www.w3.org/ns/activitystreams#Reject",
|
2929
2940
|
"https://www.w3.org/ns/activitystreams#Remove",
|
2930
2941
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -5229,6 +5240,10 @@ export class Activity extends Object {
|
|
5229
5240
|
delete values["@type"];
|
5230
5241
|
return await Like.fromJsonLd(values, options);
|
5231
5242
|
}
|
5243
|
+
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
|
5244
|
+
delete values["@type"];
|
5245
|
+
return await Offer.fromJsonLd(values, options);
|
5246
|
+
}
|
5232
5247
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Reject")) {
|
5233
5248
|
delete values["@type"];
|
5234
5249
|
return await Reject.fromJsonLd(values, options);
|
@@ -8403,6 +8418,7 @@ export class Collection extends Object {
|
|
8403
8418
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
8404
8419
|
"https://www.w3.org/ns/activitystreams#Question",
|
8405
8420
|
"https://www.w3.org/ns/activitystreams#Like",
|
8421
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
8406
8422
|
"https://www.w3.org/ns/activitystreams#Reject",
|
8407
8423
|
"https://www.w3.org/ns/activitystreams#Remove",
|
8408
8424
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -11801,6 +11817,7 @@ export class Link {
|
|
11801
11817
|
"https://www.w3.org/ns/activitystreams#Arrive",
|
11802
11818
|
"https://www.w3.org/ns/activitystreams#Question",
|
11803
11819
|
"https://www.w3.org/ns/activitystreams#Like",
|
11820
|
+
"https://www.w3.org/ns/activitystreams#Offer",
|
11804
11821
|
"https://www.w3.org/ns/activitystreams#Reject",
|
11805
11822
|
"https://www.w3.org/ns/activitystreams#Remove",
|
11806
11823
|
"https://www.w3.org/ns/activitystreams#Undo",
|
@@ -12505,6 +12522,118 @@ export class Note extends Object {
|
|
12505
12522
|
return "Note " + inspect(proxy, options);
|
12506
12523
|
}
|
12507
12524
|
}
|
12525
|
+
/** Indicates that the actor is offering the object.
|
12526
|
+
* If specified, the target indicates the entity to which
|
12527
|
+
* the object is being offered.
|
12528
|
+
*/
|
12529
|
+
export class Offer extends Activity {
|
12530
|
+
/**
|
12531
|
+
* The type URI of {@link Offer}: `https://www.w3.org/ns/activitystreams#Offer`.
|
12532
|
+
*/
|
12533
|
+
static get typeId() {
|
12534
|
+
return new URL("https://www.w3.org/ns/activitystreams#Offer");
|
12535
|
+
}
|
12536
|
+
/**
|
12537
|
+
* Constructs a new instance of Offer with the given values.
|
12538
|
+
* @param values The values to initialize the instance with.
|
12539
|
+
* @param options The options to use for initialization.
|
12540
|
+
*/
|
12541
|
+
constructor(values, { documentLoader, contextLoader, } = {}) {
|
12542
|
+
super(values, { documentLoader, contextLoader });
|
12543
|
+
}
|
12544
|
+
/**
|
12545
|
+
* Clones this instance, optionally updating it with the given values.
|
12546
|
+
* @param values The values to update the clone with.
|
12547
|
+
* @options The options to use for cloning.
|
12548
|
+
* @returns The cloned instance.
|
12549
|
+
*/
|
12550
|
+
clone(values = {}, options = {}) {
|
12551
|
+
const clone = super.clone(values, options);
|
12552
|
+
return clone;
|
12553
|
+
}
|
12554
|
+
/**
|
12555
|
+
* Converts this object to a JSON-LD structure.
|
12556
|
+
* @returns The JSON-LD representation of this object.
|
12557
|
+
*/
|
12558
|
+
async toJsonLd(options = {}) {
|
12559
|
+
options = {
|
12560
|
+
...options,
|
12561
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
12562
|
+
};
|
12563
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
12564
|
+
let array;
|
12565
|
+
const baseValues = await super.toJsonLd({
|
12566
|
+
...options,
|
12567
|
+
expand: true,
|
12568
|
+
});
|
12569
|
+
const values = baseValues[0];
|
12570
|
+
values["@type"] = ["https://www.w3.org/ns/activitystreams#Offer"];
|
12571
|
+
if (this.id)
|
12572
|
+
values["@id"] = this.id.href;
|
12573
|
+
if (options.expand) {
|
12574
|
+
return await jsonld.expand(values, { documentLoader: options.contextLoader });
|
12575
|
+
}
|
12576
|
+
return await jsonld.compact(values, options.context ??
|
12577
|
+
[
|
12578
|
+
"https://www.w3.org/ns/activitystreams",
|
12579
|
+
"https://w3id.org/security/data-integrity/v1",
|
12580
|
+
], { documentLoader: options.contextLoader });
|
12581
|
+
}
|
12582
|
+
/**
|
12583
|
+
* Converts a JSON-LD structure to an object of this type.
|
12584
|
+
* @param json The JSON-LD structure to convert.
|
12585
|
+
* @returns The object of this type.
|
12586
|
+
* @throws {TypeError} If the given `json` is invalid.
|
12587
|
+
*/
|
12588
|
+
static async fromJsonLd(json, options = {}) {
|
12589
|
+
if (typeof json === "undefined") {
|
12590
|
+
throw new TypeError("Invalid JSON-LD: undefined.");
|
12591
|
+
}
|
12592
|
+
else if (json === null)
|
12593
|
+
throw new TypeError("Invalid JSON-LD: null.");
|
12594
|
+
options = {
|
12595
|
+
...options,
|
12596
|
+
documentLoader: options.documentLoader ?? fetchDocumentLoader,
|
12597
|
+
contextLoader: options.contextLoader ?? fetchDocumentLoader,
|
12598
|
+
};
|
12599
|
+
// deno-lint-ignore no-explicit-any
|
12600
|
+
let values;
|
12601
|
+
if (globalThis.Object.keys(json).length == 0) {
|
12602
|
+
values = {};
|
12603
|
+
}
|
12604
|
+
else {
|
12605
|
+
const expanded = await jsonld.expand(json, {
|
12606
|
+
documentLoader: options.contextLoader,
|
12607
|
+
keepFreeFloatingNodes: true,
|
12608
|
+
});
|
12609
|
+
values =
|
12610
|
+
// deno-lint-ignore no-explicit-any
|
12611
|
+
(expanded[0] ?? {});
|
12612
|
+
}
|
12613
|
+
if ("@type" in values) {
|
12614
|
+
if (!values["@type"].includes("https://www.w3.org/ns/activitystreams#Offer")) {
|
12615
|
+
throw new TypeError("Invalid type: " + values["@type"]);
|
12616
|
+
}
|
12617
|
+
}
|
12618
|
+
const instance = await super.fromJsonLd(values, options);
|
12619
|
+
if (!(instance instanceof Offer)) {
|
12620
|
+
throw new TypeError("Unexpected type: " + instance.constructor.name);
|
12621
|
+
}
|
12622
|
+
return instance;
|
12623
|
+
}
|
12624
|
+
_getCustomInspectProxy() {
|
12625
|
+
const proxy = super._getCustomInspectProxy();
|
12626
|
+
return proxy;
|
12627
|
+
}
|
12628
|
+
[Symbol.for("Deno.customInspect")](inspect, options) {
|
12629
|
+
const proxy = this._getCustomInspectProxy();
|
12630
|
+
return "Offer " + inspect(proxy, options);
|
12631
|
+
}
|
12632
|
+
[Symbol.for("nodejs.util.inspect.custom")](_depth, options, inspect) {
|
12633
|
+
const proxy = this._getCustomInspectProxy();
|
12634
|
+
return "Offer " + inspect(proxy, options);
|
12635
|
+
}
|
12636
|
+
}
|
12508
12637
|
/** A subtype of {@link Collection} in which members of the logical collection
|
12509
12638
|
* are assumed to always be strictly ordered.
|
12510
12639
|
*/
|
package/package.json
CHANGED
package/types/vocab/actor.d.ts
CHANGED
@@ -35,11 +35,11 @@ export declare function getActorClassByTypeName(typeName: ActorTypeName): typeof
|
|
35
35
|
* ``` typescript
|
36
36
|
* // Get the handle of an actor object:
|
37
37
|
* await getActorHandle(
|
38
|
-
* new Person({ id: new URL("https://
|
38
|
+
* new Person({ id: new URL("https://fosstodon.org/users/hongminhee") })
|
39
39
|
* );
|
40
40
|
*
|
41
41
|
* // Get the handle of an actor URI:
|
42
|
-
* await getActorHandle(new URL("https://
|
42
|
+
* await getActorHandle(new URL("https://fosstodon.org/users/hongminhee"));
|
43
43
|
* ```
|
44
44
|
*
|
45
45
|
* @param actor The actor or actor URI to get the handle from.
|
package/types/vocab/lookup.d.ts
CHANGED
@@ -24,15 +24,15 @@ export interface LookupObjectOptions {
|
|
24
24
|
* @example
|
25
25
|
* ``` typescript
|
26
26
|
* // Look up an actor by its fediverse handle:
|
27
|
-
* await lookupObject("@hongminhee@
|
27
|
+
* await lookupObject("@hongminhee@fosstodon.org");
|
28
28
|
* // returning a `Person` object.
|
29
29
|
*
|
30
30
|
* // A fediverse handle can omit the leading '@':
|
31
|
-
* await lookupObject("hongminhee@
|
31
|
+
* await lookupObject("hongminhee@fosstodon.org");
|
32
32
|
* // returning a `Person` object.
|
33
33
|
*
|
34
34
|
* // A `acct:` URI can be used as well:
|
35
|
-
* await lookupObject("acct:hongminhee@
|
35
|
+
* await lookupObject("acct:hongminhee@fosstodon.org");
|
36
36
|
* // returning a `Person` object.
|
37
37
|
*
|
38
38
|
* // Look up an object by its URI:
|
package/types/vocab/vocab.d.ts
CHANGED
@@ -5612,6 +5612,155 @@ export declare class Note extends Object {
|
|
5612
5612
|
}): Promise<Note>;
|
5613
5613
|
protected _getCustomInspectProxy(): Record<string, unknown>;
|
5614
5614
|
}
|
5615
|
+
/** Indicates that the actor is offering the object.
|
5616
|
+
* If specified, the target indicates the entity to which
|
5617
|
+
* the object is being offered.
|
5618
|
+
*/
|
5619
|
+
export declare class Offer extends Activity {
|
5620
|
+
/**
|
5621
|
+
* The type URI of {@link Offer}: `https://www.w3.org/ns/activitystreams#Offer`.
|
5622
|
+
*/
|
5623
|
+
static get typeId(): URL;
|
5624
|
+
/**
|
5625
|
+
* Constructs a new instance of Offer with the given values.
|
5626
|
+
* @param values The values to initialize the instance with.
|
5627
|
+
* @param options The options to use for initialization.
|
5628
|
+
*/
|
5629
|
+
constructor(values: {
|
5630
|
+
id?: URL | null;
|
5631
|
+
attachments?: (Object | Link | PropertyValue | URL)[];
|
5632
|
+
attribution?: Application | Group | Organization | Person | Service | URL | null;
|
5633
|
+
attributions?: (Application | Group | Organization | Person | Service | URL)[];
|
5634
|
+
audience?: Object | URL | null;
|
5635
|
+
audiences?: (Object | URL)[];
|
5636
|
+
content?: string | LanguageString | null;
|
5637
|
+
contents?: (string | LanguageString)[];
|
5638
|
+
contexts?: (Object | Link | URL)[];
|
5639
|
+
name?: string | LanguageString | null;
|
5640
|
+
names?: (string | LanguageString)[];
|
5641
|
+
endTime?: dntShim.Temporal.Instant | null;
|
5642
|
+
generators?: (Object | Link | URL)[];
|
5643
|
+
icon?: Image | URL | null;
|
5644
|
+
icons?: (Image | URL)[];
|
5645
|
+
image?: Image | URL | null;
|
5646
|
+
images?: (Image | URL)[];
|
5647
|
+
replyTarget?: Object | Link | URL | null;
|
5648
|
+
replyTargets?: (Object | Link | URL)[];
|
5649
|
+
location?: Object | Link | URL | null;
|
5650
|
+
locations?: (Object | Link | URL)[];
|
5651
|
+
preview?: Link | Object | URL | null;
|
5652
|
+
previews?: (Link | Object | URL)[];
|
5653
|
+
published?: dntShim.Temporal.Instant | null;
|
5654
|
+
replies?: Collection | URL | null;
|
5655
|
+
startTime?: dntShim.Temporal.Instant | null;
|
5656
|
+
summary?: string | LanguageString | null;
|
5657
|
+
summaries?: (string | LanguageString)[];
|
5658
|
+
tags?: (Object | Link | URL)[];
|
5659
|
+
updated?: dntShim.Temporal.Instant | null;
|
5660
|
+
url?: URL | Link | null;
|
5661
|
+
urls?: (URL | Link)[];
|
5662
|
+
to?: Object | URL | null;
|
5663
|
+
tos?: (Object | URL)[];
|
5664
|
+
bto?: Object | URL | null;
|
5665
|
+
btos?: (Object | URL)[];
|
5666
|
+
cc?: Object | URL | null;
|
5667
|
+
ccs?: (Object | URL)[];
|
5668
|
+
bcc?: Object | URL | null;
|
5669
|
+
bccs?: (Object | URL)[];
|
5670
|
+
mediaType?: string | null;
|
5671
|
+
duration?: dntShim.Temporal.Duration | null;
|
5672
|
+
sensitive?: boolean | null;
|
5673
|
+
proof?: DataIntegrityProof | URL | null;
|
5674
|
+
proofs?: (DataIntegrityProof | URL)[];
|
5675
|
+
actor?: Application | Group | Organization | Person | Service | URL | null;
|
5676
|
+
actors?: (Application | Group | Organization | Person | Service | URL)[];
|
5677
|
+
object?: Object | URL | null;
|
5678
|
+
objects?: (Object | URL)[];
|
5679
|
+
}, { documentLoader, contextLoader, }?: {
|
5680
|
+
documentLoader?: DocumentLoader;
|
5681
|
+
contextLoader?: DocumentLoader;
|
5682
|
+
});
|
5683
|
+
/**
|
5684
|
+
* Clones this instance, optionally updating it with the given values.
|
5685
|
+
* @param values The values to update the clone with.
|
5686
|
+
* @options The options to use for cloning.
|
5687
|
+
* @returns The cloned instance.
|
5688
|
+
*/
|
5689
|
+
clone(values?: {
|
5690
|
+
id?: URL | null;
|
5691
|
+
attachments?: (Object | Link | PropertyValue | URL)[];
|
5692
|
+
attribution?: Application | Group | Organization | Person | Service | URL | null;
|
5693
|
+
attributions?: (Application | Group | Organization | Person | Service | URL)[];
|
5694
|
+
audience?: Object | URL | null;
|
5695
|
+
audiences?: (Object | URL)[];
|
5696
|
+
content?: string | LanguageString | null;
|
5697
|
+
contents?: (string | LanguageString)[];
|
5698
|
+
contexts?: (Object | Link | URL)[];
|
5699
|
+
name?: string | LanguageString | null;
|
5700
|
+
names?: (string | LanguageString)[];
|
5701
|
+
endTime?: dntShim.Temporal.Instant | null;
|
5702
|
+
generators?: (Object | Link | URL)[];
|
5703
|
+
icon?: Image | URL | null;
|
5704
|
+
icons?: (Image | URL)[];
|
5705
|
+
image?: Image | URL | null;
|
5706
|
+
images?: (Image | URL)[];
|
5707
|
+
replyTarget?: Object | Link | URL | null;
|
5708
|
+
replyTargets?: (Object | Link | URL)[];
|
5709
|
+
location?: Object | Link | URL | null;
|
5710
|
+
locations?: (Object | Link | URL)[];
|
5711
|
+
preview?: Link | Object | URL | null;
|
5712
|
+
previews?: (Link | Object | URL)[];
|
5713
|
+
published?: dntShim.Temporal.Instant | null;
|
5714
|
+
replies?: Collection | URL | null;
|
5715
|
+
startTime?: dntShim.Temporal.Instant | null;
|
5716
|
+
summary?: string | LanguageString | null;
|
5717
|
+
summaries?: (string | LanguageString)[];
|
5718
|
+
tags?: (Object | Link | URL)[];
|
5719
|
+
updated?: dntShim.Temporal.Instant | null;
|
5720
|
+
url?: URL | Link | null;
|
5721
|
+
urls?: (URL | Link)[];
|
5722
|
+
to?: Object | URL | null;
|
5723
|
+
tos?: (Object | URL)[];
|
5724
|
+
bto?: Object | URL | null;
|
5725
|
+
btos?: (Object | URL)[];
|
5726
|
+
cc?: Object | URL | null;
|
5727
|
+
ccs?: (Object | URL)[];
|
5728
|
+
bcc?: Object | URL | null;
|
5729
|
+
bccs?: (Object | URL)[];
|
5730
|
+
mediaType?: string | null;
|
5731
|
+
duration?: dntShim.Temporal.Duration | null;
|
5732
|
+
sensitive?: boolean | null;
|
5733
|
+
proof?: DataIntegrityProof | URL | null;
|
5734
|
+
proofs?: (DataIntegrityProof | URL)[];
|
5735
|
+
actor?: Application | Group | Organization | Person | Service | URL | null;
|
5736
|
+
actors?: (Application | Group | Organization | Person | Service | URL)[];
|
5737
|
+
object?: Object | URL | null;
|
5738
|
+
objects?: (Object | URL)[];
|
5739
|
+
}, options?: {
|
5740
|
+
documentLoader?: DocumentLoader;
|
5741
|
+
contextLoader?: DocumentLoader;
|
5742
|
+
}): Offer;
|
5743
|
+
/**
|
5744
|
+
* Converts this object to a JSON-LD structure.
|
5745
|
+
* @returns The JSON-LD representation of this object.
|
5746
|
+
*/
|
5747
|
+
toJsonLd(options?: {
|
5748
|
+
expand?: boolean;
|
5749
|
+
contextLoader?: DocumentLoader;
|
5750
|
+
context?: string | Record<string, string> | (string | Record<string, string>)[];
|
5751
|
+
}): Promise<unknown>;
|
5752
|
+
/**
|
5753
|
+
* Converts a JSON-LD structure to an object of this type.
|
5754
|
+
* @param json The JSON-LD structure to convert.
|
5755
|
+
* @returns The object of this type.
|
5756
|
+
* @throws {TypeError} If the given `json` is invalid.
|
5757
|
+
*/
|
5758
|
+
static fromJsonLd(json: unknown, options?: {
|
5759
|
+
documentLoader?: DocumentLoader;
|
5760
|
+
contextLoader?: DocumentLoader;
|
5761
|
+
}): Promise<Offer>;
|
5762
|
+
protected _getCustomInspectProxy(): Record<string, unknown>;
|
5763
|
+
}
|
5615
5764
|
/** A subtype of {@link Collection} in which members of the logical collection
|
5616
5765
|
* are assumed to always be strictly ordered.
|
5617
5766
|
*/
|