@deboxsoft/module-core
Advanced tools
Comparing version 1.5.8 to 1.5.9
@@ -5,9 +5,2 @@ 'use strict'; | ||
var Container = require('typedi'); | ||
var graphqlRequest = require('graphql-request'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container); | ||
class Logger { | ||
@@ -23,31 +16,4 @@ } | ||
const createFetchGraphql = (options, persisted = true) => { | ||
const request2 = new graphqlRequest.GraphQLClient(options.url, options); | ||
if (persisted) { | ||
Container__default['default'].set(graphqlRequest.GraphQLClient, request2); | ||
} | ||
return request2; | ||
}; | ||
const getFetchGraphql = () => Container__default['default'].get(graphqlRequest.GraphQLClient); | ||
const fetchGraphql = (query, variables) => getFetchGraphql().request(query, variables); | ||
const gql = graphqlRequest.gql; | ||
const rawRequestGraphql = graphqlRequest.rawRequest; | ||
const requestGraphql = graphqlRequest.request; | ||
Object.keys(Container).forEach(function (k) { | ||
if (k !== 'default') Object.defineProperty(exports, k, { | ||
enumerable: true, | ||
get: function () { | ||
return Container[k]; | ||
} | ||
}); | ||
}); | ||
exports.DeboxError = DeboxError; | ||
exports.Logger = Logger; | ||
exports.createFetchGraphql = createFetchGraphql; | ||
exports.fetchGraphql = fetchGraphql; | ||
exports.getFetchGraphql = getFetchGraphql; | ||
exports.gql = gql; | ||
exports.rawRequestGraphql = rawRequestGraphql; | ||
exports.requestGraphql = requestGraphql; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -1,5 +0,1 @@ | ||
export * from 'typedi'; | ||
import { GraphQLClient, gql as gql$1, rawRequest, request } from 'graphql-request'; | ||
import { RequestInit } from 'graphql-request/dist/types.dom'; | ||
interface LogFn { | ||
@@ -75,12 +71,2 @@ (msg: string, ...args: any[]): void; | ||
declare type GraphqlRequestOptions = RequestInit & { | ||
url: string; | ||
}; | ||
declare const createFetchGraphql: (options: GraphqlRequestOptions, persisted?: boolean) => GraphQLClient; | ||
declare const getFetchGraphql: () => GraphQLClient; | ||
declare const fetchGraphql: <V>(query: string, variables?: V | undefined) => Promise<any>; | ||
declare const gql: typeof gql$1; | ||
declare const rawRequestGraphql: typeof rawRequest; | ||
declare const requestGraphql: typeof request; | ||
export { DeboxError, Logger, createFetchGraphql, fetchGraphql, getFetchGraphql, gql, rawRequestGraphql, requestGraphql }; | ||
export { DeboxError, Logger }; |
19
index.js
@@ -1,5 +0,1 @@ | ||
import Container__default from 'typedi'; | ||
export * from 'typedi'; | ||
import { GraphQLClient, gql as gql$1, rawRequest, request } from 'graphql-request'; | ||
class Logger { | ||
@@ -15,16 +11,3 @@ } | ||
const createFetchGraphql = (options, persisted = true) => { | ||
const request2 = new GraphQLClient(options.url, options); | ||
if (persisted) { | ||
Container__default.set(GraphQLClient, request2); | ||
} | ||
return request2; | ||
}; | ||
const getFetchGraphql = () => Container__default.get(GraphQLClient); | ||
const fetchGraphql = (query, variables) => getFetchGraphql().request(query, variables); | ||
const gql = gql$1; | ||
const rawRequestGraphql = rawRequest; | ||
const requestGraphql = request; | ||
export { DeboxError, Logger, createFetchGraphql, fetchGraphql, getFetchGraphql, gql, rawRequestGraphql, requestGraphql }; | ||
export { DeboxError, Logger }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@deboxsoft/module-core", | ||
"version": "1.5.8", | ||
"version": "1.5.9", | ||
"license": "SEE LICENSE IN LICENSE", | ||
@@ -31,5 +31,3 @@ "maintainers": [ | ||
"dependencies": { | ||
"change-case": "^4.1.1", | ||
"graphql-request": "3.3.0", | ||
"typedi": "^0.8.0" | ||
"change-case": "^4.1.1" | ||
}, | ||
@@ -39,11 +37,3 @@ "publishConfig": { | ||
}, | ||
"peerDependencies": { | ||
"graphql": "*" | ||
}, | ||
"peerDependenciesMeta": { | ||
"graphql": { | ||
"optional": true | ||
} | ||
}, | ||
"gitHead": "a31f94fd95405db2aa017d1462a9e61aed661ee2" | ||
"gitHead": "d58b4bcd9e7694ed2b6661f83ffdc9bbaa61eacb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1
241664
355
- Removedgraphql-request@3.3.0
- Removedtypedi@^0.8.0
- Removedasynckit@0.4.0(transitive)
- Removedcall-bind-apply-helpers@1.0.2(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcross-fetch@3.2.0(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedes-set-tostringtag@2.1.0(transitive)
- Removedextract-files@9.0.0(transitive)
- Removedform-data@3.0.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.3.0(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedgopd@1.2.0(transitive)
- Removedgraphql@15.10.116.10.0(transitive)
- Removedgraphql-request@3.3.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedtypedi@0.8.0(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)