ldkit 0.0.4 → 0.0.5

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/esm/_dnt.shims.js CHANGED
@@ -1,16 +1,4 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- import { fetch, File, FormData, Headers, Request, Response } from "undici";
4
- export { fetch, File, FormData, Headers, Request, Response } from "undici";
5
- const dntGlobals = {
6
- Deno,
7
- fetch,
8
- File,
9
- FormData,
10
- Headers,
11
- Request,
12
- Response,
13
- };
1
+ const dntGlobals = {};
14
2
  export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
15
3
  // deno-lint-ignore ban-types
16
4
  function createMergeProxy(baseObj, extObj) {
@@ -899,7 +899,7 @@ var __webpack_modules__ = ({
899
899
  // Prepare headers
900
900
  const initHeaders = action.init ? action.init.headers || {} : {};
901
901
  action.init = action.init ? action.init : {};
902
- action.init.headers = new dntShim.Headers(initHeaders);
902
+ action.init.headers = new Headers(initHeaders);
903
903
  if (!action.init.headers.has('user-agent')) {
904
904
  action.init.headers.append('user-agent', this.userAgent);
905
905
  }
@@ -911,7 +911,7 @@ var __webpack_modules__ = ({
911
911
  this.logInfo(action.context, `Requesting ${typeof action.input === 'string' ?
912
912
  action.input :
913
913
  action.input.url}`, () => ({
914
- headers: bus_http_1.ActorHttp.headersToHash(new dntShim.Headers(action.init.headers)),
914
+ headers: bus_http_1.ActorHttp.headersToHash(new Headers(action.init.headers)),
915
915
  method: action.init.method || 'GET',
916
916
  }));
917
917
  // TODO: remove this workaround once this has a fix: https://github.com/inrupt/solid-client-authn-js/issues/1708
@@ -936,7 +936,7 @@ var __webpack_modules__ = ({
936
936
  // Perform request
937
937
  const customFetch = action
938
938
  .context?.get(context_entries_1.KeysHttp.fetch);
939
- const response = await (customFetch || dntShim.fetch)(action.input, requestInit);
939
+ const response = await (customFetch || fetch)(action.input, requestInit);
940
940
  // We remove or update the timeout
941
941
  if (requestTimeout !== undefined) {
942
942
  const httpBodyTimeout = action.context?.get(context_entries_1.KeysHttp.httpBodyTimeout) || false;
@@ -987,7 +987,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
987
987
  async handle(init) {
988
988
  // Remove overridden user-agent header within browsers to avoid CORS issues
989
989
  if (init.headers) {
990
- const headers = new dntShim.Headers(init.headers);
990
+ const headers = new Headers(init.headers);
991
991
  if (headers.has('user-agent')) {
992
992
  headers.delete('user-agent');
993
993
  }
@@ -1113,7 +1113,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
1113
1113
  if (typeof input === 'string') {
1114
1114
  return this.prefixUrl + input;
1115
1115
  }
1116
- return new dntShim.Request(this.prefixUrl + input.url, input);
1116
+ return new Request(this.prefixUrl + input.url, input);
1117
1117
  }
1118
1118
  }
1119
1119
  exports.ProxyHandlerStatic = ProxyHandlerStatic;
@@ -23149,7 +23149,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23149
23149
  else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
23150
23150
  this._bodyBlob = body;
23151
23151
  }
23152
- else if (support.formData && dntShim.FormData.prototype.isPrototypeOf(body)) {
23152
+ else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
23153
23153
  this._bodyFormData = body;
23154
23154
  }
23155
23155
  else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
@@ -23280,7 +23280,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23280
23280
  return new Request(this, { body: this._bodyInit });
23281
23281
  };
23282
23282
  function decode(body) {
23283
- var form = new dntShim.FormData();
23283
+ var form = new FormData();
23284
23284
  body
23285
23285
  .trim()
23286
23286
  .split('&')
@@ -23635,7 +23635,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23635
23635
  else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
23636
23636
  this._bodyBlob = body;
23637
23637
  }
23638
- else if (support.formData && dntShim.FormData.prototype.isPrototypeOf(body)) {
23638
+ else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
23639
23639
  this._bodyFormData = body;
23640
23640
  }
23641
23641
  else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
@@ -23766,7 +23766,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23766
23766
  return new Request(this, { body: this._bodyInit });
23767
23767
  };
23768
23768
  function decode(body) {
23769
- var form = new dntShim.FormData();
23769
+ var form = new FormData();
23770
23770
  body
23771
23771
  .trim()
23772
23772
  .split('&')
@@ -27339,7 +27339,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
27339
27339
  async fetchRawStream(endpoint, query, acceptHeader) {
27340
27340
  let url = this.method === 'POST' ? endpoint : endpoint + '?query=' + encodeURIComponent(query);
27341
27341
  // Initiate request
27342
- const headers = new dntShim.Headers();
27342
+ const headers = new Headers();
27343
27343
  let body;
27344
27344
  headers.append('Accept', acceptHeader);
27345
27345
  if (this.method === 'POST') {
@@ -27365,7 +27365,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
27365
27365
  * @return {Promise<[string, NodeJS.ReadableStream]>} The content type and SPARQL endpoint response stream.
27366
27366
  */
27367
27367
  async handleFetchCall(url, init, options = {}) {
27368
- const httpResponse = await (this.fetchCb || dntShim.fetch)(url, init);
27368
+ const httpResponse = await (this.fetchCb || fetch)(url, init);
27369
27369
  let responseStream;
27370
27370
  // Handle response body
27371
27371
  if (!options.ignoreBody) {
@@ -41305,7 +41305,7 @@ must be one of ${Util_1.Util.CONTAINERS.join(', ')}`, ErrorCoded_1.ERROR_CODES.I
41305
41305
  this.fetcher = fetcher;
41306
41306
  }
41307
41307
  async load(url) {
41308
- const response = await (this.fetcher || dntShim.fetch)(url, { headers: new dntShim.Headers({ accept: 'application/ld+json' }) });
41308
+ const response = await (this.fetcher || fetch)(url, { headers: new Headers({ accept: 'application/ld+json' }) });
41309
41309
  if (response.ok && response.headers) {
41310
41310
  let mediaType = response.headers.get('Content-Type');
41311
41311
  if (mediaType) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/mod.js",
4
4
  "types": "./types/mod.d.ts",
5
5
  "name": "ldkit",
6
- "version": "0.0.4",
6
+ "version": "0.0.5",
7
7
  "description": "LDKit",
8
8
  "license": "MIT",
9
9
  "repository": {
@@ -42,11 +42,6 @@
42
42
  "rdf-data-factory": "1.1.1",
43
43
  "rdf-js": "4.0.2",
44
44
  "rdf-literal": "1.3.0",
45
- "rxjs": "7.5.6",
46
- "@deno/shim-deno": "~0.9.0",
47
- "undici": "^5.8.0"
48
- },
49
- "devDependencies": {
50
- "@types/node": "16.11.37"
45
+ "rxjs": "7.5.6"
51
46
  }
52
47
  }
@@ -1,26 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dntGlobalThis = exports.Response = exports.Request = exports.Headers = exports.FormData = exports.File = exports.fetch = exports.Deno = void 0;
4
- const shim_deno_1 = require("@deno/shim-deno");
5
- var shim_deno_2 = require("@deno/shim-deno");
6
- Object.defineProperty(exports, "Deno", { enumerable: true, get: function () { return shim_deno_2.Deno; } });
7
- const undici_1 = require("undici");
8
- var undici_2 = require("undici");
9
- Object.defineProperty(exports, "fetch", { enumerable: true, get: function () { return undici_2.fetch; } });
10
- Object.defineProperty(exports, "File", { enumerable: true, get: function () { return undici_2.File; } });
11
- Object.defineProperty(exports, "FormData", { enumerable: true, get: function () { return undici_2.FormData; } });
12
- Object.defineProperty(exports, "Headers", { enumerable: true, get: function () { return undici_2.Headers; } });
13
- Object.defineProperty(exports, "Request", { enumerable: true, get: function () { return undici_2.Request; } });
14
- Object.defineProperty(exports, "Response", { enumerable: true, get: function () { return undici_2.Response; } });
15
- const dntGlobals = {
16
- Deno: shim_deno_1.Deno,
17
- fetch: undici_1.fetch,
18
- File: undici_1.File,
19
- FormData: undici_1.FormData,
20
- Headers: undici_1.Headers,
21
- Request: undici_1.Request,
22
- Response: undici_1.Response,
23
- };
3
+ exports.dntGlobalThis = void 0;
4
+ const dntGlobals = {};
24
5
  exports.dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
25
6
  // deno-lint-ignore ban-types
26
7
  function createMergeProxy(baseObj, extObj) {
@@ -925,7 +925,7 @@ var __webpack_modules__ = ({
925
925
  // Prepare headers
926
926
  const initHeaders = action.init ? action.init.headers || {} : {};
927
927
  action.init = action.init ? action.init : {};
928
- action.init.headers = new dntShim.Headers(initHeaders);
928
+ action.init.headers = new Headers(initHeaders);
929
929
  if (!action.init.headers.has('user-agent')) {
930
930
  action.init.headers.append('user-agent', this.userAgent);
931
931
  }
@@ -937,7 +937,7 @@ var __webpack_modules__ = ({
937
937
  this.logInfo(action.context, `Requesting ${typeof action.input === 'string' ?
938
938
  action.input :
939
939
  action.input.url}`, () => ({
940
- headers: bus_http_1.ActorHttp.headersToHash(new dntShim.Headers(action.init.headers)),
940
+ headers: bus_http_1.ActorHttp.headersToHash(new Headers(action.init.headers)),
941
941
  method: action.init.method || 'GET',
942
942
  }));
943
943
  // TODO: remove this workaround once this has a fix: https://github.com/inrupt/solid-client-authn-js/issues/1708
@@ -962,7 +962,7 @@ var __webpack_modules__ = ({
962
962
  // Perform request
963
963
  const customFetch = action
964
964
  .context?.get(context_entries_1.KeysHttp.fetch);
965
- const response = await (customFetch || dntShim.fetch)(action.input, requestInit);
965
+ const response = await (customFetch || fetch)(action.input, requestInit);
966
966
  // We remove or update the timeout
967
967
  if (requestTimeout !== undefined) {
968
968
  const httpBodyTimeout = action.context?.get(context_entries_1.KeysHttp.httpBodyTimeout) || false;
@@ -1013,7 +1013,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
1013
1013
  async handle(init) {
1014
1014
  // Remove overridden user-agent header within browsers to avoid CORS issues
1015
1015
  if (init.headers) {
1016
- const headers = new dntShim.Headers(init.headers);
1016
+ const headers = new Headers(init.headers);
1017
1017
  if (headers.has('user-agent')) {
1018
1018
  headers.delete('user-agent');
1019
1019
  }
@@ -1139,7 +1139,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
1139
1139
  if (typeof input === 'string') {
1140
1140
  return this.prefixUrl + input;
1141
1141
  }
1142
- return new dntShim.Request(this.prefixUrl + input.url, input);
1142
+ return new Request(this.prefixUrl + input.url, input);
1143
1143
  }
1144
1144
  }
1145
1145
  exports.ProxyHandlerStatic = ProxyHandlerStatic;
@@ -23175,7 +23175,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23175
23175
  else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
23176
23176
  this._bodyBlob = body;
23177
23177
  }
23178
- else if (support.formData && dntShim.FormData.prototype.isPrototypeOf(body)) {
23178
+ else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
23179
23179
  this._bodyFormData = body;
23180
23180
  }
23181
23181
  else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
@@ -23306,7 +23306,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23306
23306
  return new Request(this, { body: this._bodyInit });
23307
23307
  };
23308
23308
  function decode(body) {
23309
- var form = new dntShim.FormData();
23309
+ var form = new FormData();
23310
23310
  body
23311
23311
  .trim()
23312
23312
  .split('&')
@@ -23661,7 +23661,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23661
23661
  else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
23662
23662
  this._bodyBlob = body;
23663
23663
  }
23664
- else if (support.formData && dntShim.FormData.prototype.isPrototypeOf(body)) {
23664
+ else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
23665
23665
  this._bodyFormData = body;
23666
23666
  }
23667
23667
  else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
@@ -23792,7 +23792,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
23792
23792
  return new Request(this, { body: this._bodyInit });
23793
23793
  };
23794
23794
  function decode(body) {
23795
- var form = new dntShim.FormData();
23795
+ var form = new FormData();
23796
23796
  body
23797
23797
  .trim()
23798
23798
  .split('&')
@@ -27365,7 +27365,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
27365
27365
  async fetchRawStream(endpoint, query, acceptHeader) {
27366
27366
  let url = this.method === 'POST' ? endpoint : endpoint + '?query=' + encodeURIComponent(query);
27367
27367
  // Initiate request
27368
- const headers = new dntShim.Headers();
27368
+ const headers = new Headers();
27369
27369
  let body;
27370
27370
  headers.append('Accept', acceptHeader);
27371
27371
  if (this.method === 'POST') {
@@ -27391,7 +27391,7 @@ This error can be disabled by modifying the 'httpBodyTimeout' and/or 'httpTimeou
27391
27391
  * @return {Promise<[string, NodeJS.ReadableStream]>} The content type and SPARQL endpoint response stream.
27392
27392
  */
27393
27393
  async handleFetchCall(url, init, options = {}) {
27394
- const httpResponse = await (this.fetchCb || dntShim.fetch)(url, init);
27394
+ const httpResponse = await (this.fetchCb || fetch)(url, init);
27395
27395
  let responseStream;
27396
27396
  // Handle response body
27397
27397
  if (!options.ignoreBody) {
@@ -41331,7 +41331,7 @@ must be one of ${Util_1.Util.CONTAINERS.join(', ')}`, ErrorCoded_1.ERROR_CODES.I
41331
41331
  this.fetcher = fetcher;
41332
41332
  }
41333
41333
  async load(url) {
41334
- const response = await (this.fetcher || dntShim.fetch)(url, { headers: new dntShim.Headers({ accept: 'application/ld+json' }) });
41334
+ const response = await (this.fetcher || fetch)(url, { headers: new Headers({ accept: 'application/ld+json' }) });
41335
41335
  if (response.ok && response.headers) {
41336
41336
  let mediaType = response.headers.get('Content-Type');
41337
41337
  if (mediaType) {
@@ -1,13 +1 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- import { fetch, File, FormData, Headers, Request, Response } from "undici";
4
- export { fetch, File, FormData, Headers, Request, Response, type BodyInit, type HeadersInit, type RequestInit, type ResponseInit } from "undici";
5
- export declare const dntGlobalThis: Omit<typeof globalThis, "Deno" | "fetch" | "File" | "FormData" | "Headers" | "Request" | "Response"> & {
6
- Deno: typeof Deno;
7
- fetch: typeof fetch;
8
- File: typeof File;
9
- FormData: typeof FormData;
10
- Headers: typeof Headers;
11
- Request: typeof Request;
12
- Response: typeof Response;
13
- };
1
+ export declare const dntGlobalThis: Omit<typeof globalThis, never>;