@ctx-core/graphql-client 7.0.86 → 7.0.91

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/.swcrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "jsc": {
3
+ "target": "es2019",
4
+ "parser": {
5
+ "syntax": "typescript",
6
+ "tsx": true,
7
+ "dynamicImport": true
8
+ }
9
+ }
10
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # @ctx-core/graphql-client
2
2
 
3
+ ## 7.0.91
4
+
5
+ ### Patch Changes
6
+
7
+ - update dependencies
8
+
9
+ ## 7.0.90
10
+
11
+ ### Patch Changes
12
+
13
+ - typescript: ^4.4.4 -> ^4.5.2
14
+ - @types/node: ^16.11.7 -> ^16.11.8
15
+ - @swc/core: ^1.2.108 -> ^1.2.110
16
+ - Updated dependencies
17
+ - Updated dependencies
18
+ - @ctx-core/dom@11.0.32
19
+ - @ctx-core/fetch@11.0.83
20
+ - @ctx-core/object@21.0.24
21
+
22
+ ## 7.0.89
23
+
24
+ ### Patch Changes
25
+
26
+ - @swc/core: ^1.2.107 -> ^1.2.108
27
+ - Updated dependencies
28
+ - @ctx-core/dom@11.0.31
29
+ - @ctx-core/fetch@11.0.81
30
+ - @ctx-core/object@21.0.23
31
+
32
+ ## 7.0.88
33
+
34
+ ### Patch Changes
35
+
36
+ - compile using swc
37
+ - Updated dependencies
38
+ - @ctx-core/dom@11.0.30
39
+ - @ctx-core/fetch@11.0.80
40
+ - @ctx-core/object@21.0.22
41
+
42
+ ## 7.0.87
43
+
44
+ ### Patch Changes
45
+
46
+ - update dependencies
47
+ - Updated dependencies [undefined]
48
+ - @ctx-core/fetch@11.0.79
49
+
3
50
  ## 7.0.86
4
51
 
5
52
  ### Patch Changes
@@ -1,2 +1,3 @@
1
- export {};
1
+ export { };
2
+
2
3
  //# sourceMappingURL=FetchHttpHeaders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FetchHttpHeaders.js","sourceRoot":"","sources":["../src/FetchHttpHeaders.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../src/FetchHttpHeaders.ts"],"sourcesContent":["export interface FetchHttpHeaders extends Record<string, string> {\n\t'Content-Type':string\n}\n"],"names":[],"mappings":"AAAA,MAAM"}
@@ -1,2 +1,3 @@
1
- export {};
1
+ export { };
2
+
2
3
  //# sourceMappingURL=FetchHttpOpts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FetchHttpOpts.js","sourceRoot":"","sources":["../src/FetchHttpOpts.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../src/FetchHttpOpts.ts"],"sourcesContent":["import type { FetchHttpHeaders } from './FetchHttpHeaders.js'\nexport interface FetchHttpOpts {\n\turl?:string\n\theaders?:FetchHttpHeaders,\n}\n"],"names":[],"mappings":"AAAA,MAAM"}
@@ -1,13 +1,15 @@
1
1
  import { graphql_fetch_ } from './graphql_fetch_.js';
2
2
  import { graphql_url_ } from './graphql_url_.js';
3
3
  let in_graphql_fetch;
4
- export function graphql_fetch(body, fn_in_http_opts = {}) {
4
+ export function graphql_fetch(body, fn_in_http_opts = {
5
+ }) {
5
6
  if (!in_graphql_fetch) {
6
7
  in_graphql_fetch = graphql_fetch_({
7
- url: graphql_url_(),
8
+ url: graphql_url_()
8
9
  });
9
10
  }
10
11
  return in_graphql_fetch(body, fn_in_http_opts);
11
12
  }
12
- export { graphql_fetch as fetch_graphql, graphql_fetch as fetch__graphql, };
13
+ export { graphql_fetch as fetch_graphql, graphql_fetch as fetch__graphql, };
14
+
13
15
  //# sourceMappingURL=graphql_fetch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql_fetch.js","sourceRoot":"","sources":["../src/graphql_fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,IAAI,gBAAiC,CAAA;AACrC,MAAM,UAAU,aAAa,CAC5B,IAAW,EACX,kBAAgC,EAAE;IAElC,IAAI,CAAC,gBAAgB,EAAE;QACtB,gBAAgB,GAAG,cAAc,CAAS;YACzC,GAAG,EAAE,YAAY,EAAE;SACnB,CAAC,CAAA;KACF;IACD,OAAO,gBAAgB,CAAC,IAAI,EAAE,eAAe,CAA8C,CAAA;AAC5F,CAAC;AAID,OAAO,EACN,aAAa,IAAI,aAAa,EAC9B,aAAa,IAAI,cAAc,GAC/B,CAAA"}
1
+ {"version":3,"sources":["../src/graphql_fetch.ts"],"sourcesContent":["import { graphql_fetch_, graphql_fetch_T } from './graphql_fetch_.js'\nimport { graphql_url_ } from './graphql_url_.js'\nimport type { FetchHttpOpts } from './FetchHttpOpts.js'\nlet in_graphql_fetch: graphql_fetch_T\nexport function graphql_fetch<data_T extends unknown = unknown>(\n\tbody:string,\n\tfn_in_http_opts:FetchHttpOpts = {},\n):Promise<graphql_fetch_response_T<data_T>> {\n\tif (!in_graphql_fetch) {\n\t\tin_graphql_fetch = graphql_fetch_<data_T>({\n\t\t\turl: graphql_url_(),\n\t\t})\n\t}\n\treturn in_graphql_fetch(body, fn_in_http_opts) as Promise<graphql_fetch_response_T<data_T>>\n}\nexport interface graphql_fetch_response_T<data_T extends unknown = unknown> {\n\tdata: data_T\n}\nexport {\n\tgraphql_fetch as fetch_graphql,\n\tgraphql_fetch as fetch__graphql,\n}\n"],"names":["graphql_fetch_","graphql_url_","in_graphql_fetch","graphql_fetch","body","fn_in_http_opts","url","fetch_graphql","fetch__graphql"],"mappings":"AAAA,MAAM,GAAGA,cAAc,QAAyB,CAAqB;AACrE,MAAM,GAAGC,YAAY,QAAQ,CAAmB;AAEhD,GAAG,CAACC,gBAAgB;AACpB,MAAM,UAAUC,aAAa,CAC5BC,IAAW,EACXC,eAA6B,GAAG,CAAC;AAAA,CAAC,EACS,CAAC;IAC5C,EAAE,GAAGH,gBAAgB,EAAE,CAAC;QACvBA,gBAAgB,GAAGF,cAAc,CAAS,CAAC;YAC1CM,GAAG,EAAEL,YAAY;QAClB,CAAC;IACF,CAAC;IACD,MAAM,CAACC,gBAAgB,CAACE,IAAI,EAAEC,eAAe;AAC9C,CAAC;AAID,MAAM,GACLF,aAAa,IAAII,aAAa,EAC9BJ,aAAa,IAAIK,cAAc"}
@@ -1,7 +1,9 @@
1
1
  import { fetch } from '@ctx-core/fetch';
2
2
  import { assign } from '@ctx-core/object';
3
- export function graphql_fetch_(in_http_opts = {}) {
4
- return async function graphql_fetch(body, fn_in_http_opts = {}) {
3
+ export function graphql_fetch_(in_http_opts = {
4
+ }) {
5
+ return async function graphql_fetch(body, fn_in_http_opts = {
6
+ }) {
5
7
  const url = fn_in_http_opts.url || in_http_opts.url;
6
8
  if (!url) {
7
9
  throw `no url prop`;
@@ -9,24 +11,23 @@ export function graphql_fetch_(in_http_opts = {}) {
9
11
  const response = await fetch(url, assign({
10
12
  method: 'POST',
11
13
  headers: assign({
12
- 'Content-Type': 'application/json',
14
+ 'Content-Type': 'application/json'
13
15
  }, in_http_opts.headers, fn_in_http_opts.headers),
14
- body,
16
+ body
15
17
  }, in_http_opts, fn_in_http_opts));
16
18
  if (!response.ok) {
17
19
  if (process.env.NODE_ENV === 'production') {
18
20
  console.error(await response.text());
19
21
  throw `Error fetching graphql`;
20
- }
21
- else {
22
- throw (await response.text());
22
+ } else {
23
+ throw await response.text();
23
24
  }
24
25
  }
25
26
  const payload = await response.json();
26
- if (payload.errors)
27
- throw payload;
27
+ if (payload.errors) throw payload;
28
28
  return payload;
29
29
  };
30
30
  }
31
- export { graphql_fetch_ as _graphql_fetch, graphql_fetch_ as _fetch__graphql, };
31
+ export { graphql_fetch_ as _graphql_fetch, graphql_fetch_ as _fetch__graphql, };
32
+
32
33
  //# sourceMappingURL=graphql_fetch_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql_fetch_.js","sourceRoot":"","sources":["../src/graphql_fetch_.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,UAAU,cAAc,CAC7B,eAAe,EAAmB;IAElC,OAAO,KAAK,UAAU,aAAa,CAClC,IAAW,EACX,kBAAgC,EAAE;QAElC,MAAM,GAAG,GAAG,eAAe,CAAC,GAAG,IAAI,YAAY,CAAC,GAAG,CAAA;QACnD,IAAI,CAAC,GAAG,EAAE;YACT,MAAM,aAAa,CAAA;SACnB;QACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC;YACxC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,MAAM,CAAC;gBACf,cAAc,EAAE,kBAAkB;aAClC,EAAE,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC;YACjD,IAAI;SACJ,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAA;QAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YACjB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;gBAC1C,OAAO,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;gBACpC,MAAM,wBAAwB,CAAA;aAC9B;iBAAM;gBACN,MAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;aAC7B;SACD;QACD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QACrC,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,OAAO,CAAA;QACjC,OAAO,OAAa,CAAA;IACrB,CAAC,CAAA;AACF,CAAC;AAGD,OAAO,EACN,cAAc,IAAI,cAAc,EAChC,cAAc,IAAI,eAAe,GACjC,CAAA"}
1
+ {"version":3,"sources":["../src/graphql_fetch_.ts"],"sourcesContent":["import { fetch } from '@ctx-core/fetch'\nimport { assign } from '@ctx-core/object'\nimport type { FetchHttpOpts } from './FetchHttpOpts.js'\nexport function graphql_fetch_<O1 extends unknown = unknown>(\n\tin_http_opts = {} as FetchHttpOpts\n):graphql_fetch_T<O1> {\n\treturn async function graphql_fetch<O2 extends unknown = O1>(\n\t\tbody:string,\n\t\tfn_in_http_opts:FetchHttpOpts = {},\n\t):Promise<O2> {\n\t\tconst url = fn_in_http_opts.url || in_http_opts.url\n\t\tif (!url) {\n\t\t\tthrow `no url prop`\n\t\t}\n\t\tconst response = await fetch(url, assign({\n\t\t\tmethod: 'POST',\n\t\t\theaders: assign({\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t}, in_http_opts.headers, fn_in_http_opts.headers),\n\t\t\tbody,\n\t\t}, in_http_opts, fn_in_http_opts))\n\t\tif (!response.ok) {\n\t\t\tif (process.env.NODE_ENV === 'production') {\n\t\t\t\tconsole.error(await response.text())\n\t\t\t\tthrow `Error fetching graphql`\n\t\t\t} else {\n\t\t\t\tthrow (await response.text())\n\t\t\t}\n\t\t}\n\t\tconst payload = await response.json()\n\t\tif (payload.errors) throw payload\n\t\treturn payload as O2\n\t}\n}\nexport type graphql_fetch_T<O extends unknown = unknown> =\n\t(body:string, fn_in_http_opts:FetchHttpOpts)=>Promise<O>\nexport {\n\tgraphql_fetch_ as _graphql_fetch,\n\tgraphql_fetch_ as _fetch__graphql,\n}\n"],"names":["fetch","assign","graphql_fetch_","in_http_opts","graphql_fetch","body","fn_in_http_opts","url","response","method","headers","ok","process","env","NODE_ENV","console","error","text","payload","json","errors","_graphql_fetch","_fetch__graphql"],"mappings":"AAAA,MAAM,GAAGA,KAAK,QAAQ,CAAiB;AACvC,MAAM,GAAGC,MAAM,QAAQ,CAAkB;AAEzC,MAAM,UAAUC,cAAc,CAC7BC,YAAY,GAAG,CAAC;AAAA,CAAC,EACI,CAAC;IACtB,MAAM,gBAAgBC,aAAa,CAClCC,IAAW,EACXC,eAA6B,GAAG,CAAC;IAAA,CAAC,EACrB,CAAC;QACd,KAAK,CAACC,GAAG,GAAGD,eAAe,CAACC,GAAG,IAAIJ,YAAY,CAACI,GAAG;QACnD,EAAE,GAAGA,GAAG,EAAE,CAAC;YACV,KAAK,EAAE,WAAW;QACnB,CAAC;QACD,KAAK,CAACC,QAAQ,GAAG,KAAK,CAACR,KAAK,CAACO,GAAG,EAAEN,MAAM,CAAC,CAAC;YACzCQ,MAAM,EAAE,CAAM;YACdC,OAAO,EAAET,MAAM,CAAC,CAAC;gBAChB,CAAc,eAAE,CAAkB;YACnC,CAAC,EAAEE,YAAY,CAACO,OAAO,EAAEJ,eAAe,CAACI,OAAO;YAChDL,IAAI;QACL,CAAC,EAAEF,YAAY,EAAEG,eAAe;QAChC,EAAE,GAAGE,QAAQ,CAACG,EAAE,EAAE,CAAC;YAClB,EAAE,EAAEC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,CAAY,aAAE,CAAC;gBAC3CC,OAAO,CAACC,KAAK,CAAC,KAAK,CAACR,QAAQ,CAACS,IAAI;gBACjC,KAAK,EAAE,sBAAsB;YAC9B,CAAC,MAAM,CAAC;gBACP,KAAK,CAAE,KAAK,CAACT,QAAQ,CAACS,IAAI;YAC3B,CAAC;QACF,CAAC;QACD,KAAK,CAACC,OAAO,GAAG,KAAK,CAACV,QAAQ,CAACW,IAAI;QACnC,EAAE,EAAED,OAAO,CAACE,MAAM,EAAE,KAAK,CAACF,OAAO;QACjC,MAAM,CAACA,OAAO;IACf,CAAC;AACF,CAAC;AAGD,MAAM,GACLhB,cAAc,IAAImB,cAAc,EAChCnB,cAAc,IAAIoB,eAAe"}
@@ -1,5 +1,6 @@
1
1
  export function graphql_port_txt_(port = process.env.PORT) {
2
2
  return (port || 80) === 80 ? '' : `:${port}`;
3
3
  }
4
- export { graphql_port_txt_ as _graphql_port_txt, graphql_port_txt_ as _txt__port__graphql, };
4
+ export { graphql_port_txt_ as _graphql_port_txt, graphql_port_txt_ as _txt__port__graphql, };
5
+
5
6
  //# sourceMappingURL=graphql_port_txt_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql_port_txt_.js","sourceRoot":"","sources":["../src/graphql_port_txt_.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI;IACxD,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAA;AAC7C,CAAC;AACD,OAAO,EACN,iBAAiB,IAAI,iBAAiB,EACtC,iBAAiB,IAAI,mBAAmB,GACxC,CAAA"}
1
+ {"version":3,"sources":["../src/graphql_port_txt_.ts"],"sourcesContent":["export function graphql_port_txt_(port = process.env.PORT) {\n\treturn (port || 80) === 80 ? '' : `:${port}`\n}\nexport {\n\tgraphql_port_txt_ as _graphql_port_txt,\n\tgraphql_port_txt_ as _txt__port__graphql,\n}\n"],"names":["graphql_port_txt_","port","process","env","PORT","_graphql_port_txt","_txt__port__graphql"],"mappings":"AAAA,MAAM,UAAUA,iBAAiB,CAACC,IAAI,GAAGC,OAAO,CAACC,GAAG,CAACC,IAAI,EAAE,CAAC;IAC3D,MAAM,EAAEH,IAAI,IAAI,EAAE,MAAM,EAAE,GAAG,CAAE,KAAI,CAAC,EAAEA,IAAI;AAC3C,CAAC;AACD,MAAM,GACLD,iBAAiB,IAAIK,iBAAiB,EACtCL,iBAAiB,IAAIM,mBAAmB"}
@@ -1,10 +1,10 @@
1
1
  import { has_dom } from '@ctx-core/dom';
2
2
  import { graphql_port_txt_ } from './graphql_port_txt_.js';
3
3
  export function graphql_url_(host = '127.0.0.1') {
4
- if (has_dom)
5
- return '/graphql';
4
+ if (has_dom) return '/graphql';
6
5
  const host_port = `${host}${graphql_port_txt_()}`;
7
6
  return `http://${host_port}/graphql`;
8
7
  }
9
- export { graphql_url_ as _graphql_url, graphql_url_ as _url__graphql, };
8
+ export { graphql_url_ as _graphql_url, graphql_url_ as _url__graphql, };
9
+
10
10
  //# sourceMappingURL=graphql_url_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql_url_.js","sourceRoot":"","sources":["../src/graphql_url_.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,MAAM,UAAU,YAAY,CAAC,IAAI,GAAG,WAAW;IAC9C,IAAI,OAAO;QAAE,OAAO,UAAU,CAAA;IAC9B,MAAM,SAAS,GAAG,GAAG,IAAI,GAAG,iBAAiB,EAAE,EAAE,CAAA;IACjD,OAAO,UAAU,SAAS,UAAU,CAAA;AACrC,CAAC;AACD,OAAO,EACN,YAAY,IAAI,YAAY,EAC5B,YAAY,IAAI,aAAa,GAC7B,CAAA"}
1
+ {"version":3,"sources":["../src/graphql_url_.ts"],"sourcesContent":["import { has_dom } from '@ctx-core/dom'\nimport { graphql_port_txt_ } from './graphql_port_txt_.js'\nexport function graphql_url_(host = '127.0.0.1'):string {\n\tif (has_dom) return '/graphql'\n\tconst host_port = `${host}${graphql_port_txt_()}`\n\treturn `http://${host_port}/graphql`\n}\nexport {\n\tgraphql_url_ as _graphql_url,\n\tgraphql_url_ as _url__graphql,\n}\n"],"names":["has_dom","graphql_port_txt_","graphql_url_","host","host_port","_graphql_url","_url__graphql"],"mappings":"AAAA,MAAM,GAAGA,OAAO,QAAQ,CAAe;AACvC,MAAM,GAAGC,iBAAiB,QAAQ,CAAwB;AAC1D,MAAM,UAAUC,YAAY,CAACC,IAAI,GAAG,CAAW,YAAS,CAAC;IACxD,EAAE,EAAEH,OAAO,EAAE,MAAM,CAAC,CAAU;IAC9B,KAAK,CAACI,SAAS,MAAMD,IAAI,GAAGF,iBAAiB;IAC7C,MAAM,EAAE,OAAO,EAAEG,SAAS,CAAC,QAAQ;AACpC,CAAC;AACD,MAAM,GACLF,YAAY,IAAIG,YAAY,EAC5BH,YAAY,IAAII,aAAa"}
package/dist/index.js CHANGED
@@ -4,4 +4,5 @@ export * from './graphql_url_.js';
4
4
  export * from './FetchHttpHeaders.js';
5
5
  export * from './FetchHttpOpts.js';
6
6
  export * from './graphql_fetch.js';
7
+
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './graphql_fetch_.js'\nexport * from './graphql_port_txt_.js'\nexport * from './graphql_url_.js'\nexport * from './FetchHttpHeaders.js'\nexport * from './FetchHttpOpts.js'\nexport * from './graphql_fetch.js'\n"],"names":[],"mappings":"cAAc,CAAqB;cACrB,CAAwB;cACxB,CAAmB;cACnB,CAAuB;cACvB,CAAoB;cACpB,CAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/graphql-client",
3
- "version": "7.0.86",
3
+ "version": "7.0.91",
4
4
  "description": "ctx-core graphql-client",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -17,9 +17,9 @@
17
17
  "license": "Apache-2.0",
18
18
  "author": "Brian Takita",
19
19
  "type": "module",
20
- "main": "./dist/index.cjs",
20
+ "main": "./dist/index.js",
21
21
  "module": "./dist/index.js",
22
- "types": "./dist/index.d.ts",
22
+ "types": "./src/index.ts",
23
23
  "exports": {
24
24
  ".": {
25
25
  "require": "./dist/index.cjs",
@@ -28,25 +28,25 @@
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "dependencies": {
31
- "@ctx-core/dom": "^11.0.28",
32
- "@ctx-core/fetch": "^11.0.78",
33
- "@ctx-core/graphql": "^9.0.29",
34
- "@ctx-core/object": "^21.0.21",
35
- "esm": "^3.2.25"
31
+ "@ctx-core/dom": "^11.0.32",
32
+ "@ctx-core/fetch": "^11.0.83",
33
+ "@ctx-core/object": "^21.0.24"
36
34
  },
37
35
  "devDependencies": {
38
- "@types/node": "^16.11.6",
39
- "typescript": "^4.4.4"
36
+ "@swc/cli": "^0.1.51",
37
+ "@swc/core": "^1.2.110",
38
+ "@types/node": "^16.11.8",
39
+ "typescript": "^4.5.2"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public",
43
43
  "cache": "~/.npm"
44
44
  },
45
45
  "scripts": {
46
- "build": "npm run clean && npm run copy-mjs && npm run compile",
47
- "clean": "rm -f tsconfig.tsbuildinfo && rm -f src/**/*.js && rm -f src/**/*.d.ts && rm -f src/**/*.map",
48
- "compile": "./node_modules/.bin/tsc -b .",
49
- "copy-mjs": "cd dist && echo \"module.exports = (async () => import('./index.js'))()\" > index.cjs",
46
+ "@ctx-core/graphql": "workspace:^9.0.29",
47
+ "build": "npm run compile",
48
+ "clean": "rm -rf dist",
49
+ "compile": "swc src --out-dir dist --copy-files --source-maps --config-file .swcrc",
50
50
  "exec": "$@"
51
51
  }
52
52
  }
@@ -1,3 +0,0 @@
1
- export interface FetchHttpHeaders extends Record<string, string> {
2
- 'Content-Type': string;
3
- }
@@ -1,5 +0,0 @@
1
- import type { FetchHttpHeaders } from './FetchHttpHeaders.js';
2
- export interface FetchHttpOpts {
3
- url?: string;
4
- headers?: FetchHttpHeaders;
5
- }
@@ -1,6 +0,0 @@
1
- import type { FetchHttpOpts } from './FetchHttpOpts.js';
2
- export declare function graphql_fetch<data_T extends unknown = unknown>(body: string, fn_in_http_opts?: FetchHttpOpts): Promise<graphql_fetch_response_T<data_T>>;
3
- export interface graphql_fetch_response_T<data_T extends unknown = unknown> {
4
- data: data_T;
5
- }
6
- export { graphql_fetch as fetch_graphql, graphql_fetch as fetch__graphql, };
@@ -1,4 +0,0 @@
1
- import type { FetchHttpOpts } from './FetchHttpOpts.js';
2
- export declare function graphql_fetch_<O1 extends unknown = unknown>(in_http_opts?: FetchHttpOpts): graphql_fetch_T<O1>;
3
- export declare type graphql_fetch_T<O extends unknown = unknown> = (body: string, fn_in_http_opts: FetchHttpOpts) => Promise<O>;
4
- export { graphql_fetch_ as _graphql_fetch, graphql_fetch_ as _fetch__graphql, };
@@ -1,2 +0,0 @@
1
- export declare function graphql_port_txt_(port?: string | undefined): string;
2
- export { graphql_port_txt_ as _graphql_port_txt, graphql_port_txt_ as _txt__port__graphql, };
@@ -1,2 +0,0 @@
1
- export declare function graphql_url_(host?: string): string;
2
- export { graphql_url_ as _graphql_url, graphql_url_ as _url__graphql, };
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- module.exports = (async () => import('./index.js'))()
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './graphql_fetch_.js';
2
- export * from './graphql_port_txt_.js';
3
- export * from './graphql_url_.js';
4
- export * from './FetchHttpHeaders.js';
5
- export * from './FetchHttpOpts.js';
6
- export * from './graphql_fetch.js';