@cmpsr/contentful-core
Advanced tools
Comparing version 0.5.5-canary-20231120095410 to 0.5.5-canary-20231120102451
import { HttpLink } from '@apollo/client'; | ||
export declare const createContentfulLink: (options: any) => HttpLink; | ||
export interface ContentfulLinkOptions { | ||
accessToken: string; | ||
space: string; | ||
environment?: string; | ||
apiVersion?: string; | ||
headers?: Record<string, string>; | ||
} | ||
export declare const createContentfulLink: ({ accessToken, space, environment, apiVersion, headers, }: ContentfulLinkOptions) => HttpLink; |
@@ -12,3 +12,2 @@ "use strict"; | ||
var _client = require("@apollo/client"); | ||
var _invariant = /*#__PURE__*/ _interop_require_default(require("invariant")); | ||
var _crossfetch = /*#__PURE__*/ _interop_require_default(require("cross-fetch")); | ||
@@ -72,10 +71,11 @@ function _define_property(obj, key, value) { | ||
} | ||
var createContentfulLink = function(options) { | ||
var _Object_assign = Object.assign({}, { | ||
environment: "master", | ||
headers: {}, | ||
apiVersion: "v1" | ||
}, options), accessToken = _Object_assign.accessToken, apiVersion = _Object_assign.apiVersion, environment = _Object_assign.environment, space = _Object_assign.space, headers = _Object_assign.headers; | ||
(0, _invariant.default)(space, "Contentful `space` ID missing from ContentfulLink initialization."); | ||
(0, _invariant.default)(accessToken, "Contentful `accessToken` missing from ContentfulLink initialization"); | ||
var createContentfulLink = function(param) { | ||
var accessToken = param.accessToken, space = param.space, _param_environment = param.environment, environment = _param_environment === void 0 ? "master" : _param_environment, _param_apiVersion = param.apiVersion, apiVersion = _param_apiVersion === void 0 ? "v1" : _param_apiVersion, _param_headers = param.headers, headers = _param_headers === void 0 ? {} : _param_headers; | ||
if (!space) { | ||
throw new Error("Contentful `space` ID is required for initialization."); | ||
} | ||
if (!accessToken) { | ||
throw new Error("Contentful `accessToken` is required for initialization."); | ||
} | ||
var uri = "https://graphql.contentful.com/content/".concat(apiVersion, "/spaces/").concat(space, "/environments/").concat(environment); | ||
return new _client.HttpLink({ | ||
@@ -86,4 +86,4 @@ headers: _object_spread_props(_object_spread({}, headers), { | ||
fetch: _crossfetch.default, | ||
uri: "https://graphql.contentful.com/content/".concat(apiVersion, "/spaces/").concat(space, "/environments/").concat(environment) | ||
uri: uri | ||
}); | ||
}; |
{ | ||
"name": "@cmpsr/contentful-core", | ||
"version": "0.5.5-canary-20231120095410", | ||
"version": "0.5.5-canary-20231120102451", | ||
"description": "Base Composer components for standing up a React/NextJS app that can dynamically render components based on Contentful Model types mapped to components and queries.", | ||
@@ -11,4 +11,3 @@ "author": "Ryan Hefner <hi@ryanhefner.com>", | ||
"lib": "lib", | ||
"scripts": "scripts", | ||
"test": "__tests__" | ||
"scripts": "scripts" | ||
}, | ||
@@ -33,5 +32,2 @@ "files": [ | ||
"test:coverage": "jest --coverage --testPathIgnorePatterns=lib/", | ||
"graphql:schema": "node ./scripts/graphql-schema.js", | ||
"graphql:types": "node ./scripts/graphql-types.js", | ||
"graphql:possibleTypes": "node ./scripts/graphql-possibleTypes.js", | ||
"type:check": "yarn tsc --project tsconfig.json --noEmit", | ||
@@ -48,4 +44,3 @@ "type:emit": "tsc --project ./tsconfig.json -d --declarationDir lib --emitDeclarationOnly && find lib -type f \\( -name '*.test.*' -o -name '*.stories.*' \\) -exec rm {} +" | ||
"dependencies": { | ||
"cross-fetch": "^3.1.4", | ||
"invariant": "^2.2.4" | ||
"cross-fetch": "^3.1.4" | ||
}, | ||
@@ -52,0 +47,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
3
0
0
10222
8
127
- Removedinvariant@^2.2.4
- Removedinvariant@2.2.4(transitive)