@fedify/vocab 2.2.0-dev.628 → 2.2.0-dev.700
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deno.json +1 -1
- package/dist/mod.cjs +1080 -1
- package/dist/mod.d.cts +422 -2
- package/dist/mod.d.ts +422 -2
- package/dist/mod.js +1079 -3
- package/dist-tests/actor.test.mjs +2 -2
- package/dist-tests/{deno-BxIN0tlW.mjs → deno-Ds6NDIzV.mjs} +2 -2
- package/dist-tests/intent.yaml +72 -0
- package/dist-tests/lookup.test.mjs +2 -2
- package/dist-tests/measure.yaml +32 -0
- package/dist-tests/proposal.yaml +90 -0
- package/dist-tests/type.test.mjs +1 -1
- package/dist-tests/{vocab-ZNOT6nzY.mjs → vocab-CGZuHaxe.mjs} +1080 -1
- package/dist-tests/vocab.test.mjs +3 -2
- package/package.json +4 -4
- package/src/__snapshots__/vocab.test.ts.snap +198 -0
- package/src/intent.yaml +72 -0
- package/src/measure.yaml +32 -0
- package/src/proposal.yaml +90 -0
- package/src/vocab.test.ts +6 -1
package/dist/mod.cjs
CHANGED
|
@@ -32,7 +32,7 @@ let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
|
32
32
|
let es_toolkit = require("es-toolkit");
|
|
33
33
|
//#region deno.json
|
|
34
34
|
var name = "@fedify/vocab";
|
|
35
|
-
var version = "2.2.0-dev.
|
|
35
|
+
var version = "2.2.0-dev.700+5323388d";
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/type.ts
|
|
38
38
|
function getTypeId(object) {
|
|
@@ -5052,6 +5052,7 @@ var Object$1 = class Object$1 {
|
|
|
5052
5052
|
if (values["@type"].includes("https://gotosocial.org/ns#AnnounceAuthorization")) return await AnnounceAuthorization.fromJsonLd(json, options);
|
|
5053
5053
|
if (values["@type"].includes("https://gotosocial.org/ns#LikeApproval")) return await LikeAuthorization.fromJsonLd(json, options);
|
|
5054
5054
|
if (values["@type"].includes("https://gotosocial.org/ns#ReplyAuthorization")) return await ReplyAuthorization.fromJsonLd(json, options);
|
|
5055
|
+
if (values["@type"].includes("https://w3id.org/valueflows/ont/vf#Proposal")) return await Proposal.fromJsonLd(json, options);
|
|
5055
5056
|
if (values["@type"].includes("https://www.w3.org/ns/activitystreams#Activity")) return await Activity.fromJsonLd(json, options);
|
|
5056
5057
|
if (values["@type"].includes("http://litepub.social/ns#EmojiReact")) return await EmojiReact.fromJsonLd(json, options);
|
|
5057
5058
|
if (values["@type"].includes("https://gotosocial.org/ns#AnnounceRequest")) return await AnnounceRequest.fromJsonLd(json, options);
|
|
@@ -5125,6 +5126,7 @@ var Object$1 = class Object$1 {
|
|
|
5125
5126
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
5126
5127
|
"https://gotosocial.org/ns#LikeApproval",
|
|
5127
5128
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
5129
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
5128
5130
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
5129
5131
|
"http://litepub.social/ns#EmojiReact",
|
|
5130
5132
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -5264,6 +5266,7 @@ var Object$1 = class Object$1 {
|
|
|
5264
5266
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
5265
5267
|
"https://gotosocial.org/ns#LikeApproval",
|
|
5266
5268
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
5269
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
5267
5270
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
5268
5271
|
"http://litepub.social/ns#EmojiReact",
|
|
5269
5272
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -5365,6 +5368,7 @@ var Object$1 = class Object$1 {
|
|
|
5365
5368
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
5366
5369
|
"https://gotosocial.org/ns#LikeApproval",
|
|
5367
5370
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
5371
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
5368
5372
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
5369
5373
|
"http://litepub.social/ns#EmojiReact",
|
|
5370
5374
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -5478,6 +5482,7 @@ var Object$1 = class Object$1 {
|
|
|
5478
5482
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
5479
5483
|
"https://gotosocial.org/ns#LikeApproval",
|
|
5480
5484
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
5485
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
5481
5486
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
5482
5487
|
"http://litepub.social/ns#EmojiReact",
|
|
5483
5488
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -5563,6 +5568,7 @@ var Object$1 = class Object$1 {
|
|
|
5563
5568
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
5564
5569
|
"https://gotosocial.org/ns#LikeApproval",
|
|
5565
5570
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
5571
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
5566
5572
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
5567
5573
|
"http://litepub.social/ns#EmojiReact",
|
|
5568
5574
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -5655,6 +5661,7 @@ var Object$1 = class Object$1 {
|
|
|
5655
5661
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
5656
5662
|
"https://gotosocial.org/ns#LikeApproval",
|
|
5657
5663
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
5664
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
5658
5665
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
5659
5666
|
"http://litepub.social/ns#EmojiReact",
|
|
5660
5667
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -5812,6 +5819,7 @@ var Object$1 = class Object$1 {
|
|
|
5812
5819
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
5813
5820
|
"https://gotosocial.org/ns#LikeApproval",
|
|
5814
5821
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
5822
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
5815
5823
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
5816
5824
|
"http://litepub.social/ns#EmojiReact",
|
|
5817
5825
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -8699,6 +8707,267 @@ PropertyValue.prototype[Symbol.for("Deno.customInspect")] = function(inspect, op
|
|
|
8699
8707
|
PropertyValue.prototype[Symbol.for("nodejs.util.inspect.custom")] = function(_depth, options, inspect) {
|
|
8700
8708
|
return "PropertyValue " + inspect(this._getCustomInspectProxy(), options);
|
|
8701
8709
|
};
|
|
8710
|
+
/** A quantity with a unit of measure.
|
|
8711
|
+
*/
|
|
8712
|
+
var Measure = class {
|
|
8713
|
+
#documentLoader;
|
|
8714
|
+
#contextLoader;
|
|
8715
|
+
#tracerProvider;
|
|
8716
|
+
#warning;
|
|
8717
|
+
#cachedJsonLd;
|
|
8718
|
+
id;
|
|
8719
|
+
get _documentLoader() {
|
|
8720
|
+
return this.#documentLoader;
|
|
8721
|
+
}
|
|
8722
|
+
get _contextLoader() {
|
|
8723
|
+
return this.#contextLoader;
|
|
8724
|
+
}
|
|
8725
|
+
get _tracerProvider() {
|
|
8726
|
+
return this.#tracerProvider;
|
|
8727
|
+
}
|
|
8728
|
+
get _warning() {
|
|
8729
|
+
return this.#warning;
|
|
8730
|
+
}
|
|
8731
|
+
get _cachedJsonLd() {
|
|
8732
|
+
return this.#cachedJsonLd;
|
|
8733
|
+
}
|
|
8734
|
+
set _cachedJsonLd(value) {
|
|
8735
|
+
this.#cachedJsonLd = value;
|
|
8736
|
+
}
|
|
8737
|
+
/**
|
|
8738
|
+
* The type URI of {@link Measure}: `http://www.ontology-of-units-of-measure.org/resource/om-2/Measure`.
|
|
8739
|
+
*/
|
|
8740
|
+
static get typeId() {
|
|
8741
|
+
return new URL("http://www.ontology-of-units-of-measure.org/resource/om-2/Measure");
|
|
8742
|
+
}
|
|
8743
|
+
#_27fgyFbosTtMAhuepJH8K3ZGURT6 = [];
|
|
8744
|
+
#_1GQx8o2RgxRs4x9G5uT39XYBv7D = [];
|
|
8745
|
+
/**
|
|
8746
|
+
* Constructs a new instance of Measure with the given values.
|
|
8747
|
+
* @param values The values to initialize the instance with.
|
|
8748
|
+
* @param options The options to use for initialization.
|
|
8749
|
+
*/
|
|
8750
|
+
constructor(values, options = {}) {
|
|
8751
|
+
this.#documentLoader = options.documentLoader;
|
|
8752
|
+
this.#contextLoader = options.contextLoader;
|
|
8753
|
+
this.#tracerProvider = options.tracerProvider;
|
|
8754
|
+
if ("$warning" in options) this.#warning = options.$warning;
|
|
8755
|
+
if (values.id == null || values.id instanceof URL) this.id = values.id ?? null;
|
|
8756
|
+
else throw new TypeError("The id must be a URL.");
|
|
8757
|
+
if ("unit" in values && values.unit != null) if (typeof values.unit === "string") this.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = [values.unit];
|
|
8758
|
+
else throw new TypeError("The unit must be of type string.");
|
|
8759
|
+
if ("numericalValue" in values && values.numericalValue != null) if (typeof values.numericalValue === "string" && (0, _fedify_vocab_runtime.isDecimal)(values.numericalValue)) this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = [values.numericalValue];
|
|
8760
|
+
else throw new TypeError("The numericalValue must be of type Decimal.");
|
|
8761
|
+
}
|
|
8762
|
+
/**
|
|
8763
|
+
* Clones this instance, optionally updating it with the given values.
|
|
8764
|
+
* @param values The values to update the clone with.
|
|
8765
|
+
* @param options The options to use for cloning.
|
|
8766
|
+
* @returns The cloned instance.
|
|
8767
|
+
*/
|
|
8768
|
+
clone(values = {}, options = {}) {
|
|
8769
|
+
if (this._warning != null) {
|
|
8770
|
+
(0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
8771
|
+
options = {
|
|
8772
|
+
...options,
|
|
8773
|
+
$warning: this._warning
|
|
8774
|
+
};
|
|
8775
|
+
}
|
|
8776
|
+
const clone = new this.constructor({ id: values.id ?? this.id }, options);
|
|
8777
|
+
clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6;
|
|
8778
|
+
if ("unit" in values && values.unit != null) if (typeof values.unit === "string") clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = [values.unit];
|
|
8779
|
+
else throw new TypeError("The unit must be of type string.");
|
|
8780
|
+
clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D;
|
|
8781
|
+
if ("numericalValue" in values && values.numericalValue != null) if (typeof values.numericalValue === "string" && (0, _fedify_vocab_runtime.isDecimal)(values.numericalValue)) clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = [values.numericalValue];
|
|
8782
|
+
else throw new TypeError("The numericalValue must be of type Decimal.");
|
|
8783
|
+
return clone;
|
|
8784
|
+
}
|
|
8785
|
+
/** The name of the unit, according to the Ontology of units of Measure
|
|
8786
|
+
* classification. The recommended unit for countable items is `"one"`.
|
|
8787
|
+
*/
|
|
8788
|
+
get unit() {
|
|
8789
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
8790
|
+
if (this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < 1) return null;
|
|
8791
|
+
return this.#_27fgyFbosTtMAhuepJH8K3ZGURT6[0];
|
|
8792
|
+
}
|
|
8793
|
+
/** The amount of the resource. If not specified, arbitrary amounts can be
|
|
8794
|
+
* used when responding to the proposal.
|
|
8795
|
+
*/
|
|
8796
|
+
get numericalValue() {
|
|
8797
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
8798
|
+
if (this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.length < 1) return null;
|
|
8799
|
+
return this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D[0];
|
|
8800
|
+
}
|
|
8801
|
+
/**
|
|
8802
|
+
* Converts this object to a JSON-LD structure.
|
|
8803
|
+
* @param options The options to use.
|
|
8804
|
+
* - `format`: The format of the output: `compact` or
|
|
8805
|
+
`expand`.
|
|
8806
|
+
* - `contextLoader`: The loader for remote JSON-LD contexts.
|
|
8807
|
+
* - `context`: The JSON-LD context to use. Not applicable
|
|
8808
|
+
when `format` is set to `'expand'`.
|
|
8809
|
+
* @returns The JSON-LD representation of this object.
|
|
8810
|
+
*/
|
|
8811
|
+
async toJsonLd(options = {}) {
|
|
8812
|
+
if (options.format == null && this._cachedJsonLd != null) return this._cachedJsonLd;
|
|
8813
|
+
if (options.format !== "compact" && options.context != null) throw new TypeError("The context option can only be used when the format option is set to 'compact'.");
|
|
8814
|
+
options = {
|
|
8815
|
+
...options,
|
|
8816
|
+
contextLoader: options.contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)()
|
|
8817
|
+
};
|
|
8818
|
+
if (options.format == null && this.isCompactable()) {
|
|
8819
|
+
const result = {};
|
|
8820
|
+
let compactItems = [];
|
|
8821
|
+
for (const v of this.#_27fgyFbosTtMAhuepJH8K3ZGURT6) {
|
|
8822
|
+
const item = v;
|
|
8823
|
+
compactItems.push(item);
|
|
8824
|
+
}
|
|
8825
|
+
if (compactItems.length > 0) result["hasUnit"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
8826
|
+
compactItems = [];
|
|
8827
|
+
for (const v of this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D) {
|
|
8828
|
+
const item = v;
|
|
8829
|
+
compactItems.push(item);
|
|
8830
|
+
}
|
|
8831
|
+
if (compactItems.length > 0) result["hasNumericalValue"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
8832
|
+
result["type"] = "om2:Measure";
|
|
8833
|
+
if (this.id != null) result["id"] = this.id.href;
|
|
8834
|
+
result["@context"] = ["https://www.w3.org/ns/activitystreams", {
|
|
8835
|
+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
|
|
8836
|
+
"hasUnit": "om2:hasUnit",
|
|
8837
|
+
"hasNumericalValue": "om2:hasNumericalValue"
|
|
8838
|
+
}];
|
|
8839
|
+
return result;
|
|
8840
|
+
}
|
|
8841
|
+
let array;
|
|
8842
|
+
const values = {};
|
|
8843
|
+
array = [];
|
|
8844
|
+
for (const v of this.#_27fgyFbosTtMAhuepJH8K3ZGURT6) {
|
|
8845
|
+
const element = { "@value": v };
|
|
8846
|
+
array.push(element);
|
|
8847
|
+
}
|
|
8848
|
+
if (array.length > 0) values["http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit"] = array;
|
|
8849
|
+
array = [];
|
|
8850
|
+
for (const v of this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D) {
|
|
8851
|
+
const element = {
|
|
8852
|
+
"@type": "http://www.w3.org/2001/XMLSchema#decimal",
|
|
8853
|
+
"@value": v
|
|
8854
|
+
};
|
|
8855
|
+
array.push(element);
|
|
8856
|
+
}
|
|
8857
|
+
if (array.length > 0) values["http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue"] = array;
|
|
8858
|
+
values["@type"] = ["http://www.ontology-of-units-of-measure.org/resource/om-2/Measure"];
|
|
8859
|
+
if (this.id != null) values["@id"] = this.id.href;
|
|
8860
|
+
if (options.format === "expand") return await _fedify_vocab_runtime_jsonld.default.expand(values, { documentLoader: options.contextLoader });
|
|
8861
|
+
const docContext = options.context ?? ["https://www.w3.org/ns/activitystreams", {
|
|
8862
|
+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
|
|
8863
|
+
"hasUnit": "om2:hasUnit",
|
|
8864
|
+
"hasNumericalValue": "om2:hasNumericalValue"
|
|
8865
|
+
}];
|
|
8866
|
+
const compacted = await _fedify_vocab_runtime_jsonld.default.compact(values, docContext, { documentLoader: options.contextLoader });
|
|
8867
|
+
if (docContext != null) {}
|
|
8868
|
+
return compacted;
|
|
8869
|
+
}
|
|
8870
|
+
isCompactable() {
|
|
8871
|
+
return true;
|
|
8872
|
+
}
|
|
8873
|
+
/**
|
|
8874
|
+
* Converts a JSON-LD structure to an object of this type.
|
|
8875
|
+
* @param json The JSON-LD structure to convert.
|
|
8876
|
+
* @param options The options to use.
|
|
8877
|
+
* - `documentLoader`: The loader for remote JSON-LD documents.
|
|
8878
|
+
* - `contextLoader`: The loader for remote JSON-LD contexts.
|
|
8879
|
+
* - `tracerProvider`: The OpenTelemetry tracer provider to use.
|
|
8880
|
+
* If omitted, the global tracer provider is used.
|
|
8881
|
+
* @returns The object of this type.
|
|
8882
|
+
* @throws {TypeError} If the given `json` is invalid.
|
|
8883
|
+
*/
|
|
8884
|
+
static async fromJsonLd(json, options = {}) {
|
|
8885
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer("@fedify/vocab-tools", "2.2.0").startActiveSpan("activitypub.parse_object", async (span) => {
|
|
8886
|
+
try {
|
|
8887
|
+
const object = await this.__fromJsonLd__Measure__(json, span, options);
|
|
8888
|
+
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
8889
|
+
return object;
|
|
8890
|
+
} catch (error) {
|
|
8891
|
+
span.setStatus({
|
|
8892
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
8893
|
+
message: String(error)
|
|
8894
|
+
});
|
|
8895
|
+
throw error;
|
|
8896
|
+
} finally {
|
|
8897
|
+
span.end();
|
|
8898
|
+
}
|
|
8899
|
+
});
|
|
8900
|
+
}
|
|
8901
|
+
static async __fromJsonLd__Measure__(json, span, options = {}) {
|
|
8902
|
+
if (typeof json === "undefined") throw new TypeError("Invalid JSON-LD: undefined.");
|
|
8903
|
+
else if (json === null) throw new TypeError("Invalid JSON-LD: null.");
|
|
8904
|
+
options = {
|
|
8905
|
+
...options,
|
|
8906
|
+
documentLoader: options.documentLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)(),
|
|
8907
|
+
contextLoader: options.contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)(),
|
|
8908
|
+
tracerProvider: options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()
|
|
8909
|
+
};
|
|
8910
|
+
let values;
|
|
8911
|
+
if (globalThis.Object.keys(json).length == 0) values = {};
|
|
8912
|
+
else values = (await _fedify_vocab_runtime_jsonld.default.expand(json, {
|
|
8913
|
+
documentLoader: options.contextLoader,
|
|
8914
|
+
keepFreeFloatingNodes: true
|
|
8915
|
+
}))[0] ?? {};
|
|
8916
|
+
if (options.baseUrl == null && values["@id"] != null) options = {
|
|
8917
|
+
...options,
|
|
8918
|
+
baseUrl: new URL(values["@id"])
|
|
8919
|
+
};
|
|
8920
|
+
if ("@type" in values) span.setAttribute("activitypub.object.type", values["@type"]);
|
|
8921
|
+
if ("@type" in values && !values["@type"].every((t) => t.startsWith("_:"))) {
|
|
8922
|
+
if (!values["@type"].includes("http://www.ontology-of-units-of-measure.org/resource/om-2/Measure")) throw new TypeError("Invalid type: " + values["@type"]);
|
|
8923
|
+
}
|
|
8924
|
+
const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : void 0 }, options);
|
|
8925
|
+
const _27fgyFbosTtMAhuepJH8K3ZGURT6 = [];
|
|
8926
|
+
let _27fgyFbosTtMAhuepJH8K3ZGURT6__array = values["http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit"];
|
|
8927
|
+
for (const v of _27fgyFbosTtMAhuepJH8K3ZGURT6__array == null ? [] : _27fgyFbosTtMAhuepJH8K3ZGURT6__array.length === 1 && "@list" in _27fgyFbosTtMAhuepJH8K3ZGURT6__array[0] ? _27fgyFbosTtMAhuepJH8K3ZGURT6__array[0]["@list"] : _27fgyFbosTtMAhuepJH8K3ZGURT6__array) {
|
|
8928
|
+
if (v == null) continue;
|
|
8929
|
+
_27fgyFbosTtMAhuepJH8K3ZGURT6.push(v["@value"]);
|
|
8930
|
+
}
|
|
8931
|
+
instance.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = _27fgyFbosTtMAhuepJH8K3ZGURT6;
|
|
8932
|
+
const _1GQx8o2RgxRs4x9G5uT39XYBv7D = [];
|
|
8933
|
+
let _1GQx8o2RgxRs4x9G5uT39XYBv7D__array = values["http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue"];
|
|
8934
|
+
for (const v of _1GQx8o2RgxRs4x9G5uT39XYBv7D__array == null ? [] : _1GQx8o2RgxRs4x9G5uT39XYBv7D__array.length === 1 && "@list" in _1GQx8o2RgxRs4x9G5uT39XYBv7D__array[0] ? _1GQx8o2RgxRs4x9G5uT39XYBv7D__array[0]["@list"] : _1GQx8o2RgxRs4x9G5uT39XYBv7D__array) {
|
|
8935
|
+
if (v == null) continue;
|
|
8936
|
+
_1GQx8o2RgxRs4x9G5uT39XYBv7D.push((0, _fedify_vocab_runtime.parseDecimal)(v["@value"]));
|
|
8937
|
+
}
|
|
8938
|
+
instance.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = _1GQx8o2RgxRs4x9G5uT39XYBv7D;
|
|
8939
|
+
if (!("_fromSubclass" in options) || !options._fromSubclass) try {
|
|
8940
|
+
instance._cachedJsonLd = structuredClone(json);
|
|
8941
|
+
} catch {
|
|
8942
|
+
(0, _logtape_logtape.getLogger)(["fedify", "vocab"]).warn("Failed to cache JSON-LD: {json}", { json });
|
|
8943
|
+
}
|
|
8944
|
+
return instance;
|
|
8945
|
+
}
|
|
8946
|
+
_getCustomInspectProxy() {
|
|
8947
|
+
const proxy = {};
|
|
8948
|
+
if (this.id != null) proxy.id = {
|
|
8949
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(this.id.href, options),
|
|
8950
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(this.id.href, options)
|
|
8951
|
+
};
|
|
8952
|
+
const _27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.map((v) => v instanceof URL ? {
|
|
8953
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
8954
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
8955
|
+
} : v);
|
|
8956
|
+
if (_27fgyFbosTtMAhuepJH8K3ZGURT6.length == 1) proxy.unit = _27fgyFbosTtMAhuepJH8K3ZGURT6[0];
|
|
8957
|
+
const _1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.map((v) => v instanceof URL ? {
|
|
8958
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
8959
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
8960
|
+
} : v);
|
|
8961
|
+
if (_1GQx8o2RgxRs4x9G5uT39XYBv7D.length == 1) proxy.numericalValue = _1GQx8o2RgxRs4x9G5uT39XYBv7D[0];
|
|
8962
|
+
return proxy;
|
|
8963
|
+
}
|
|
8964
|
+
};
|
|
8965
|
+
Measure.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
|
|
8966
|
+
return "Measure " + inspect(this._getCustomInspectProxy(), options);
|
|
8967
|
+
};
|
|
8968
|
+
Measure.prototype[Symbol.for("nodejs.util.inspect.custom")] = function(_depth, options, inspect) {
|
|
8969
|
+
return "Measure " + inspect(this._getCustomInspectProxy(), options);
|
|
8970
|
+
};
|
|
8702
8971
|
/** Proves that an {@link Announce} interaction has been approved by
|
|
8703
8972
|
* the post author.
|
|
8704
8973
|
*
|
|
@@ -12997,6 +13266,809 @@ Multikey.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options
|
|
|
12997
13266
|
Multikey.prototype[Symbol.for("nodejs.util.inspect.custom")] = function(_depth, options, inspect) {
|
|
12998
13267
|
return "Multikey " + inspect(this._getCustomInspectProxy(), options);
|
|
12999
13268
|
};
|
|
13269
|
+
/** A proposed economic transaction describing what is being offered or requested
|
|
13270
|
+
* in a {@link Proposal}.
|
|
13271
|
+
*/
|
|
13272
|
+
var Intent = class {
|
|
13273
|
+
#documentLoader;
|
|
13274
|
+
#contextLoader;
|
|
13275
|
+
#tracerProvider;
|
|
13276
|
+
#warning;
|
|
13277
|
+
#cachedJsonLd;
|
|
13278
|
+
id;
|
|
13279
|
+
get _documentLoader() {
|
|
13280
|
+
return this.#documentLoader;
|
|
13281
|
+
}
|
|
13282
|
+
get _contextLoader() {
|
|
13283
|
+
return this.#contextLoader;
|
|
13284
|
+
}
|
|
13285
|
+
get _tracerProvider() {
|
|
13286
|
+
return this.#tracerProvider;
|
|
13287
|
+
}
|
|
13288
|
+
get _warning() {
|
|
13289
|
+
return this.#warning;
|
|
13290
|
+
}
|
|
13291
|
+
get _cachedJsonLd() {
|
|
13292
|
+
return this.#cachedJsonLd;
|
|
13293
|
+
}
|
|
13294
|
+
set _cachedJsonLd(value) {
|
|
13295
|
+
this.#cachedJsonLd = value;
|
|
13296
|
+
}
|
|
13297
|
+
/**
|
|
13298
|
+
* The type URI of {@link Intent}: `https://w3id.org/valueflows/ont/vf#Intent`.
|
|
13299
|
+
*/
|
|
13300
|
+
static get typeId() {
|
|
13301
|
+
return new URL("https://w3id.org/valueflows/ont/vf#Intent");
|
|
13302
|
+
}
|
|
13303
|
+
#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = [];
|
|
13304
|
+
#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = [];
|
|
13305
|
+
#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = [];
|
|
13306
|
+
#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = [];
|
|
13307
|
+
#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = [];
|
|
13308
|
+
/**
|
|
13309
|
+
* Constructs a new instance of Intent with the given values.
|
|
13310
|
+
* @param values The values to initialize the instance with.
|
|
13311
|
+
* @param options The options to use for initialization.
|
|
13312
|
+
*/
|
|
13313
|
+
constructor(values, options = {}) {
|
|
13314
|
+
this.#documentLoader = options.documentLoader;
|
|
13315
|
+
this.#contextLoader = options.contextLoader;
|
|
13316
|
+
this.#tracerProvider = options.tracerProvider;
|
|
13317
|
+
if ("$warning" in options) this.#warning = options.$warning;
|
|
13318
|
+
if (values.id == null || values.id instanceof URL) this.id = values.id ?? null;
|
|
13319
|
+
else throw new TypeError("The id must be a URL.");
|
|
13320
|
+
if ("action" in values && values.action != null) if (typeof values.action === "string") this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = [values.action];
|
|
13321
|
+
else throw new TypeError("The action must be of type string.");
|
|
13322
|
+
if ("resourceConformsTo" in values && values.resourceConformsTo != null) if (values.resourceConformsTo instanceof URL) this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = [values.resourceConformsTo];
|
|
13323
|
+
else throw new TypeError("The resourceConformsTo must be of type URL.");
|
|
13324
|
+
if ("resourceQuantity" in values && values.resourceQuantity != null) if (values.resourceQuantity instanceof Measure) this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = [values.resourceQuantity];
|
|
13325
|
+
else throw new TypeError("The resourceQuantity must be of type Measure.");
|
|
13326
|
+
if ("availableQuantity" in values && values.availableQuantity != null) if (values.availableQuantity instanceof Measure) this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = [values.availableQuantity];
|
|
13327
|
+
else throw new TypeError("The availableQuantity must be of type Measure.");
|
|
13328
|
+
if ("minimumQuantity" in values && values.minimumQuantity != null) if (values.minimumQuantity instanceof Measure) this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = [values.minimumQuantity];
|
|
13329
|
+
else throw new TypeError("The minimumQuantity must be of type Measure.");
|
|
13330
|
+
}
|
|
13331
|
+
/**
|
|
13332
|
+
* Clones this instance, optionally updating it with the given values.
|
|
13333
|
+
* @param values The values to update the clone with.
|
|
13334
|
+
* @param options The options to use for cloning.
|
|
13335
|
+
* @returns The cloned instance.
|
|
13336
|
+
*/
|
|
13337
|
+
clone(values = {}, options = {}) {
|
|
13338
|
+
if (this._warning != null) {
|
|
13339
|
+
(0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13340
|
+
options = {
|
|
13341
|
+
...options,
|
|
13342
|
+
$warning: this._warning
|
|
13343
|
+
};
|
|
13344
|
+
}
|
|
13345
|
+
const clone = new this.constructor({ id: values.id ?? this.id }, options);
|
|
13346
|
+
clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action;
|
|
13347
|
+
if ("action" in values && values.action != null) if (typeof values.action === "string") clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = [values.action];
|
|
13348
|
+
else throw new TypeError("The action must be of type string.");
|
|
13349
|
+
clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo;
|
|
13350
|
+
if ("resourceConformsTo" in values && values.resourceConformsTo != null) if (values.resourceConformsTo instanceof URL) clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = [values.resourceConformsTo];
|
|
13351
|
+
else throw new TypeError("The resourceConformsTo must be of type URL.");
|
|
13352
|
+
clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity;
|
|
13353
|
+
if ("resourceQuantity" in values && values.resourceQuantity != null) if (values.resourceQuantity instanceof Measure) clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = [values.resourceQuantity];
|
|
13354
|
+
else throw new TypeError("The resourceQuantity must be of type Measure.");
|
|
13355
|
+
clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity;
|
|
13356
|
+
if ("availableQuantity" in values && values.availableQuantity != null) if (values.availableQuantity instanceof Measure) clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = [values.availableQuantity];
|
|
13357
|
+
else throw new TypeError("The availableQuantity must be of type Measure.");
|
|
13358
|
+
clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity;
|
|
13359
|
+
if ("minimumQuantity" in values && values.minimumQuantity != null) if (values.minimumQuantity instanceof Measure) clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = [values.minimumQuantity];
|
|
13360
|
+
else throw new TypeError("The minimumQuantity must be of type Measure.");
|
|
13361
|
+
return clone;
|
|
13362
|
+
}
|
|
13363
|
+
/** The type of economic transaction. The value of this property should be
|
|
13364
|
+
* either `"deliverService"` or `"transfer"`.
|
|
13365
|
+
*/
|
|
13366
|
+
get action() {
|
|
13367
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13368
|
+
if (this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < 1) return null;
|
|
13369
|
+
return this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action[0];
|
|
13370
|
+
}
|
|
13371
|
+
/** The type of an economic resource. Could be any URI.
|
|
13372
|
+
*/
|
|
13373
|
+
get resourceConformsTo() {
|
|
13374
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13375
|
+
if (this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length < 1) return null;
|
|
13376
|
+
return this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[0];
|
|
13377
|
+
}
|
|
13378
|
+
/** The amount and unit of the economic resource.
|
|
13379
|
+
*/
|
|
13380
|
+
get resourceQuantity() {
|
|
13381
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13382
|
+
if (this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < 1) return null;
|
|
13383
|
+
return this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[0];
|
|
13384
|
+
}
|
|
13385
|
+
/** The quantity of the offered resource currently available.
|
|
13386
|
+
*/
|
|
13387
|
+
get availableQuantity() {
|
|
13388
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13389
|
+
if (this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length < 1) return null;
|
|
13390
|
+
return this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[0];
|
|
13391
|
+
}
|
|
13392
|
+
/** The minimum possible quantity of the resource.
|
|
13393
|
+
*/
|
|
13394
|
+
get minimumQuantity() {
|
|
13395
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13396
|
+
if (this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length < 1) return null;
|
|
13397
|
+
return this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[0];
|
|
13398
|
+
}
|
|
13399
|
+
/**
|
|
13400
|
+
* Converts this object to a JSON-LD structure.
|
|
13401
|
+
* @param options The options to use.
|
|
13402
|
+
* - `format`: The format of the output: `compact` or
|
|
13403
|
+
`expand`.
|
|
13404
|
+
* - `contextLoader`: The loader for remote JSON-LD contexts.
|
|
13405
|
+
* - `context`: The JSON-LD context to use. Not applicable
|
|
13406
|
+
when `format` is set to `'expand'`.
|
|
13407
|
+
* @returns The JSON-LD representation of this object.
|
|
13408
|
+
*/
|
|
13409
|
+
async toJsonLd(options = {}) {
|
|
13410
|
+
if (options.format == null && this._cachedJsonLd != null) return this._cachedJsonLd;
|
|
13411
|
+
if (options.format !== "compact" && options.context != null) throw new TypeError("The context option can only be used when the format option is set to 'compact'.");
|
|
13412
|
+
options = {
|
|
13413
|
+
...options,
|
|
13414
|
+
contextLoader: options.contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)()
|
|
13415
|
+
};
|
|
13416
|
+
if (options.format == null && this.isCompactable()) {
|
|
13417
|
+
const result = {};
|
|
13418
|
+
let compactItems = [];
|
|
13419
|
+
for (const v of this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) {
|
|
13420
|
+
const item = v;
|
|
13421
|
+
compactItems.push(item);
|
|
13422
|
+
}
|
|
13423
|
+
if (compactItems.length > 0) result["action"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13424
|
+
compactItems = [];
|
|
13425
|
+
for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) {
|
|
13426
|
+
const item = v.href;
|
|
13427
|
+
compactItems.push(item);
|
|
13428
|
+
}
|
|
13429
|
+
if (compactItems.length > 0) result["resourceConformsTo"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13430
|
+
compactItems = [];
|
|
13431
|
+
for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) {
|
|
13432
|
+
const item = await v.toJsonLd({
|
|
13433
|
+
...options,
|
|
13434
|
+
format: void 0,
|
|
13435
|
+
context: void 0
|
|
13436
|
+
});
|
|
13437
|
+
compactItems.push(item);
|
|
13438
|
+
}
|
|
13439
|
+
if (compactItems.length > 0) result["resourceQuantity"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13440
|
+
compactItems = [];
|
|
13441
|
+
for (const v of this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) {
|
|
13442
|
+
const item = await v.toJsonLd({
|
|
13443
|
+
...options,
|
|
13444
|
+
format: void 0,
|
|
13445
|
+
context: void 0
|
|
13446
|
+
});
|
|
13447
|
+
compactItems.push(item);
|
|
13448
|
+
}
|
|
13449
|
+
if (compactItems.length > 0) result["availableQuantity"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13450
|
+
compactItems = [];
|
|
13451
|
+
for (const v of this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) {
|
|
13452
|
+
const item = await v.toJsonLd({
|
|
13453
|
+
...options,
|
|
13454
|
+
format: void 0,
|
|
13455
|
+
context: void 0
|
|
13456
|
+
});
|
|
13457
|
+
compactItems.push(item);
|
|
13458
|
+
}
|
|
13459
|
+
if (compactItems.length > 0) result["minimumQuantity"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13460
|
+
result["type"] = "Intent";
|
|
13461
|
+
if (this.id != null) result["id"] = this.id.href;
|
|
13462
|
+
result["@context"] = ["https://www.w3.org/ns/activitystreams", {
|
|
13463
|
+
"vf": "https://w3id.org/valueflows/ont/vf#",
|
|
13464
|
+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
|
|
13465
|
+
"Intent": "vf:Intent",
|
|
13466
|
+
"action": "vf:action",
|
|
13467
|
+
"resourceConformsTo": {
|
|
13468
|
+
"@id": "vf:resourceConformsTo",
|
|
13469
|
+
"@type": "@id"
|
|
13470
|
+
},
|
|
13471
|
+
"resourceQuantity": "vf:resourceQuantity",
|
|
13472
|
+
"availableQuantity": "vf:availableQuantity",
|
|
13473
|
+
"minimumQuantity": "vf:minimumQuantity",
|
|
13474
|
+
"hasUnit": "om2:hasUnit",
|
|
13475
|
+
"hasNumericalValue": "om2:hasNumericalValue"
|
|
13476
|
+
}];
|
|
13477
|
+
return result;
|
|
13478
|
+
}
|
|
13479
|
+
let array;
|
|
13480
|
+
const values = {};
|
|
13481
|
+
array = [];
|
|
13482
|
+
for (const v of this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) {
|
|
13483
|
+
const element = { "@value": v };
|
|
13484
|
+
array.push(element);
|
|
13485
|
+
}
|
|
13486
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#action"] = array;
|
|
13487
|
+
array = [];
|
|
13488
|
+
for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) {
|
|
13489
|
+
const element = { "@id": v.href };
|
|
13490
|
+
array.push(element);
|
|
13491
|
+
}
|
|
13492
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#resourceConformsTo"] = array;
|
|
13493
|
+
array = [];
|
|
13494
|
+
for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) {
|
|
13495
|
+
const element = await v.toJsonLd(options);
|
|
13496
|
+
array.push(element);
|
|
13497
|
+
}
|
|
13498
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#resourceQuantity"] = array;
|
|
13499
|
+
array = [];
|
|
13500
|
+
for (const v of this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) {
|
|
13501
|
+
const element = await v.toJsonLd(options);
|
|
13502
|
+
array.push(element);
|
|
13503
|
+
}
|
|
13504
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#availableQuantity"] = array;
|
|
13505
|
+
array = [];
|
|
13506
|
+
for (const v of this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) {
|
|
13507
|
+
const element = await v.toJsonLd(options);
|
|
13508
|
+
array.push(element);
|
|
13509
|
+
}
|
|
13510
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#minimumQuantity"] = array;
|
|
13511
|
+
values["@type"] = ["https://w3id.org/valueflows/ont/vf#Intent"];
|
|
13512
|
+
if (this.id != null) values["@id"] = this.id.href;
|
|
13513
|
+
if (options.format === "expand") return await _fedify_vocab_runtime_jsonld.default.expand(values, { documentLoader: options.contextLoader });
|
|
13514
|
+
const docContext = options.context ?? ["https://www.w3.org/ns/activitystreams", {
|
|
13515
|
+
"vf": "https://w3id.org/valueflows/ont/vf#",
|
|
13516
|
+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
|
|
13517
|
+
"Intent": "vf:Intent",
|
|
13518
|
+
"action": "vf:action",
|
|
13519
|
+
"resourceConformsTo": {
|
|
13520
|
+
"@id": "vf:resourceConformsTo",
|
|
13521
|
+
"@type": "@id"
|
|
13522
|
+
},
|
|
13523
|
+
"resourceQuantity": "vf:resourceQuantity",
|
|
13524
|
+
"availableQuantity": "vf:availableQuantity",
|
|
13525
|
+
"minimumQuantity": "vf:minimumQuantity",
|
|
13526
|
+
"hasUnit": "om2:hasUnit",
|
|
13527
|
+
"hasNumericalValue": "om2:hasNumericalValue"
|
|
13528
|
+
}];
|
|
13529
|
+
const compacted = await _fedify_vocab_runtime_jsonld.default.compact(values, docContext, { documentLoader: options.contextLoader });
|
|
13530
|
+
if (docContext != null) {}
|
|
13531
|
+
return compacted;
|
|
13532
|
+
}
|
|
13533
|
+
isCompactable() {
|
|
13534
|
+
return true;
|
|
13535
|
+
}
|
|
13536
|
+
/**
|
|
13537
|
+
* Converts a JSON-LD structure to an object of this type.
|
|
13538
|
+
* @param json The JSON-LD structure to convert.
|
|
13539
|
+
* @param options The options to use.
|
|
13540
|
+
* - `documentLoader`: The loader for remote JSON-LD documents.
|
|
13541
|
+
* - `contextLoader`: The loader for remote JSON-LD contexts.
|
|
13542
|
+
* - `tracerProvider`: The OpenTelemetry tracer provider to use.
|
|
13543
|
+
* If omitted, the global tracer provider is used.
|
|
13544
|
+
* @returns The object of this type.
|
|
13545
|
+
* @throws {TypeError} If the given `json` is invalid.
|
|
13546
|
+
*/
|
|
13547
|
+
static async fromJsonLd(json, options = {}) {
|
|
13548
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer("@fedify/vocab-tools", "2.2.0").startActiveSpan("activitypub.parse_object", async (span) => {
|
|
13549
|
+
try {
|
|
13550
|
+
const object = await this.__fromJsonLd__Intent__(json, span, options);
|
|
13551
|
+
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
13552
|
+
return object;
|
|
13553
|
+
} catch (error) {
|
|
13554
|
+
span.setStatus({
|
|
13555
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
13556
|
+
message: String(error)
|
|
13557
|
+
});
|
|
13558
|
+
throw error;
|
|
13559
|
+
} finally {
|
|
13560
|
+
span.end();
|
|
13561
|
+
}
|
|
13562
|
+
});
|
|
13563
|
+
}
|
|
13564
|
+
static async __fromJsonLd__Intent__(json, span, options = {}) {
|
|
13565
|
+
if (typeof json === "undefined") throw new TypeError("Invalid JSON-LD: undefined.");
|
|
13566
|
+
else if (json === null) throw new TypeError("Invalid JSON-LD: null.");
|
|
13567
|
+
options = {
|
|
13568
|
+
...options,
|
|
13569
|
+
documentLoader: options.documentLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)(),
|
|
13570
|
+
contextLoader: options.contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)(),
|
|
13571
|
+
tracerProvider: options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()
|
|
13572
|
+
};
|
|
13573
|
+
let values;
|
|
13574
|
+
if (globalThis.Object.keys(json).length == 0) values = {};
|
|
13575
|
+
else values = (await _fedify_vocab_runtime_jsonld.default.expand(json, {
|
|
13576
|
+
documentLoader: options.contextLoader,
|
|
13577
|
+
keepFreeFloatingNodes: true
|
|
13578
|
+
}))[0] ?? {};
|
|
13579
|
+
if (options.baseUrl == null && values["@id"] != null) options = {
|
|
13580
|
+
...options,
|
|
13581
|
+
baseUrl: new URL(values["@id"])
|
|
13582
|
+
};
|
|
13583
|
+
if ("@type" in values) span.setAttribute("activitypub.object.type", values["@type"]);
|
|
13584
|
+
if ("@type" in values && !values["@type"].every((t) => t.startsWith("_:"))) {
|
|
13585
|
+
if (!values["@type"].includes("https://w3id.org/valueflows/ont/vf#Intent")) throw new TypeError("Invalid type: " + values["@type"]);
|
|
13586
|
+
}
|
|
13587
|
+
const instance = new this({ id: "@id" in values ? new URL(values["@id"]) : void 0 }, options);
|
|
13588
|
+
const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action = [];
|
|
13589
|
+
let _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array = values["https://w3id.org/valueflows/ont/vf#action"];
|
|
13590
|
+
for (const v of _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array == null ? [] : _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array.length === 1 && "@list" in _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array[0] ? _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array[0]["@list"] : _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array) {
|
|
13591
|
+
if (v == null) continue;
|
|
13592
|
+
_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.push(v["@value"]);
|
|
13593
|
+
}
|
|
13594
|
+
instance.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = _38VmZKmXJSBy3AvgqNa9GVqbdphy_action;
|
|
13595
|
+
const _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = [];
|
|
13596
|
+
let _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array = values["https://w3id.org/valueflows/ont/vf#resourceConformsTo"];
|
|
13597
|
+
for (const v of _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array == null ? [] : _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array.length === 1 && "@list" in _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array[0] ? _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array[0]["@list"] : _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array) {
|
|
13598
|
+
if (v == null) continue;
|
|
13599
|
+
_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(v["@id"].startsWith("at://") ? new URL("at://" + encodeURIComponent(v["@id"].includes("/", 5) ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) : v["@id"].slice(5)) + (v["@id"].includes("/", 5) ? v["@id"].slice(v["@id"].indexOf("/", 5)) : "")) : URL.canParse(v["@id"]) && (values["@id"] == null ? options.baseUrl : new URL(values["@id"])) ? new URL(v["@id"]) : new URL(v["@id"], values["@id"] == null ? options.baseUrl : new URL(values["@id"])));
|
|
13600
|
+
}
|
|
13601
|
+
instance.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo;
|
|
13602
|
+
const _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = [];
|
|
13603
|
+
let _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array = values["https://w3id.org/valueflows/ont/vf#resourceQuantity"];
|
|
13604
|
+
for (const v of _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array == null ? [] : _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array.length === 1 && "@list" in _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array[0] ? _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array[0]["@list"] : _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array) {
|
|
13605
|
+
if (v == null) continue;
|
|
13606
|
+
_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.push(await Measure.fromJsonLd(v, {
|
|
13607
|
+
...options,
|
|
13608
|
+
baseUrl: values["@id"] == null ? options.baseUrl : new URL(values["@id"])
|
|
13609
|
+
}));
|
|
13610
|
+
}
|
|
13611
|
+
instance.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity;
|
|
13612
|
+
const _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = [];
|
|
13613
|
+
let _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array = values["https://w3id.org/valueflows/ont/vf#availableQuantity"];
|
|
13614
|
+
for (const v of _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array == null ? [] : _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array.length === 1 && "@list" in _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array[0] ? _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array[0]["@list"] : _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array) {
|
|
13615
|
+
if (v == null) continue;
|
|
13616
|
+
_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.push(await Measure.fromJsonLd(v, {
|
|
13617
|
+
...options,
|
|
13618
|
+
baseUrl: values["@id"] == null ? options.baseUrl : new URL(values["@id"])
|
|
13619
|
+
}));
|
|
13620
|
+
}
|
|
13621
|
+
instance.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity;
|
|
13622
|
+
const _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = [];
|
|
13623
|
+
let _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array = values["https://w3id.org/valueflows/ont/vf#minimumQuantity"];
|
|
13624
|
+
for (const v of _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array == null ? [] : _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array.length === 1 && "@list" in _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array[0] ? _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array[0]["@list"] : _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array) {
|
|
13625
|
+
if (v == null) continue;
|
|
13626
|
+
_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.push(await Measure.fromJsonLd(v, {
|
|
13627
|
+
...options,
|
|
13628
|
+
baseUrl: values["@id"] == null ? options.baseUrl : new URL(values["@id"])
|
|
13629
|
+
}));
|
|
13630
|
+
}
|
|
13631
|
+
instance.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity;
|
|
13632
|
+
if (!("_fromSubclass" in options) || !options._fromSubclass) try {
|
|
13633
|
+
instance._cachedJsonLd = structuredClone(json);
|
|
13634
|
+
} catch {
|
|
13635
|
+
(0, _logtape_logtape.getLogger)(["fedify", "vocab"]).warn("Failed to cache JSON-LD: {json}", { json });
|
|
13636
|
+
}
|
|
13637
|
+
return instance;
|
|
13638
|
+
}
|
|
13639
|
+
_getCustomInspectProxy() {
|
|
13640
|
+
const proxy = {};
|
|
13641
|
+
if (this.id != null) proxy.id = {
|
|
13642
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(this.id.href, options),
|
|
13643
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(this.id.href, options)
|
|
13644
|
+
};
|
|
13645
|
+
const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.map((v) => v instanceof URL ? {
|
|
13646
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
13647
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
13648
|
+
} : v);
|
|
13649
|
+
if (_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length == 1) proxy.action = _38VmZKmXJSBy3AvgqNa9GVqbdphy_action[0];
|
|
13650
|
+
const _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.map((v) => v instanceof URL ? {
|
|
13651
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
13652
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
13653
|
+
} : v);
|
|
13654
|
+
if (_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length == 1) proxy.resourceConformsTo = _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[0];
|
|
13655
|
+
const _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.map((v) => v instanceof URL ? {
|
|
13656
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
13657
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
13658
|
+
} : v);
|
|
13659
|
+
if (_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length == 1) proxy.resourceQuantity = _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[0];
|
|
13660
|
+
const _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.map((v) => v instanceof URL ? {
|
|
13661
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
13662
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
13663
|
+
} : v);
|
|
13664
|
+
if (_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length == 1) proxy.availableQuantity = _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[0];
|
|
13665
|
+
const _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.map((v) => v instanceof URL ? {
|
|
13666
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
13667
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
13668
|
+
} : v);
|
|
13669
|
+
if (_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length == 1) proxy.minimumQuantity = _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[0];
|
|
13670
|
+
return proxy;
|
|
13671
|
+
}
|
|
13672
|
+
};
|
|
13673
|
+
Intent.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
|
|
13674
|
+
return "Intent " + inspect(this._getCustomInspectProxy(), options);
|
|
13675
|
+
};
|
|
13676
|
+
Intent.prototype[Symbol.for("nodejs.util.inspect.custom")] = function(_depth, options, inspect) {
|
|
13677
|
+
return "Intent " + inspect(this._getCustomInspectProxy(), options);
|
|
13678
|
+
};
|
|
13679
|
+
/** A published request or offer, sometimes with what is expected in return.
|
|
13680
|
+
*
|
|
13681
|
+
* Proposals contain a primary {@link Intent} (via `publishes`) describing
|
|
13682
|
+
* what is being offered or requested, and optionally a reciprocal
|
|
13683
|
+
* {@link Intent} describing what is expected or offered in return.
|
|
13684
|
+
*
|
|
13685
|
+
* Note: This type extends ActivityStreams `Object` for practical
|
|
13686
|
+
* interoperability within ActivityPub federation, even though FEP-0837
|
|
13687
|
+
* defines `Proposal` as a pure ValueFlows type. Extending `Object`
|
|
13688
|
+
* provides useful inherited properties such as `name`, `content`,
|
|
13689
|
+
* `attributedTo`, `published`, `to`, and `location` without needing to
|
|
13690
|
+
* redefine them.
|
|
13691
|
+
*/
|
|
13692
|
+
var Proposal = class Proposal extends Object$1 {
|
|
13693
|
+
/**
|
|
13694
|
+
* The type URI of {@link Proposal}: `https://w3id.org/valueflows/ont/vf#Proposal`.
|
|
13695
|
+
*/
|
|
13696
|
+
static get typeId() {
|
|
13697
|
+
return new URL("https://w3id.org/valueflows/ont/vf#Proposal");
|
|
13698
|
+
}
|
|
13699
|
+
#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = [];
|
|
13700
|
+
#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = [];
|
|
13701
|
+
#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = [];
|
|
13702
|
+
#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = [];
|
|
13703
|
+
/**
|
|
13704
|
+
* Constructs a new instance of Proposal with the given values.
|
|
13705
|
+
* @param values The values to initialize the instance with.
|
|
13706
|
+
* @param options The options to use for initialization.
|
|
13707
|
+
*/
|
|
13708
|
+
constructor(values, options = {}) {
|
|
13709
|
+
super(values, options);
|
|
13710
|
+
if ("purpose" in values && values.purpose != null) if (typeof values.purpose === "string") this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = [values.purpose];
|
|
13711
|
+
else throw new TypeError("The purpose must be of type string.");
|
|
13712
|
+
if ("publishes" in values && values.publishes != null) if (values.publishes instanceof Intent) this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = [values.publishes];
|
|
13713
|
+
else throw new TypeError("The publishes must be of type Intent.");
|
|
13714
|
+
if ("reciprocal" in values && values.reciprocal != null) if (values.reciprocal instanceof Intent) this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = [values.reciprocal];
|
|
13715
|
+
else throw new TypeError("The reciprocal must be of type Intent.");
|
|
13716
|
+
if ("unitBased" in values && values.unitBased != null) if (typeof values.unitBased === "boolean") this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = [values.unitBased];
|
|
13717
|
+
else throw new TypeError("The unitBased must be of type boolean.");
|
|
13718
|
+
}
|
|
13719
|
+
/**
|
|
13720
|
+
* Clones this instance, optionally updating it with the given values.
|
|
13721
|
+
* @param values The values to update the clone with.
|
|
13722
|
+
* @param options The options to use for cloning.
|
|
13723
|
+
* @returns The cloned instance.
|
|
13724
|
+
*/
|
|
13725
|
+
clone(values = {}, options = {}) {
|
|
13726
|
+
if (this._warning != null) {
|
|
13727
|
+
(0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13728
|
+
options = {
|
|
13729
|
+
...options,
|
|
13730
|
+
$warning: this._warning
|
|
13731
|
+
};
|
|
13732
|
+
}
|
|
13733
|
+
const clone = super.clone(values, options);
|
|
13734
|
+
clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose;
|
|
13735
|
+
if ("purpose" in values && values.purpose != null) if (typeof values.purpose === "string") clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = [values.purpose];
|
|
13736
|
+
else throw new TypeError("The purpose must be of type string.");
|
|
13737
|
+
clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes;
|
|
13738
|
+
if ("publishes" in values && values.publishes != null) if (values.publishes instanceof Intent) clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = [values.publishes];
|
|
13739
|
+
else throw new TypeError("The publishes must be of type Intent.");
|
|
13740
|
+
clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal;
|
|
13741
|
+
if ("reciprocal" in values && values.reciprocal != null) if (values.reciprocal instanceof Intent) clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = [values.reciprocal];
|
|
13742
|
+
else throw new TypeError("The reciprocal must be of type Intent.");
|
|
13743
|
+
clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased;
|
|
13744
|
+
if ("unitBased" in values && values.unitBased != null) if (typeof values.unitBased === "boolean") clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = [values.unitBased];
|
|
13745
|
+
else throw new TypeError("The unitBased must be of type boolean.");
|
|
13746
|
+
return clone;
|
|
13747
|
+
}
|
|
13748
|
+
/** The type of proposal. Possible values are `"offer"` and `"request"`.
|
|
13749
|
+
*/
|
|
13750
|
+
get purpose() {
|
|
13751
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13752
|
+
if (this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.length < 1) return null;
|
|
13753
|
+
return this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose[0];
|
|
13754
|
+
}
|
|
13755
|
+
/** The primary intent of this proposal, describing what is being offered
|
|
13756
|
+
* or requested.
|
|
13757
|
+
*/
|
|
13758
|
+
get publishes() {
|
|
13759
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13760
|
+
if (this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length < 1) return null;
|
|
13761
|
+
return this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[0];
|
|
13762
|
+
}
|
|
13763
|
+
/** The reciprocal intent of this proposal, describing what is expected
|
|
13764
|
+
* or offered in return.
|
|
13765
|
+
*/
|
|
13766
|
+
get reciprocal() {
|
|
13767
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13768
|
+
if (this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length < 1) return null;
|
|
13769
|
+
return this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[0];
|
|
13770
|
+
}
|
|
13771
|
+
/** Indicates whether the quantities expressed in the proposal can be
|
|
13772
|
+
* multiplied or not. The default is `false`.
|
|
13773
|
+
*/
|
|
13774
|
+
get unitBased() {
|
|
13775
|
+
if (this._warning != null) (0, _logtape_logtape.getLogger)(this._warning.category).warn(this._warning.message, this._warning.values);
|
|
13776
|
+
if (this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.length < 1) return null;
|
|
13777
|
+
return this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased[0];
|
|
13778
|
+
}
|
|
13779
|
+
/**
|
|
13780
|
+
* Converts this object to a JSON-LD structure.
|
|
13781
|
+
* @param options The options to use.
|
|
13782
|
+
* - `format`: The format of the output: `compact` or
|
|
13783
|
+
`expand`.
|
|
13784
|
+
* - `contextLoader`: The loader for remote JSON-LD contexts.
|
|
13785
|
+
* - `context`: The JSON-LD context to use. Not applicable
|
|
13786
|
+
when `format` is set to `'expand'`.
|
|
13787
|
+
* @returns The JSON-LD representation of this object.
|
|
13788
|
+
*/
|
|
13789
|
+
async toJsonLd(options = {}) {
|
|
13790
|
+
if (options.format == null && this._cachedJsonLd != null) return this._cachedJsonLd;
|
|
13791
|
+
if (options.format !== "compact" && options.context != null) throw new TypeError("The context option can only be used when the format option is set to 'compact'.");
|
|
13792
|
+
options = {
|
|
13793
|
+
...options,
|
|
13794
|
+
contextLoader: options.contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)()
|
|
13795
|
+
};
|
|
13796
|
+
if (options.format == null && this.isCompactable()) {
|
|
13797
|
+
const result = await super.toJsonLd({
|
|
13798
|
+
...options,
|
|
13799
|
+
format: void 0,
|
|
13800
|
+
context: void 0
|
|
13801
|
+
});
|
|
13802
|
+
let compactItems = [];
|
|
13803
|
+
for (const v of this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) {
|
|
13804
|
+
const item = v;
|
|
13805
|
+
compactItems.push(item);
|
|
13806
|
+
}
|
|
13807
|
+
if (compactItems.length > 0) result["purpose"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13808
|
+
compactItems = [];
|
|
13809
|
+
for (const v of this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) {
|
|
13810
|
+
const item = await v.toJsonLd({
|
|
13811
|
+
...options,
|
|
13812
|
+
format: void 0,
|
|
13813
|
+
context: void 0
|
|
13814
|
+
});
|
|
13815
|
+
compactItems.push(item);
|
|
13816
|
+
}
|
|
13817
|
+
if (compactItems.length > 0) result["publishes"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13818
|
+
compactItems = [];
|
|
13819
|
+
for (const v of this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) {
|
|
13820
|
+
const item = await v.toJsonLd({
|
|
13821
|
+
...options,
|
|
13822
|
+
format: void 0,
|
|
13823
|
+
context: void 0
|
|
13824
|
+
});
|
|
13825
|
+
compactItems.push(item);
|
|
13826
|
+
}
|
|
13827
|
+
if (compactItems.length > 0) result["reciprocal"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13828
|
+
compactItems = [];
|
|
13829
|
+
for (const v of this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) {
|
|
13830
|
+
const item = v;
|
|
13831
|
+
compactItems.push(item);
|
|
13832
|
+
}
|
|
13833
|
+
if (compactItems.length > 0) result["unitBased"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
13834
|
+
result["type"] = "Proposal";
|
|
13835
|
+
if (this.id != null) result["id"] = this.id.href;
|
|
13836
|
+
result["@context"] = [
|
|
13837
|
+
"https://www.w3.org/ns/activitystreams",
|
|
13838
|
+
"https://w3id.org/security/data-integrity/v1",
|
|
13839
|
+
"https://gotosocial.org/ns",
|
|
13840
|
+
{
|
|
13841
|
+
"vf": "https://w3id.org/valueflows/ont/vf#",
|
|
13842
|
+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
|
|
13843
|
+
"fedibird": "http://fedibird.com/ns#",
|
|
13844
|
+
"sensitive": "as:sensitive",
|
|
13845
|
+
"emojiReactions": {
|
|
13846
|
+
"@id": "fedibird:emojiReactions",
|
|
13847
|
+
"@type": "@id"
|
|
13848
|
+
},
|
|
13849
|
+
"Proposal": "vf:Proposal",
|
|
13850
|
+
"Intent": "vf:Intent",
|
|
13851
|
+
"purpose": "vf:purpose",
|
|
13852
|
+
"unitBased": "vf:unitBased",
|
|
13853
|
+
"publishes": "vf:publishes",
|
|
13854
|
+
"reciprocal": "vf:reciprocal",
|
|
13855
|
+
"action": "vf:action",
|
|
13856
|
+
"resourceConformsTo": {
|
|
13857
|
+
"@id": "vf:resourceConformsTo",
|
|
13858
|
+
"@type": "@id"
|
|
13859
|
+
},
|
|
13860
|
+
"resourceQuantity": "vf:resourceQuantity",
|
|
13861
|
+
"availableQuantity": "vf:availableQuantity",
|
|
13862
|
+
"minimumQuantity": "vf:minimumQuantity",
|
|
13863
|
+
"hasUnit": "om2:hasUnit",
|
|
13864
|
+
"hasNumericalValue": "om2:hasNumericalValue"
|
|
13865
|
+
}
|
|
13866
|
+
];
|
|
13867
|
+
return result;
|
|
13868
|
+
}
|
|
13869
|
+
let array;
|
|
13870
|
+
const values = (await super.toJsonLd({
|
|
13871
|
+
...options,
|
|
13872
|
+
format: "expand",
|
|
13873
|
+
context: void 0
|
|
13874
|
+
}))[0];
|
|
13875
|
+
array = [];
|
|
13876
|
+
for (const v of this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) {
|
|
13877
|
+
const element = { "@value": v };
|
|
13878
|
+
array.push(element);
|
|
13879
|
+
}
|
|
13880
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#purpose"] = array;
|
|
13881
|
+
array = [];
|
|
13882
|
+
for (const v of this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) {
|
|
13883
|
+
const element = await v.toJsonLd(options);
|
|
13884
|
+
array.push(element);
|
|
13885
|
+
}
|
|
13886
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#publishes"] = array;
|
|
13887
|
+
array = [];
|
|
13888
|
+
for (const v of this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) {
|
|
13889
|
+
const element = await v.toJsonLd(options);
|
|
13890
|
+
array.push(element);
|
|
13891
|
+
}
|
|
13892
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#reciprocal"] = array;
|
|
13893
|
+
array = [];
|
|
13894
|
+
for (const v of this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) {
|
|
13895
|
+
const element = { "@value": v };
|
|
13896
|
+
array.push(element);
|
|
13897
|
+
}
|
|
13898
|
+
if (array.length > 0) values["https://w3id.org/valueflows/ont/vf#unitBased"] = array;
|
|
13899
|
+
values["@type"] = ["https://w3id.org/valueflows/ont/vf#Proposal"];
|
|
13900
|
+
if (this.id != null) values["@id"] = this.id.href;
|
|
13901
|
+
if (options.format === "expand") return await _fedify_vocab_runtime_jsonld.default.expand(values, { documentLoader: options.contextLoader });
|
|
13902
|
+
const docContext = options.context ?? [
|
|
13903
|
+
"https://www.w3.org/ns/activitystreams",
|
|
13904
|
+
"https://w3id.org/security/data-integrity/v1",
|
|
13905
|
+
"https://gotosocial.org/ns",
|
|
13906
|
+
{
|
|
13907
|
+
"vf": "https://w3id.org/valueflows/ont/vf#",
|
|
13908
|
+
"om2": "http://www.ontology-of-units-of-measure.org/resource/om-2/",
|
|
13909
|
+
"fedibird": "http://fedibird.com/ns#",
|
|
13910
|
+
"sensitive": "as:sensitive",
|
|
13911
|
+
"emojiReactions": {
|
|
13912
|
+
"@id": "fedibird:emojiReactions",
|
|
13913
|
+
"@type": "@id"
|
|
13914
|
+
},
|
|
13915
|
+
"Proposal": "vf:Proposal",
|
|
13916
|
+
"Intent": "vf:Intent",
|
|
13917
|
+
"purpose": "vf:purpose",
|
|
13918
|
+
"unitBased": "vf:unitBased",
|
|
13919
|
+
"publishes": "vf:publishes",
|
|
13920
|
+
"reciprocal": "vf:reciprocal",
|
|
13921
|
+
"action": "vf:action",
|
|
13922
|
+
"resourceConformsTo": {
|
|
13923
|
+
"@id": "vf:resourceConformsTo",
|
|
13924
|
+
"@type": "@id"
|
|
13925
|
+
},
|
|
13926
|
+
"resourceQuantity": "vf:resourceQuantity",
|
|
13927
|
+
"availableQuantity": "vf:availableQuantity",
|
|
13928
|
+
"minimumQuantity": "vf:minimumQuantity",
|
|
13929
|
+
"hasUnit": "om2:hasUnit",
|
|
13930
|
+
"hasNumericalValue": "om2:hasNumericalValue"
|
|
13931
|
+
}
|
|
13932
|
+
];
|
|
13933
|
+
const compacted = await _fedify_vocab_runtime_jsonld.default.compact(values, docContext, { documentLoader: options.contextLoader });
|
|
13934
|
+
if (docContext != null) {
|
|
13935
|
+
if ("proof" in compacted && compacted.proof != null) if (Array.isArray(compacted.proof)) for (const element of compacted.proof) element["@context"] = docContext;
|
|
13936
|
+
else compacted.proof["@context"] = docContext;
|
|
13937
|
+
}
|
|
13938
|
+
return compacted;
|
|
13939
|
+
}
|
|
13940
|
+
isCompactable() {
|
|
13941
|
+
return super.isCompactable();
|
|
13942
|
+
}
|
|
13943
|
+
/**
|
|
13944
|
+
* Converts a JSON-LD structure to an object of this type.
|
|
13945
|
+
* @param json The JSON-LD structure to convert.
|
|
13946
|
+
* @param options The options to use.
|
|
13947
|
+
* - `documentLoader`: The loader for remote JSON-LD documents.
|
|
13948
|
+
* - `contextLoader`: The loader for remote JSON-LD contexts.
|
|
13949
|
+
* - `tracerProvider`: The OpenTelemetry tracer provider to use.
|
|
13950
|
+
* If omitted, the global tracer provider is used.
|
|
13951
|
+
* @returns The object of this type.
|
|
13952
|
+
* @throws {TypeError} If the given `json` is invalid.
|
|
13953
|
+
*/
|
|
13954
|
+
static async fromJsonLd(json, options = {}) {
|
|
13955
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer("@fedify/vocab-tools", "2.2.0").startActiveSpan("activitypub.parse_object", async (span) => {
|
|
13956
|
+
try {
|
|
13957
|
+
const object = await this.__fromJsonLd__Proposal__(json, span, options);
|
|
13958
|
+
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
13959
|
+
return object;
|
|
13960
|
+
} catch (error) {
|
|
13961
|
+
span.setStatus({
|
|
13962
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
13963
|
+
message: String(error)
|
|
13964
|
+
});
|
|
13965
|
+
throw error;
|
|
13966
|
+
} finally {
|
|
13967
|
+
span.end();
|
|
13968
|
+
}
|
|
13969
|
+
});
|
|
13970
|
+
}
|
|
13971
|
+
static async __fromJsonLd__Proposal__(json, span, options = {}) {
|
|
13972
|
+
if (typeof json === "undefined") throw new TypeError("Invalid JSON-LD: undefined.");
|
|
13973
|
+
else if (json === null) throw new TypeError("Invalid JSON-LD: null.");
|
|
13974
|
+
options = {
|
|
13975
|
+
...options,
|
|
13976
|
+
documentLoader: options.documentLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)(),
|
|
13977
|
+
contextLoader: options.contextLoader ?? (0, _fedify_vocab_runtime.getDocumentLoader)(),
|
|
13978
|
+
tracerProvider: options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()
|
|
13979
|
+
};
|
|
13980
|
+
let values;
|
|
13981
|
+
if (globalThis.Object.keys(json).length == 0) values = {};
|
|
13982
|
+
else values = (await _fedify_vocab_runtime_jsonld.default.expand(json, {
|
|
13983
|
+
documentLoader: options.contextLoader,
|
|
13984
|
+
keepFreeFloatingNodes: true
|
|
13985
|
+
}))[0] ?? {};
|
|
13986
|
+
if (options.baseUrl == null && values["@id"] != null) options = {
|
|
13987
|
+
...options,
|
|
13988
|
+
baseUrl: new URL(values["@id"])
|
|
13989
|
+
};
|
|
13990
|
+
if ("@type" in values) span.setAttribute("activitypub.object.type", values["@type"]);
|
|
13991
|
+
if ("@type" in values && !values["@type"].every((t) => t.startsWith("_:"))) {
|
|
13992
|
+
if (!values["@type"].includes("https://w3id.org/valueflows/ont/vf#Proposal")) throw new TypeError("Invalid type: " + values["@type"]);
|
|
13993
|
+
}
|
|
13994
|
+
delete values["@type"];
|
|
13995
|
+
const instance = await super.fromJsonLd(values, {
|
|
13996
|
+
...options,
|
|
13997
|
+
_fromSubclass: true
|
|
13998
|
+
});
|
|
13999
|
+
if (!(instance instanceof Proposal)) throw new TypeError("Unexpected type: " + instance.constructor.name);
|
|
14000
|
+
const _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = [];
|
|
14001
|
+
let _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array = values["https://w3id.org/valueflows/ont/vf#purpose"];
|
|
14002
|
+
for (const v of _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array == null ? [] : _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array.length === 1 && "@list" in _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array[0] ? _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array[0]["@list"] : _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array) {
|
|
14003
|
+
if (v == null) continue;
|
|
14004
|
+
_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.push(v["@value"]);
|
|
14005
|
+
}
|
|
14006
|
+
instance.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose;
|
|
14007
|
+
const _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = [];
|
|
14008
|
+
let _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array = values["https://w3id.org/valueflows/ont/vf#publishes"];
|
|
14009
|
+
for (const v of _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array == null ? [] : _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array.length === 1 && "@list" in _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array[0] ? _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array[0]["@list"] : _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array) {
|
|
14010
|
+
if (v == null) continue;
|
|
14011
|
+
_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.push(await Intent.fromJsonLd(v, {
|
|
14012
|
+
...options,
|
|
14013
|
+
baseUrl: values["@id"] == null ? options.baseUrl : new URL(values["@id"])
|
|
14014
|
+
}));
|
|
14015
|
+
}
|
|
14016
|
+
instance.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes;
|
|
14017
|
+
const _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = [];
|
|
14018
|
+
let _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array = values["https://w3id.org/valueflows/ont/vf#reciprocal"];
|
|
14019
|
+
for (const v of _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array == null ? [] : _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array.length === 1 && "@list" in _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array[0] ? _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array[0]["@list"] : _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array) {
|
|
14020
|
+
if (v == null) continue;
|
|
14021
|
+
_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.push(await Intent.fromJsonLd(v, {
|
|
14022
|
+
...options,
|
|
14023
|
+
baseUrl: values["@id"] == null ? options.baseUrl : new URL(values["@id"])
|
|
14024
|
+
}));
|
|
14025
|
+
}
|
|
14026
|
+
instance.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal;
|
|
14027
|
+
const _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = [];
|
|
14028
|
+
let _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array = values["https://w3id.org/valueflows/ont/vf#unitBased"];
|
|
14029
|
+
for (const v of _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array == null ? [] : _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array.length === 1 && "@list" in _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array[0] ? _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array[0]["@list"] : _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array) {
|
|
14030
|
+
if (v == null) continue;
|
|
14031
|
+
_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.push(v["@value"]);
|
|
14032
|
+
}
|
|
14033
|
+
instance.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased;
|
|
14034
|
+
if (!("_fromSubclass" in options) || !options._fromSubclass) try {
|
|
14035
|
+
instance._cachedJsonLd = structuredClone(json);
|
|
14036
|
+
} catch {
|
|
14037
|
+
(0, _logtape_logtape.getLogger)(["fedify", "vocab"]).warn("Failed to cache JSON-LD: {json}", { json });
|
|
14038
|
+
}
|
|
14039
|
+
return instance;
|
|
14040
|
+
}
|
|
14041
|
+
_getCustomInspectProxy() {
|
|
14042
|
+
const proxy = super._getCustomInspectProxy();
|
|
14043
|
+
const _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.map((v) => v instanceof URL ? {
|
|
14044
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
14045
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
14046
|
+
} : v);
|
|
14047
|
+
if (_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.length == 1) proxy.purpose = _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose[0];
|
|
14048
|
+
const _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.map((v) => v instanceof URL ? {
|
|
14049
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
14050
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
14051
|
+
} : v);
|
|
14052
|
+
if (_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length == 1) proxy.publishes = _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[0];
|
|
14053
|
+
const _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.map((v) => v instanceof URL ? {
|
|
14054
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
14055
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
14056
|
+
} : v);
|
|
14057
|
+
if (_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length == 1) proxy.reciprocal = _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[0];
|
|
14058
|
+
const _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.map((v) => v instanceof URL ? {
|
|
14059
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
|
14060
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options)
|
|
14061
|
+
} : v);
|
|
14062
|
+
if (_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.length == 1) proxy.unitBased = _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased[0];
|
|
14063
|
+
return proxy;
|
|
14064
|
+
}
|
|
14065
|
+
};
|
|
14066
|
+
Proposal.prototype[Symbol.for("Deno.customInspect")] = function(inspect, options) {
|
|
14067
|
+
return "Proposal " + inspect(this._getCustomInspectProxy(), options);
|
|
14068
|
+
};
|
|
14069
|
+
Proposal.prototype[Symbol.for("nodejs.util.inspect.custom")] = function(_depth, options, inspect) {
|
|
14070
|
+
return "Proposal " + inspect(this._getCustomInspectProxy(), options);
|
|
14071
|
+
};
|
|
13000
14072
|
/** Indicates that the `actor` accepts the `object`. The `target` property can be
|
|
13001
14073
|
* used in certain circumstances to indicate the context into which the `object`
|
|
13002
14074
|
* has been accepted.
|
|
@@ -20085,6 +21157,7 @@ var Collection = class Collection extends Object$1 {
|
|
|
20085
21157
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
20086
21158
|
"https://gotosocial.org/ns#LikeApproval",
|
|
20087
21159
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
21160
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
20088
21161
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
20089
21162
|
"http://litepub.social/ns#EmojiReact",
|
|
20090
21163
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -26326,6 +27399,7 @@ var Link = class Link {
|
|
|
26326
27399
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
26327
27400
|
"https://gotosocial.org/ns#LikeApproval",
|
|
26328
27401
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
27402
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
26329
27403
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
26330
27404
|
"http://litepub.social/ns#EmojiReact",
|
|
26331
27405
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -28583,6 +29657,7 @@ var OrderedCollection = class OrderedCollection extends Collection {
|
|
|
28583
29657
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
28584
29658
|
"https://gotosocial.org/ns#LikeApproval",
|
|
28585
29659
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
29660
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
28586
29661
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
28587
29662
|
"http://litepub.social/ns#EmojiReact",
|
|
28588
29663
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -29068,6 +30143,7 @@ var OrderedCollectionPage = class OrderedCollectionPage extends CollectionPage {
|
|
|
29068
30143
|
"https://gotosocial.org/ns#AnnounceAuthorization",
|
|
29069
30144
|
"https://gotosocial.org/ns#LikeApproval",
|
|
29070
30145
|
"https://gotosocial.org/ns#ReplyAuthorization",
|
|
30146
|
+
"https://w3id.org/valueflows/ont/vf#Proposal",
|
|
29071
30147
|
"https://www.w3.org/ns/activitystreams#Activity",
|
|
29072
30148
|
"http://litepub.social/ns#EmojiReact",
|
|
29073
30149
|
"https://gotosocial.org/ns#AnnounceRequest",
|
|
@@ -43764,6 +44840,7 @@ exports.Group = Group;
|
|
|
43764
44840
|
exports.Hashtag = Hashtag;
|
|
43765
44841
|
exports.Ignore = Ignore;
|
|
43766
44842
|
exports.Image = Image;
|
|
44843
|
+
exports.Intent = Intent;
|
|
43767
44844
|
exports.InteractionPolicy = InteractionPolicy;
|
|
43768
44845
|
exports.InteractionRule = InteractionRule;
|
|
43769
44846
|
exports.IntransitiveActivity = IntransitiveActivity;
|
|
@@ -43781,6 +44858,7 @@ exports.LikeAuthorization = LikeAuthorization;
|
|
|
43781
44858
|
exports.LikeRequest = LikeRequest;
|
|
43782
44859
|
exports.Link = Link;
|
|
43783
44860
|
exports.Listen = Listen;
|
|
44861
|
+
exports.Measure = Measure;
|
|
43784
44862
|
exports.Mention = Mention;
|
|
43785
44863
|
exports.Move = Move;
|
|
43786
44864
|
exports.Multikey = Multikey;
|
|
@@ -43796,6 +44874,7 @@ exports.Person = Person;
|
|
|
43796
44874
|
exports.Place = Place;
|
|
43797
44875
|
exports.Profile = Profile;
|
|
43798
44876
|
exports.PropertyValue = PropertyValue;
|
|
44877
|
+
exports.Proposal = Proposal;
|
|
43799
44878
|
exports.Question = Question;
|
|
43800
44879
|
exports.Read = Read;
|
|
43801
44880
|
exports.Reject = Reject;
|