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

@sitecore-jss/sitecore-jss

Package Overview
Dependencies
Maintainers
4
Versions
1350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sitecore-jss/sitecore-jss - npm Package Compare versions

Comparing version 8.0.3 to 9.0.0

dist/layoutDataUtils.js

11

dist/dataApi.js

@@ -22,3 +22,3 @@ "use strict";

return (mod && mod.__esModule) ? mod : { "default": mod };
}
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -96,10 +96,1 @@ var axios_1 = __importDefault(require("axios"));

};
/**
* Makes a request to Sitecore Content Service for the specified item path.
*/
exports.fetchItemData = function (itemPath, options) {
if (options === void 0) { options = {}; }
var querystringParams = options.querystringParams, _a = options.contentServiceConfig, contentServiceConfig = _a === void 0 ? {} : _a, requestConfig = options.requestConfig;
var _b = contentServiceConfig.host, host = _b === void 0 ? '' : _b;
return fetchData(host + "/sitecore/api/jss/contentsvc", __assign({ itemPath: itemPath }, querystringParams), requestConfig);
};

@@ -20,2 +20,3 @@ "use strict";

return Object.keys(propData).reduce(function (result, propName) {
var _a, _b;
var propValue = propData[propName];

@@ -60,3 +61,2 @@ // if no propValue, then bail

return newResult;
var _a, _b;
}, {});

@@ -63,0 +63,0 @@ };

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __importStar = (this && this.__importStar) || function (mod) {

@@ -11,3 +8,3 @@ if (mod && mod.__esModule) return mod;

return result;
}
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -23,2 +20,8 @@ var dataApi = __importStar(require("./dataApi"));

exports.convertRouteToLayoutServiceFormat = dataConversion_1.convertRouteToLayoutServiceFormat;
__export(require("./util"));
var util_1 = require("./util");
exports.isExperienceEditorActive = util_1.isExperienceEditorActive;
exports.isServer = util_1.isServer;
exports.resetExperienceEditorChromes = util_1.resetExperienceEditorChromes;
var layoutDataUtils_1 = require("./layoutDataUtils");
exports.getFieldValue = layoutDataUtils_1.getFieldValue;
exports.getChildPlaceholder = layoutDataUtils_1.getChildPlaceholder;

@@ -47,2 +47,6 @@ "use strict";

exports.updateImageUrl = function (url, params) {
// polyfill node `global` in browser to workaround https://github.com/unshiftio/url-parse/issues/150
if (typeof window !== 'undefined' && !window.global) {
window.global = {};
}
var parsed = URL(url, {}, true);

@@ -49,0 +53,0 @@ parsed.query = params || parsed.query;

{
"name": "@sitecore-jss/sitecore-jss",
"version": "8.0.3",
"version": "9.0.0",
"main": "dist/index.js",

@@ -43,3 +43,3 @@ "scripts": {

"lodash.unescape": "^4.0.1",
"url-parse": "^1.2.0"
"url-parse": "^1.4.1"
},

@@ -46,0 +46,0 @@ "description": "",

import { AxiosRequestConfig } from 'axios';
import { Item, LayoutServiceData, PlaceholderData } from './dataModels';
import { LayoutServiceData, PlaceholderData } from './dataModels';
export interface LayoutServiceConfig {

@@ -18,8 +18,2 @@ /**

}
export interface ContentServiceConfig {
/**
* Host name of the Sitecore instance serving Content Service requests.
*/
host?: string;
}
export interface BaseRequestOptions {

@@ -43,8 +37,2 @@ /**

}
export interface ContentServiceRequestOptions extends BaseRequestOptions {
/**
* Configuration options for Content Service requests.
*/
contentServiceConfig?: ContentServiceConfig;
}
/**

@@ -59,5 +47,1 @@ * Makes a request to Sitecore Layout Service for the specified route item path.

export declare const fetchPlaceholderData: (placeholderName: string, itemPath: string, options?: LayoutServiceRequestOptions) => Promise<PlaceholderData>;
/**
* Makes a request to Sitecore Content Service for the specified item path.
*/
export declare const fetchItemData: (itemPath: string, options?: ContentServiceRequestOptions) => Promise<Item>;

@@ -23,6 +23,8 @@ import { Field, Item, PlaceholdersData, RouteData } from './dataModels';

deviceId?: string | undefined;
languageName?: string | undefined;
itemLanguage?: string | undefined;
itemVersion?: number | undefined;
layoutId?: string | undefined;
templateId?: string | undefined;
templateName?: string | undefined;
itemId?: string | undefined;
};

@@ -14,2 +14,8 @@ /**

context: {
pageEditing?: boolean;
language?: string;
pageState?: 'preview' | 'edit' | 'normal';
site?: {
name?: string;
};
[key: string]: any;

@@ -29,3 +35,4 @@ };

deviceId?: string;
languageName?: string;
itemLanguage?: string;
itemVersion?: number;
layoutId?: string;

@@ -35,2 +42,3 @@ templateId?: string;

placeholders: PlaceholdersData;
itemId?: string;
}

@@ -45,2 +53,14 @@ /**

/**
* Content field data passed to a component
*/
export interface ComponentFields {
[name: string]: Field | Item[];
}
/**
* Component params
*/
export interface ComponentParams {
[name: string]: string;
}
/**
* Definition of a component instance within a placeholder on a route

@@ -53,8 +73,4 @@ */

placeholders?: PlaceholdersData;
fields?: {
[name: string]: Field | Item[];
};
params?: {
[name: string]: string;
};
fields?: ComponentFields;
params?: ComponentParams;
}

@@ -61,0 +77,0 @@ /**

import * as dataApi from './dataApi';
import * as mediaApi from './mediaApi';
export { dataApi, mediaApi };
export { LayoutServiceRequestOptions } from './dataApi';
export { getDynamicPlaceholderKey } from './dynamicPlaceholders';
export { convertPropDataToLayoutServiceFormat, convertRouteToLayoutServiceFormat } from './dataConversion';
export * from './util';
export * from './dataModels';
export { convertPropDataToLayoutServiceFormat, convertRouteToLayoutServiceFormat, } from './dataConversion';
export { isExperienceEditorActive, isServer, resetExperienceEditorChromes } from './util';
export { LayoutServiceData, LayoutServiceContextData, RouteData, PlaceholderData, ComponentRendering, HtmlElementRendering, Field, Item, PlaceholdersData, ComponentFields, ComponentParams } from './dataModels';
export { getFieldValue, getChildPlaceholder } from './layoutDataUtils';
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