Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cmpsr/contentful-core

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cmpsr/contentful-core - npm Package Compare versions

Comparing version 0.5.5-canary-20231120095410 to 0.5.5-canary-20231120102451

9

lib/client/createContentfulLink.d.ts
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;

20

lib/client/createContentfulLink.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc