@comunica/actor-rdf-update-hypermedia-put-ldp 4.5.0 → 5.0.0

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/README.md CHANGED
@@ -26,7 +26,7 @@ After installing, this package can be added to your engine's configuration as fo
26
26
  {
27
27
  "@context": [
28
28
  ...
29
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^4.0.0/components/context.jsonld"
29
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^5.0.0/components/context.jsonld"
30
30
  ],
31
31
  "actors": [
32
32
  ...
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-hypermedia/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-hypermedia/^5.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-rdf-update-hypermedia-put-ldp",
8
8
  "components": [
@@ -50,37 +50,37 @@
50
50
  "genericTypeInstances": [
51
51
  {
52
52
  "@type": "ParameterRangeGenericTypeReference",
53
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
53
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
54
54
  },
55
55
  {
56
56
  "@type": "ParameterRangeGenericTypeReference",
57
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
57
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
58
58
  },
59
59
  {
60
60
  "@type": "ParameterRangeGenericTypeReference",
61
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
61
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
62
62
  },
63
63
  {
64
64
  "@type": "ParameterRangeGenericTypeReference",
65
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
65
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
66
66
  }
67
67
  ]
68
68
  },
69
69
  {
70
70
  "@type": "ParameterRangeGenericTypeReference",
71
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
71
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
72
72
  },
73
73
  {
74
74
  "@type": "ParameterRangeGenericTypeReference",
75
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
75
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
76
76
  },
77
77
  {
78
78
  "@type": "ParameterRangeGenericTypeReference",
79
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
79
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
80
80
  },
81
81
  {
82
82
  "@type": "ParameterRangeGenericTypeReference",
83
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
83
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
84
84
  }
85
85
  ]
86
86
  },
@@ -117,19 +117,19 @@
117
117
  "genericTypeInstances": [
118
118
  {
119
119
  "@type": "ParameterRangeGenericTypeReference",
120
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
120
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
121
121
  },
122
122
  {
123
123
  "@type": "ParameterRangeGenericTypeReference",
124
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
124
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
125
125
  },
126
126
  {
127
127
  "@type": "ParameterRangeGenericTypeReference",
128
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
128
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
129
129
  },
130
130
  {
131
131
  "@type": "ParameterRangeGenericTypeReference",
132
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
132
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
133
133
  }
134
134
  ]
135
135
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld",
6
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-quads/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^5.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
6
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-quads/^5.0.0/components/context.jsonld"
7
7
  ],
8
8
  "@id": "npmd:@comunica/actor-rdf-update-hypermedia-put-ldp",
9
9
  "components": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-rdf-update-hypermedia-put-ldp/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-rdf-update-hypermedia-put-ldp",
6
6
  "@type": "Module",
@@ -3,7 +3,7 @@
3
3
  "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
4
4
  {
5
5
  "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
- "caruhpl": "npmd:@comunica/actor-rdf-update-hypermedia-put-ldp/^4.0.0/",
6
+ "caruhpl": "npmd:@comunica/actor-rdf-update-hypermedia-put-ldp/^5.0.0/",
7
7
  "ActorRdfUpdateHypermediaPutLdp": {
8
8
  "@id": "caruhpl:components/ActorRdfUpdateHypermediaPutLdp.jsonld#ActorRdfUpdateHypermediaPutLdp",
9
9
  "@prefix": true,
File without changes
@@ -8,8 +8,14 @@ const QuadDestinationPutLdp_1 = require("./QuadDestinationPutLdp");
8
8
  * A comunica Post LDP RDF Update Hypermedia Actor.
9
9
  */
10
10
  class ActorRdfUpdateHypermediaPutLdp extends bus_rdf_update_hypermedia_1.ActorRdfUpdateHypermedia {
11
+ mediatorHttp;
12
+ mediatorRdfSerializeMediatypes;
13
+ mediatorRdfSerialize;
11
14
  constructor(args) {
12
15
  super(args, 'putLdp');
16
+ this.mediatorHttp = args.mediatorHttp;
17
+ this.mediatorRdfSerializeMediatypes = args.mediatorRdfSerializeMediatypes;
18
+ this.mediatorRdfSerialize = args.mediatorRdfSerialize;
13
19
  }
14
20
  async testMetadata(action) {
15
21
  if (!action.forceDestinationType) {
@@ -1 +1 @@
1
- {"version":3,"file":"ActorRdfUpdateHypermediaPutLdp.js","sourceRoot":"","sources":["ActorRdfUpdateHypermediaPutLdp.ts"],"names":[],"mappings":";;;AAOA,mFAA+E;AAE/E,yCAAwD;AACxD,mEAAgE;AAEhE;;GAEG;AACH,MAAa,8BAA+B,SAAQ,oDAAwB;IAK1E,YAAmB,IAA0C;QAC3D,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,MAAkC;QAC1D,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3F,OAAO,IAAA,eAAQ,EAAC,SAAS,IAAI,CAAC,IAAI,2DAA2D,CAAC,CAAC;YACjG,CAAC;YACD,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClB,OAAO,IAAA,eAAQ,EAAC,SAAS,IAAI,CAAC,IAAI,8DAA8D,CAAC,CAAC;YACpG,CAAC;QACH,CAAC;QACD,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,MAAkC;QACjD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,qCAAqC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;QAChF,OAAO;YACL,WAAW,EAAE,IAAI,6CAAqB,CACpC,MAAM,CAAC,GAAG,EACV,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,EACjC,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,8BAA8B,EACnC,IAAI,CAAC,oBAAoB,CAC1B;SACF,CAAC;IACJ,CAAC;CACF;AAlCD,wEAkCC","sourcesContent":["import type { MediatorHttp } from '@comunica/bus-http';\nimport type { MediatorRdfSerializeHandle, MediatorRdfSerializeMediaTypes } from '@comunica/bus-rdf-serialize';\nimport type {\n IActionRdfUpdateHypermedia,\n IActorRdfUpdateHypermediaOutput,\n IActorRdfUpdateHypermediaArgs,\n} from '@comunica/bus-rdf-update-hypermedia';\nimport { ActorRdfUpdateHypermedia } from '@comunica/bus-rdf-update-hypermedia';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport { QuadDestinationPutLdp } from './QuadDestinationPutLdp';\n\n/**\n * A comunica Post LDP RDF Update Hypermedia Actor.\n */\nexport class ActorRdfUpdateHypermediaPutLdp extends ActorRdfUpdateHypermedia {\n public readonly mediatorHttp: MediatorHttp;\n public readonly mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes;\n public readonly mediatorRdfSerialize: MediatorRdfSerializeHandle;\n\n public constructor(args: IActorRdfUpdateHypermediaPostLdpArgs) {\n super(args, 'putLdp');\n }\n\n public async testMetadata(action: IActionRdfUpdateHypermedia): Promise<TestResult<IActorTest>> {\n if (!action.forceDestinationType) {\n if (!action.metadata.allowHttpMethods || !action.metadata.allowHttpMethods.includes('PUT')) {\n return failTest(`Actor ${this.name} could not detect a destination with 'Allow: PUT' header.`);\n }\n if (action.exists) {\n return failTest(`Actor ${this.name} can only put on a destination that does not already exists.`);\n }\n }\n return passTestVoid();\n }\n\n public async run(action: IActionRdfUpdateHypermedia): Promise<IActorRdfUpdateHypermediaOutput> {\n this.logInfo(action.context, `Identified as putLdp destination: ${action.url}`);\n return {\n destination: new QuadDestinationPutLdp(\n action.url,\n action.context,\n action.metadata.putAccepted || [],\n this.mediatorHttp,\n this.mediatorRdfSerializeMediatypes,\n this.mediatorRdfSerialize,\n ),\n };\n }\n}\n\nexport interface IActorRdfUpdateHypermediaPostLdpArgs extends IActorRdfUpdateHypermediaArgs {\n /**\n * The HTTP mediator\n */\n mediatorHttp: MediatorHttp;\n /**\n * The RDF Serialize mediator for collecting media types\n */\n mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes;\n /**\n * The RDF Serialize mediator for handling serialization\n */\n mediatorRdfSerialize: MediatorR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,CACpC,MAAM,CAAC,GAAG,EACV,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,EACjC,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,8BAA8B,EACnC,IAAI,CAAC,oBAAoB,CAC1B;SACF,CAAC;IACJ,CAAC;CACF;AArCD,wEAqCC","sourcesContent":["import type { MediatorHttp } from '@comunica/bus-http';\nimport type { MediatorRdfSerializeHandle, MediatorRdfSerializeMediaTypes } from '@comunica/bus-rdf-serialize';\nimport type {\n IActionRdfUpdateHypermedia,\n IActorRdfUpdateHypermediaOutput,\n IActorRdfUpdateHypermediaArgs,\n} from '@comunica/bus-rdf-update-hypermedia';\nimport { ActorRdfUpdateHypermedia } from '@comunica/bus-rdf-update-hypermedia';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport { QuadDestinationPutLdp } from './QuadDestinationPutLdp';\n\n/**\n * A comunica Post LDP RDF Update Hypermedia Actor.\n */\nexport class ActorRdfUpdateHypermediaPutLdp extends ActorRdfUpdateHypermedia {\n public readonly mediatorHttp: MediatorHttp;\n public readonly mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes;\n public readonly mediatorRdfSerialize: MediatorRdfSerializeHandle;\n\n public constructor(args: IActorRdfUpdateHypermediaPostLdpArgs) {\n super(args, 'putLdp');\n this.mediatorHttp = args.mediatorHttp;\n this.mediatorRdfSerializeMediatypes = args.mediatorRdfSerializeMediatypes;\n this.mediatorRdfSerialize = args.mediatorRdfSerialize;\n }\n\n public async testMetadata(action: IActionRdfUpdateHypermedia): Promise<TestResult<IActorTest>> {\n if (!action.forceDestinationType) {\n if (!action.metadata.allowHttpMethods || !action.metadata.allowHttpMethods.includes('PUT')) {\n return failTest(`Actor ${this.name} could not detect a destination with 'Allow: PUT' header.`);\n }\n if (action.exists) {\n return failTest(`Actor ${this.name} can only put on a destination that does not already exists.`);\n }\n }\n return passTestVoid();\n }\n\n public async run(action: IActionRdfUpdateHypermedia): Promise<IActorRdfUpdateHypermediaOutput> {\n this.logInfo(action.context, `Identified as putLdp destination: ${action.url}`);\n return {\n destination: new QuadDestinationPutLdp(\n action.url,\n action.context,\n action.metadata.putAccepted || [],\n this.mediatorHttp,\n this.mediatorRdfSerializeMediatypes,\n this.mediatorRdfSerialize,\n ),\n };\n }\n}\n\nexport interface IActorRdfUpdateHypermediaPostLdpArgs extends IActorRdfUpdateHypermediaArgs {\n /**\n * The HTTP mediator\n */\n mediatorHttp: MediatorHttp;\n /**\n * The RDF Serialize mediator for collecting media types\n */\n mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes;\n /**\n * The RDF Serialize mediator for handling serialization\n */\n mediatorRdfSerialize: MediatorRdfSerializeHandle;\n}\n"]}
File without changes
@@ -6,6 +6,12 @@ const bus_http_1 = require("@comunica/bus-http");
6
6
  * A quad destination that represents a resource that can be PUT.
7
7
  */
8
8
  class QuadDestinationPutLdp {
9
+ url;
10
+ context;
11
+ mediaTypes;
12
+ mediatorHttp;
13
+ mediatorRdfSerializeMediatypes;
14
+ mediatorRdfSerialize;
9
15
  constructor(url, context, mediaTypes, mediatorHttp, mediatorRdfSerializeMediatypes, mediatorRdfSerialize) {
10
16
  this.url = url;
11
17
  this.context = context;
@@ -1 +1 @@
1
- {"version":3,"file":"QuadDestinationPutLdp.js","sourceRoot":"","sources":["QuadDestinationPutLdp.ts"],"names":[],"mappings":";;;AACA,iDAA6E;AAO7E;;GAEG;AACH,MAAa,qBAAqB;IAWhC,YACE,GAAW,EACX,OAAuB,EACvB,UAAoB,EACpB,YAA0B,EAC1B,8BAA8D,EAC9D,oBAA0C;QAE1C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,8BAA8B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OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;YACpD,eAAe,EAAE,SAAS;SAC3B,CAAC,CAAC;QAEH,iCAAiC;QACjC,MAAM,OAAO,GAAY,IAAI,OAAO,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC;QACpE,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;YACnD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE;gBACJ,OAAO;gBACP,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,oBAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC;aAC1C;YACD,KAAK,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;QAEH,MAAM,IAAA,uCAA4B,EAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,YAAY,CACvB,OAA6D,EAC7D,iBAA0B,EAC1B,WAAoB;QAEpB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,OAAwB,EAAE,oBAA6B;QAC/E,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;CACF;AAnFD,sDAmFC","sourcesContent":["import type { MediatorHttp } from '@comunica/bus-http';\nimport { validateAndCloseHttpResponse, ActorHttp } from '@comunica/bus-http';\nimport type { MediatorRdfSerialize, MediatorRdfSerializeMediaTypes } from '@comunica/bus-rdf-serialize';\nimport type { IQuadDestination } from '@comunica/bus-rdf-update-quads';\nimport type { IActionContext } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\n\n/**\n * A quad destination that represents a resource that can be PUT.\n */\nexport class QuadDestinationPutLdp implements IQuadDestination {\n private readonly url: string;\n private readonly context: IActionContext;\n private readonly mediaTypes: string[];\n\n private readonly mediatorHttp: MediatorHttp;\n\n public readonly mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes;\n\n private readonly mediatorRdfSerialize: MediatorRdfSerialize;\n\n public constructor(\n url: string,\n context: IActionContext,\n mediaTypes: string[],\n mediatorHttp: MediatorHttp,\n mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes,\n mediatorRdfSerialize: MediatorRdfSerialize,\n ) {\n this.url = url;\n this.context = context;\n this.mediaTypes = mediaTypes;\n this.mediatorHttp = mediatorHttp;\n this.mediatorRdfSerializeMediatypes = mediatorRdfSerializeMediatypes;\n this.mediatorRdfSerialize = mediatorRdfSerialize;\n }\n\n public async update(\n quadStreams: { insert?: AsyncIterator<RDF.Quad>; delete?: AsyncIterator<RDF.Quad> },\n ): Promise<void> {\n if (quadStreams.delete) {\n throw new Error(`Put-based LDP destinations don't support deletions`);\n }\n if (quadStreams.insert) {\n await this.wrapRdfUpdateRequest('INSERT', quadStreams.insert);\n }\n }\n\n public async wrapRdfUpdateRequest(type: 'INSERT' | 'DELETE', quads: AsyncIterator<RDF.Quad>): Promise<void> {\n // Determine media type for serialization\n const { mediaTypes } = await this.mediatorRdfSerializeMediatypes.mediate(\n { context: this.context, mediaTypes: true },\n );\n const availableMediaTypes = this.mediaTypes\n .filter(mediaType => mediaType in mediaTypes);\n // Fallback to our own preferred media type\n const mediaType = availableMediaTypes.length > 0 ?\n availableMediaTypes[0] :\n Object.keys(mediaTypes).sort((typeA, typeB) => mediaTypes[typeB] - mediaTypes[typeA])[0];\n\n // Serialize quads\n const { handle: { data }} = await this.mediatorRdfSerialize.mediate({\n context: this.context,\n handle: { quadStream: quads, context: this.context },\n handleMediaType: mediaType,\n });\n\n // Send data in (LDP) PUT request\n const headers: Headers = new Headers({ 'content-type': mediaType });\n const httpResponse = await this.mediatorHttp.mediate({\n context: this.context,\n init: {\n headers,\n method: 'PUT',\n body: ActorHttp.toWebReadableStream(data),\n },\n input: this.url,\n });\n\n await validateAndCloseHttpResponse(this.url, httpResponse);\n }\n\n public async deleteGraphs(\n _graphs: RDF.DefaultGraph | 'NAMED' | 'ALL' | RDF.NamedNode[],\n _requireExistence: boolean,\n _dropGraphs: boolean,\n ): Promise<void> {\n throw new Error(`Put-based LDP destinations don't support named graphs`);\n }\n\n public async createGraphs(_graphs: RDF.NamedNode[], _requireNonExistence: boolean): Promise<void> {\n throw new Error(`Put-based LDP destinations don't support named graphs`);\n }\n}\n"]}
1
+ {"version":3,"file":"QuadDestinationPutLdp.js","sourceRoot":"","sources":["QuadDestinationPutLdp.ts"],"names":[],"mappings":";;;AACA,iDAA6E;AAO7E;;GAEG;AACH,MAAa,qBAAqB;IACf,GAAG,CAAS;IACZ,OAAO,CAAiB;IACxB,UAAU,CAAW;IAErB,YAAY,CAAe;IAE5B,8BAA8B,CAAiC;IAE9D,oBAAoB,CAAuB;IAE5D,YACE,GAAW,EACX,OAAuB,EACvB,UAAoB,EACpB,YAA0B,EAC1B,8BAA8D,EAC9D,oBAA0C;QAE1C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,8BAA8B,GAAG,8BAA8B,CAAC;QACrE,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,MAAM,CACjB,WAAmF;QAEnF,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;QACD,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YACvB,MAAM,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,IAAyB,EAAE,KAA8B;QACzF,yCAAyC;QACzC,MAAM,E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AC;QAEH,MAAM,IAAA,uCAA4B,EAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,YAAY,CACvB,OAA6D,EAC7D,iBAA0B,EAC1B,WAAoB;QAEpB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,OAAwB,EAAE,oBAA6B;QAC/E,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;CACF;AAnFD,sDAmFC","sourcesContent":["import type { MediatorHttp } from '@comunica/bus-http';\nimport { validateAndCloseHttpResponse, ActorHttp } from '@comunica/bus-http';\nimport type { MediatorRdfSerialize, MediatorRdfSerializeMediaTypes } from '@comunica/bus-rdf-serialize';\nimport type { IQuadDestination } from '@comunica/bus-rdf-update-quads';\nimport type { IActionContext } from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\n\n/**\n * A quad destination that represents a resource that can be PUT.\n */\nexport class QuadDestinationPutLdp implements IQuadDestination {\n private readonly url: string;\n private readonly context: IActionContext;\n private readonly mediaTypes: string[];\n\n private readonly mediatorHttp: MediatorHttp;\n\n public readonly mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes;\n\n private readonly mediatorRdfSerialize: MediatorRdfSerialize;\n\n public constructor(\n url: string,\n context: IActionContext,\n mediaTypes: string[],\n mediatorHttp: MediatorHttp,\n mediatorRdfSerializeMediatypes: MediatorRdfSerializeMediaTypes,\n mediatorRdfSerialize: MediatorRdfSerialize,\n ) {\n this.url = url;\n this.context = context;\n this.mediaTypes = mediaTypes;\n this.mediatorHttp = mediatorHttp;\n this.mediatorRdfSerializeMediatypes = mediatorRdfSerializeMediatypes;\n this.mediatorRdfSerialize = mediatorRdfSerialize;\n }\n\n public async update(\n quadStreams: { insert?: AsyncIterator<RDF.Quad>; delete?: AsyncIterator<RDF.Quad> },\n ): Promise<void> {\n if (quadStreams.delete) {\n throw new Error(`Put-based LDP destinations don't support deletions`);\n }\n if (quadStreams.insert) {\n await this.wrapRdfUpdateRequest('INSERT', quadStreams.insert);\n }\n }\n\n public async wrapRdfUpdateRequest(type: 'INSERT' | 'DELETE', quads: AsyncIterator<RDF.Quad>): Promise<void> {\n // Determine media type for serialization\n const { mediaTypes } = await this.mediatorRdfSerializeMediatypes.mediate(\n { context: this.context, mediaTypes: true },\n );\n const availableMediaTypes = this.mediaTypes\n .filter(mediaType => mediaType in mediaTypes);\n // Fallback to our own preferred media type\n const mediaType = availableMediaTypes.length > 0 ?\n availableMediaTypes[0] :\n Object.keys(mediaTypes).sort((typeA, typeB) => mediaTypes[typeB] - mediaTypes[typeA])[0];\n\n // Serialize quads\n const { handle: { data }} = await this.mediatorRdfSerialize.mediate({\n context: this.context,\n handle: { quadStream: quads, context: this.context },\n handleMediaType: mediaType,\n });\n\n // Send data in (LDP) PUT request\n const headers: Headers = new Headers({ 'content-type': mediaType });\n const httpResponse = await this.mediatorHttp.mediate({\n context: this.context,\n init: {\n headers,\n method: 'PUT',\n body: ActorHttp.toWebReadableStream(data),\n },\n input: this.url,\n });\n\n await validateAndCloseHttpResponse(this.url, httpResponse);\n }\n\n public async deleteGraphs(\n _graphs: RDF.DefaultGraph | 'NAMED' | 'ALL' | RDF.NamedNode[],\n _requireExistence: boolean,\n _dropGraphs: boolean,\n ): Promise<void> {\n throw new Error(`Put-based LDP destinations don't support named graphs`);\n }\n\n public async createGraphs(_graphs: RDF.NamedNode[], _requireNonExistence: boolean): Promise<void> {\n throw new Error(`Put-based LDP destinations don't support named graphs`);\n }\n}\n"]}
package/lib/index.d.ts CHANGED
File without changes
package/lib/index.js CHANGED
File without changes
package/lib/index.js.map CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/actor-rdf-update-hypermedia-put-ldp",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "A put-ldp rdf-update-hypermedia actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -41,14 +41,14 @@
41
41
  "build:components": "componentsjs-generator"
42
42
  },
43
43
  "dependencies": {
44
- "@comunica/bus-http": "^4.5.0",
45
- "@comunica/bus-rdf-serialize": "^4.5.0",
46
- "@comunica/bus-rdf-update-hypermedia": "^4.5.0",
47
- "@comunica/bus-rdf-update-quads": "^4.5.0",
48
- "@comunica/core": "^4.5.0",
49
- "@comunica/types": "^4.5.0",
44
+ "@comunica/bus-http": "^5.0.0",
45
+ "@comunica/bus-rdf-serialize": "^5.0.0",
46
+ "@comunica/bus-rdf-update-hypermedia": "^5.0.0",
47
+ "@comunica/bus-rdf-update-quads": "^5.0.0",
48
+ "@comunica/core": "^5.0.0",
49
+ "@comunica/types": "^5.0.0",
50
50
  "@rdfjs/types": "*",
51
- "asynciterator": "^3.9.0"
51
+ "asynciterator": "^3.10.0"
52
52
  },
53
- "gitHead": "2bcd98c387a021fc5c08d375793c205ca3d1bf0d"
53
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
54
54
  }