@bloomreach/spa-sdk
Advanced tools
Comparing version 17.1.1 to 18.0.0
@@ -1,9 +0,1 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var relevance = require('./relevance.js'); | ||
exports.relevance = relevance; | ||
export { default as relevance } from './relevance.js'; |
@@ -1,9 +0,4 @@ | ||
'use strict'; | ||
import { __rest } from './_virtual/_tslib.js'; | ||
import cookie from 'cookie'; | ||
var cookie = require('cookie'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie); | ||
/* | ||
@@ -26,6 +21,7 @@ * Copyright 2020 Bloomreach | ||
const DEFAULT_COOKIE_MAX_AGE_IN_SECONDS = 365 * 24 * 60 * 60; | ||
function withOptions({ httpOnly = true, name = DEFAULT_COOKIE_NAME, maxAge = DEFAULT_COOKIE_MAX_AGE_IN_SECONDS, ...options } = {}) { | ||
function withOptions(_a = {}) { | ||
var { httpOnly = true, name = DEFAULT_COOKIE_NAME, maxAge = DEFAULT_COOKIE_MAX_AGE_IN_SECONDS } = _a, options = __rest(_a, ["httpOnly", "name", "maxAge"]); | ||
const handler = (request, response, next) => { | ||
var _a, _b, _c; | ||
const { [name]: value } = cookie__default['default'].parse((_b = (_a = request.headers) === null || _a === void 0 ? void 0 : _a.cookie) !== null && _b !== void 0 ? _b : ''); | ||
const { [name]: value } = cookie.parse((_b = (_a = request.headers) === null || _a === void 0 ? void 0 : _a.cookie) !== null && _b !== void 0 ? _b : ''); | ||
if (value) { | ||
@@ -45,4 +41,4 @@ try { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const { new: _, ...rest } = visitor; | ||
const serialized = cookie__default['default'].serialize(name, JSON.stringify(rest), { ...options, httpOnly, maxAge }); | ||
const rest = __rest(visitor, ["new"]); | ||
const serialized = cookie.serialize(name, JSON.stringify(rest), Object.assign(Object.assign({}, options), { httpOnly, maxAge })); | ||
const cookies = (_b = (_a = response.getHeader) === null || _a === void 0 ? void 0 : _a.call(response, 'set-cookie')) !== null && _b !== void 0 ? _b : []; | ||
@@ -57,2 +53,2 @@ (_c = response.setHeader) === null || _c === void 0 ? void 0 : _c.call(response, 'Set-Cookie', [...(Array.isArray(cookies) ? cookies : [cookies]), serialized]); | ||
module.exports = relevance; | ||
export { relevance as default }; |
@@ -212,6 +212,24 @@ /** | ||
interface ContentModel$1 { | ||
type: string; | ||
interface CmsOptions { | ||
/** | ||
* The window reference for the CMS integration. | ||
* By default the global window object will be used. | ||
*/ | ||
window?: Window; | ||
} | ||
interface PostMessageOptions { | ||
/** | ||
* The brXM origin to verify an integration with the Experience Manager. | ||
* This option should be used when the brXM is accessible from a host other than the Page Model API. | ||
* By default, the origin from the `apiBaseUrl` or `endpoint` parameters is used. | ||
*/ | ||
origin?: string; | ||
/** | ||
* The window reference for the CMS integration. | ||
* By default the global window object will be used. | ||
*/ | ||
window?: Window; | ||
} | ||
declare type ContentLinks = 'site'; | ||
@@ -221,3 +239,3 @@ /** | ||
*/ | ||
interface ContentModel { | ||
interface ContentModel$1 { | ||
_links: Record<ContentLinks, Link>; | ||
@@ -253,4 +271,4 @@ _meta?: MetaCollectionModel; | ||
*/ | ||
getData(): ContentModel; | ||
getData<T extends Record<string, any>>(): T & ContentModel; | ||
getData(): ContentModel$1; | ||
getData<T extends Record<string, any>>(): T & ContentModel$1; | ||
/** | ||
@@ -267,24 +285,2 @@ * @return The link to the content. | ||
interface CmsOptions { | ||
/** | ||
* The window reference for the CMS integration. | ||
* By default the global window object will be used. | ||
*/ | ||
window?: Window; | ||
} | ||
interface PostMessageOptions { | ||
/** | ||
* The brXM origin to verify an integration with the Experience Manager. | ||
* This option should be used when the brXM is accessible from a host other than the Page Model API. | ||
* By default, the origin from the `apiBaseUrl` or `endpoint` parameters is used. | ||
*/ | ||
origin?: string; | ||
/** | ||
* The window reference for the CMS integration. | ||
* By default the global window object will be used. | ||
*/ | ||
window?: Window; | ||
} | ||
interface DocumentDataModel { | ||
@@ -394,2 +390,6 @@ id: string; | ||
interface ContentModel { | ||
type: string; | ||
} | ||
interface MenuItem$1 { | ||
@@ -557,3 +557,3 @@ /** | ||
meta: PageMeta; | ||
page: Record<string, ((ComponentModel$1 | ContainerItemModel$1 | ContainerModel$1) & PageRootModel$1) | ContentModel$1>; | ||
page: Record<string, ((ComponentModel$1 | ContainerItemModel$1 | ContainerModel$1) & PageRootModel$1) | ContentModel>; | ||
root: Reference; | ||
@@ -675,7 +675,7 @@ } | ||
*/ | ||
rewriteLinks(content: string, type?: string): string; | ||
rewriteLinks(content: string, type?: string): Promise<string>; | ||
/** | ||
* Synchronizes the CMS integration state. | ||
*/ | ||
sync(): void; | ||
sync(): Promise<void>; | ||
/** | ||
@@ -689,3 +689,9 @@ * @return A plain JavaScript object of the page model. | ||
*/ | ||
sanitize(content: string): string; | ||
sanitize(content: string): Promise<string>; | ||
/** | ||
* Prepare HTML blob by sanitizing it and rewriting links | ||
* @param documentRef The reference to the document | ||
* @param dataFieldName The name of the property on the document data object | ||
*/ | ||
prepareHTML(documentRef?: Reference, dataFieldName?: string): Promise<string>; | ||
} | ||
@@ -958,3 +964,3 @@ | ||
content?: { | ||
[reference: string]: ContentModel; | ||
[reference: string]: ContentModel$1; | ||
}; | ||
@@ -961,0 +967,0 @@ page: (ComponentModel | ContainerItemModel | ContainerModel) & PageRootModel; |
{ | ||
"name": "@bloomreach/spa-sdk", | ||
"version": "17.1.1", | ||
"version": "18.0.0", | ||
"description": "Bloomreach SPA SDK", | ||
@@ -21,6 +21,6 @@ "keywords": [ | ||
}, | ||
"main": "lib/index.js", | ||
"main": "lib/index.umd.js", | ||
"browser": "lib/index.js", | ||
"module": "lib/index.mjs", | ||
"es2015": "lib/index.es6.js", | ||
"module": "lib/index.js", | ||
"es2015": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
@@ -81,3 +81,3 @@ "files": [ | ||
"js-beautify": "1.14.0", | ||
"rollup": "2.55.0", | ||
"rollup": "2.79.1", | ||
"rollup-plugin-dts": "3.0.2", | ||
@@ -99,3 +99,3 @@ "rollup-plugin-terser": "7.0.2", | ||
}, | ||
"gitHead": "feae721c448e5636b350ae9ead60ff0cfe595470" | ||
"gitHead": "7d467f5b8916b85a8814a675c4cb3f02ffac85b8" | ||
} |
Sorry, the diff of this file is too big to display
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
16
389751
6356
1
1