@commercetools/frontend-sdk
Advanced tools
Comparing version 1.7.0 to 1.7.1
## Version 1.7.0 (2023-04-19) | ||
## Version 1.7.1 (2023-04-24) | ||
* Fixed formatting | ||
* Updated version | ||
* Refactor OptionsType -> ServerOptions | ||
* Refactor OptionsType -> ServerOptions | ||
* Added server cookie support for session handling | ||
* Changed serverSession handling to take IncomingMessage | ||
* Refactoring | ||
* fix: formatting | ||
* Removed use of js-cookie package | ||
* Removed js-cookie package | ||
* Removed js-cookie package | ||
* Rework of cookie handling for better SSR support | ||
## Version 1.7.0 (2023-04-19) | ||
* feat: added support to pass serverSession in callAction | ||
@@ -7,0 +21,0 @@ |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,10 +18,2 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -38,3 +28,55 @@ | ||
module.exports = __toCommonJS(cookieManagement_exports); | ||
var import_cookies = __toESM(require("cookies")); | ||
// src/cookieHandling/index.ts | ||
var import_cookie = require("cookie"); | ||
var isClientSide = () => typeof window !== "undefined"; | ||
var processValue = (value) => { | ||
switch (value) { | ||
case "true": | ||
return true; | ||
case "false": | ||
return false; | ||
case "undefined": | ||
return void 0; | ||
case "null": | ||
return null; | ||
default: | ||
return value; | ||
} | ||
}; | ||
var decode = (str) => str ? str.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent) : str; | ||
var getCookies = (options) => { | ||
let req; | ||
if (options) { | ||
req = options.req; | ||
} | ||
if (!isClientSide()) { | ||
if (req?.cookies) { | ||
return req.cookies; | ||
} | ||
if (req?.headers?.cookie) { | ||
return (0, import_cookie.parse)(req.headers.cookie); | ||
} | ||
return {}; | ||
} | ||
const _cookies = {}; | ||
const documentCookies = document.cookie ? document.cookie.split("; ") : []; | ||
for (let i = 0, len = documentCookies.length; i < len; i++) { | ||
const cookieParts = documentCookies[i].split("="); | ||
const _cookie = cookieParts.slice(1).join("="); | ||
const name = cookieParts[0]; | ||
_cookies[name] = _cookie; | ||
} | ||
return _cookies; | ||
}; | ||
var getCookie = (key, options) => { | ||
const _cookies = getCookies(options); | ||
const value = _cookies[key]; | ||
if (value === void 0) { | ||
return void 0; | ||
} | ||
return processValue(decode(value)); | ||
}; | ||
// src/helpers/cookieManagement.ts | ||
var REMEMBER_ME = "__rememberMe"; | ||
@@ -67,4 +109,3 @@ var rememberMeCookie = { | ||
get: function(req, res) { | ||
const cookies = new import_cookies.default(req, res); | ||
return cookies.get("frontastic-session"); | ||
return getCookie("frontastic-session", { req, res })?.toString(); | ||
} | ||
@@ -71,0 +112,0 @@ }; |
@@ -0,5 +1,8 @@ | ||
import { ServerOptions } from '../cookieHandling/types.js'; | ||
import { FetchError } from '../library/FetchError.js'; | ||
import 'cookie'; | ||
import 'http'; | ||
declare const fetcher: <T>(url: string, options?: RequestInit, sessionCookies?: string) => Promise<FetchError | T>; | ||
declare const fetcher: <T>(url: string, options: RequestInit, serverOptions?: ServerOptions) => Promise<FetchError | T>; | ||
export { fetcher }; |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,10 +18,2 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -37,6 +27,103 @@ | ||
module.exports = __toCommonJS(fetcher_exports); | ||
var import_js_cookie = __toESM(require("js-cookie")); | ||
// src/cookieHandling/index.ts | ||
var import_cookie = require("cookie"); | ||
var isClientSide = () => typeof window !== "undefined"; | ||
var processValue = (value) => { | ||
switch (value) { | ||
case "true": | ||
return true; | ||
case "false": | ||
return false; | ||
case "undefined": | ||
return void 0; | ||
case "null": | ||
return null; | ||
default: | ||
return value; | ||
} | ||
}; | ||
var stringify = (value = "") => { | ||
try { | ||
const result = JSON.stringify(value); | ||
return /^[\{\[]/.test(result) ? result : value; | ||
} catch (e) { | ||
return value; | ||
} | ||
}; | ||
var decode = (str) => str ? str.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent) : str; | ||
var getCookies = (options) => { | ||
let req; | ||
if (options) { | ||
req = options.req; | ||
} | ||
if (!isClientSide()) { | ||
if (req?.cookies) { | ||
return req.cookies; | ||
} | ||
if (req?.headers?.cookie) { | ||
return (0, import_cookie.parse)(req.headers.cookie); | ||
} | ||
return {}; | ||
} | ||
const _cookies = {}; | ||
const documentCookies = document.cookie ? document.cookie.split("; ") : []; | ||
for (let i = 0, len = documentCookies.length; i < len; i++) { | ||
const cookieParts = documentCookies[i].split("="); | ||
const _cookie = cookieParts.slice(1).join("="); | ||
const name = cookieParts[0]; | ||
_cookies[name] = _cookie; | ||
} | ||
return _cookies; | ||
}; | ||
var getCookie = (key, options) => { | ||
const _cookies = getCookies(options); | ||
const value = _cookies[key]; | ||
if (value === void 0) { | ||
return void 0; | ||
} | ||
return processValue(decode(value)); | ||
}; | ||
var setCookie = (key, data, options) => { | ||
let _cookieOptions; | ||
let _req; | ||
let _res; | ||
if (options) { | ||
const { req, res, ..._options } = options; | ||
_req = req; | ||
_res = res; | ||
_cookieOptions = _options; | ||
} | ||
const cookieStr = (0, import_cookie.serialize)(key, stringify(data), { | ||
path: "/", | ||
..._cookieOptions | ||
}); | ||
if (!isClientSide()) { | ||
if (_res && _req) { | ||
let currentCookies = _res.getHeader("Set-Cookie"); | ||
if (!Array.isArray(currentCookies)) { | ||
currentCookies = !currentCookies ? [] : [String(currentCookies)]; | ||
} | ||
_res.setHeader("Set-Cookie", currentCookies.concat(cookieStr)); | ||
if (_req && _req.cookies) { | ||
const _cookies = _req.cookies; | ||
data === "" ? delete _cookies[key] : _cookies[key] = stringify(data); | ||
} | ||
if (_req && _req.headers && _req.headers.cookie) { | ||
const _cookies = (0, import_cookie.parse)(_req.headers.cookie); | ||
data === "" ? delete _cookies[key] : _cookies[key] = stringify(data); | ||
_req.headers.cookie = Object.entries(_cookies).reduce( | ||
(accum, item) => { | ||
return accum.concat(`${item[0]}=${item[1]};`); | ||
}, | ||
"" | ||
); | ||
} | ||
} | ||
} else { | ||
document.cookie = cookieStr; | ||
} | ||
}; | ||
// src/helpers/cookieManagement.ts | ||
var import_cookies = __toESM(require("cookies")); | ||
var REMEMBER_ME = "__rememberMe"; | ||
@@ -84,5 +171,4 @@ var rememberMeCookie = { | ||
// src/helpers/fetcher.ts | ||
var cookiesApi = import_js_cookie.default.withAttributes({ path: "/" }); | ||
var fetcher = async (url, options = {}, sessionCookies = "") => { | ||
const sessionCookie = sessionCookies ? sessionCookies : cookiesApi.get("frontastic-session"); | ||
var fetcher = async (url, options, serverOptions) => { | ||
const sessionCookie = getCookie("frontastic-session", serverOptions) ?? ""; | ||
options.headers = { | ||
@@ -96,3 +182,3 @@ "Content-Type": "application/json", | ||
const response = await fetch(url, options); | ||
if (typeof window !== "undefined" && response.ok && response.headers.has("Frontastic-Session")) { | ||
if (response.ok && response.headers.has("Frontastic-Session")) { | ||
let rememberMe = rememberMeCookie.get(); | ||
@@ -103,6 +189,6 @@ let expiryDate; | ||
} | ||
cookiesApi.set( | ||
setCookie( | ||
"frontastic-session", | ||
response.headers.get("Frontastic-Session"), | ||
{ expires: expiryDate } | ||
{ expires: expiryDate, ...serverOptions ?? {} } | ||
); | ||
@@ -109,0 +195,0 @@ } |
@@ -12,2 +12,4 @@ export { rememberMeCookie, serverSession } from './helpers/cookieManagement.js'; | ||
import './types/api/page/index.js'; | ||
import './cookieHandling/types.js'; | ||
import 'cookie'; | ||
import './types/Query.js'; | ||
@@ -14,0 +16,0 @@ import './types/api/page/PageFolderListResponse.js'; |
131
lib/index.js
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,10 +18,2 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -45,4 +35,102 @@ | ||
// src/cookieHandling/index.ts | ||
var import_cookie = require("cookie"); | ||
var isClientSide = () => typeof window !== "undefined"; | ||
var processValue = (value) => { | ||
switch (value) { | ||
case "true": | ||
return true; | ||
case "false": | ||
return false; | ||
case "undefined": | ||
return void 0; | ||
case "null": | ||
return null; | ||
default: | ||
return value; | ||
} | ||
}; | ||
var stringify = (value = "") => { | ||
try { | ||
const result = JSON.stringify(value); | ||
return /^[\{\[]/.test(result) ? result : value; | ||
} catch (e) { | ||
return value; | ||
} | ||
}; | ||
var decode = (str) => str ? str.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent) : str; | ||
var getCookies = (options) => { | ||
let req; | ||
if (options) { | ||
req = options.req; | ||
} | ||
if (!isClientSide()) { | ||
if (req?.cookies) { | ||
return req.cookies; | ||
} | ||
if (req?.headers?.cookie) { | ||
return (0, import_cookie.parse)(req.headers.cookie); | ||
} | ||
return {}; | ||
} | ||
const _cookies = {}; | ||
const documentCookies = document.cookie ? document.cookie.split("; ") : []; | ||
for (let i = 0, len = documentCookies.length; i < len; i++) { | ||
const cookieParts = documentCookies[i].split("="); | ||
const _cookie = cookieParts.slice(1).join("="); | ||
const name = cookieParts[0]; | ||
_cookies[name] = _cookie; | ||
} | ||
return _cookies; | ||
}; | ||
var getCookie = (key, options) => { | ||
const _cookies = getCookies(options); | ||
const value = _cookies[key]; | ||
if (value === void 0) { | ||
return void 0; | ||
} | ||
return processValue(decode(value)); | ||
}; | ||
var setCookie = (key, data, options) => { | ||
let _cookieOptions; | ||
let _req; | ||
let _res; | ||
if (options) { | ||
const { req, res, ..._options } = options; | ||
_req = req; | ||
_res = res; | ||
_cookieOptions = _options; | ||
} | ||
const cookieStr = (0, import_cookie.serialize)(key, stringify(data), { | ||
path: "/", | ||
..._cookieOptions | ||
}); | ||
if (!isClientSide()) { | ||
if (_res && _req) { | ||
let currentCookies = _res.getHeader("Set-Cookie"); | ||
if (!Array.isArray(currentCookies)) { | ||
currentCookies = !currentCookies ? [] : [String(currentCookies)]; | ||
} | ||
_res.setHeader("Set-Cookie", currentCookies.concat(cookieStr)); | ||
if (_req && _req.cookies) { | ||
const _cookies = _req.cookies; | ||
data === "" ? delete _cookies[key] : _cookies[key] = stringify(data); | ||
} | ||
if (_req && _req.headers && _req.headers.cookie) { | ||
const _cookies = (0, import_cookie.parse)(_req.headers.cookie); | ||
data === "" ? delete _cookies[key] : _cookies[key] = stringify(data); | ||
_req.headers.cookie = Object.entries(_cookies).reduce( | ||
(accum, item) => { | ||
return accum.concat(`${item[0]}=${item[1]};`); | ||
}, | ||
"" | ||
); | ||
} | ||
} | ||
} else { | ||
document.cookie = cookieStr; | ||
} | ||
}; | ||
// src/helpers/cookieManagement.ts | ||
var import_cookies = __toESM(require("cookies")); | ||
var REMEMBER_ME = "__rememberMe"; | ||
@@ -75,4 +163,3 @@ var rememberMeCookie = { | ||
get: function(req, res) { | ||
const cookies = new import_cookies.default(req, res); | ||
return cookies.get("frontastic-session"); | ||
return getCookie("frontastic-session", { req, res })?.toString(); | ||
} | ||
@@ -89,5 +176,2 @@ }; | ||
// src/helpers/fetcher.ts | ||
var import_js_cookie = __toESM(require("js-cookie")); | ||
// src/library/FetchError.ts | ||
@@ -109,5 +193,4 @@ var FetchError = class extends Error { | ||
// src/helpers/fetcher.ts | ||
var cookiesApi = import_js_cookie.default.withAttributes({ path: "/" }); | ||
var fetcher = async (url, options = {}, sessionCookies = "") => { | ||
const sessionCookie = sessionCookies ? sessionCookies : cookiesApi.get("frontastic-session"); | ||
var fetcher = async (url, options, serverOptions) => { | ||
const sessionCookie = getCookie("frontastic-session", serverOptions) ?? ""; | ||
options.headers = { | ||
@@ -121,3 +204,3 @@ "Content-Type": "application/json", | ||
const response = await fetch(url, options); | ||
if (typeof window !== "undefined" && response.ok && response.headers.has("Frontastic-Session")) { | ||
if (response.ok && response.headers.has("Frontastic-Session")) { | ||
let rememberMe = rememberMeCookie.get(); | ||
@@ -128,6 +211,6 @@ let expiryDate; | ||
} | ||
cookiesApi.set( | ||
setCookie( | ||
"frontastic-session", | ||
response.headers.get("Frontastic-Session"), | ||
{ expires: expiryDate } | ||
{ expires: expiryDate, ...serverOptions ?? {} } | ||
); | ||
@@ -396,3 +479,3 @@ } | ||
fetcherOptions, | ||
options.serverSession | ||
options.serverOptions | ||
); | ||
@@ -438,3 +521,3 @@ } | ||
fetcherOptions, | ||
options.serverSession | ||
options.serverOptions | ||
); | ||
@@ -441,0 +524,0 @@ } catch (error) { |
@@ -6,2 +6,5 @@ import { SDK } from './SDK.js'; | ||
import '../types/api/page/index.js'; | ||
import '../cookieHandling/types.js'; | ||
import 'cookie'; | ||
import 'http'; | ||
import '../types/Query.js'; | ||
@@ -8,0 +11,0 @@ import '../types/api/page/PageFolderListResponse.js'; |
@@ -5,2 +5,3 @@ import { EventManager } from './EventManager.js'; | ||
import { AcceptedQueryTypes } from '../types/Query.js'; | ||
import { ServerOptions } from '../cookieHandling/types.js'; | ||
import './Event.js'; | ||
@@ -15,2 +16,4 @@ import './ActionError.js'; | ||
import '../types/api/page/PageViewData.js'; | ||
import 'cookie'; | ||
import 'http'; | ||
@@ -40,3 +43,3 @@ type SDKConfig = { | ||
query?: AcceptedQueryTypes; | ||
serverSession?: string; | ||
serverOptions?: ServerOptions; | ||
}): Promise<SDKResponse<ReturnData>>; | ||
@@ -43,0 +46,0 @@ page: PageApi; |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,10 +18,2 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -38,7 +28,102 @@ | ||
// src/helpers/fetcher.ts | ||
var import_js_cookie = __toESM(require("js-cookie")); | ||
// src/cookieHandling/index.ts | ||
var import_cookie = require("cookie"); | ||
var isClientSide = () => typeof window !== "undefined"; | ||
var processValue = (value) => { | ||
switch (value) { | ||
case "true": | ||
return true; | ||
case "false": | ||
return false; | ||
case "undefined": | ||
return void 0; | ||
case "null": | ||
return null; | ||
default: | ||
return value; | ||
} | ||
}; | ||
var stringify = (value = "") => { | ||
try { | ||
const result = JSON.stringify(value); | ||
return /^[\{\[]/.test(result) ? result : value; | ||
} catch (e) { | ||
return value; | ||
} | ||
}; | ||
var decode = (str) => str ? str.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent) : str; | ||
var getCookies = (options) => { | ||
let req; | ||
if (options) { | ||
req = options.req; | ||
} | ||
if (!isClientSide()) { | ||
if (req?.cookies) { | ||
return req.cookies; | ||
} | ||
if (req?.headers?.cookie) { | ||
return (0, import_cookie.parse)(req.headers.cookie); | ||
} | ||
return {}; | ||
} | ||
const _cookies = {}; | ||
const documentCookies = document.cookie ? document.cookie.split("; ") : []; | ||
for (let i = 0, len = documentCookies.length; i < len; i++) { | ||
const cookieParts = documentCookies[i].split("="); | ||
const _cookie = cookieParts.slice(1).join("="); | ||
const name = cookieParts[0]; | ||
_cookies[name] = _cookie; | ||
} | ||
return _cookies; | ||
}; | ||
var getCookie = (key, options) => { | ||
const _cookies = getCookies(options); | ||
const value = _cookies[key]; | ||
if (value === void 0) { | ||
return void 0; | ||
} | ||
return processValue(decode(value)); | ||
}; | ||
var setCookie = (key, data, options) => { | ||
let _cookieOptions; | ||
let _req; | ||
let _res; | ||
if (options) { | ||
const { req, res, ..._options } = options; | ||
_req = req; | ||
_res = res; | ||
_cookieOptions = _options; | ||
} | ||
const cookieStr = (0, import_cookie.serialize)(key, stringify(data), { | ||
path: "/", | ||
..._cookieOptions | ||
}); | ||
if (!isClientSide()) { | ||
if (_res && _req) { | ||
let currentCookies = _res.getHeader("Set-Cookie"); | ||
if (!Array.isArray(currentCookies)) { | ||
currentCookies = !currentCookies ? [] : [String(currentCookies)]; | ||
} | ||
_res.setHeader("Set-Cookie", currentCookies.concat(cookieStr)); | ||
if (_req && _req.cookies) { | ||
const _cookies = _req.cookies; | ||
data === "" ? delete _cookies[key] : _cookies[key] = stringify(data); | ||
} | ||
if (_req && _req.headers && _req.headers.cookie) { | ||
const _cookies = (0, import_cookie.parse)(_req.headers.cookie); | ||
data === "" ? delete _cookies[key] : _cookies[key] = stringify(data); | ||
_req.headers.cookie = Object.entries(_cookies).reduce( | ||
(accum, item) => { | ||
return accum.concat(`${item[0]}=${item[1]};`); | ||
}, | ||
"" | ||
); | ||
} | ||
} | ||
} else { | ||
document.cookie = cookieStr; | ||
} | ||
}; | ||
// src/helpers/cookieManagement.ts | ||
var import_cookies = __toESM(require("cookies")); | ||
var REMEMBER_ME = "__rememberMe"; | ||
@@ -86,5 +171,4 @@ var rememberMeCookie = { | ||
// src/helpers/fetcher.ts | ||
var cookiesApi = import_js_cookie.default.withAttributes({ path: "/" }); | ||
var fetcher = async (url, options = {}, sessionCookies = "") => { | ||
const sessionCookie = sessionCookies ? sessionCookies : cookiesApi.get("frontastic-session"); | ||
var fetcher = async (url, options, serverOptions) => { | ||
const sessionCookie = getCookie("frontastic-session", serverOptions) ?? ""; | ||
options.headers = { | ||
@@ -98,3 +182,3 @@ "Content-Type": "application/json", | ||
const response = await fetch(url, options); | ||
if (typeof window !== "undefined" && response.ok && response.headers.has("Frontastic-Session")) { | ||
if (response.ok && response.headers.has("Frontastic-Session")) { | ||
let rememberMe = rememberMeCookie.get(); | ||
@@ -105,6 +189,6 @@ let expiryDate; | ||
} | ||
cookiesApi.set( | ||
setCookie( | ||
"frontastic-session", | ||
response.headers.get("Frontastic-Session"), | ||
{ expires: expiryDate } | ||
{ expires: expiryDate, ...serverOptions ?? {} } | ||
); | ||
@@ -373,3 +457,3 @@ } | ||
fetcherOptions, | ||
options.serverSession | ||
options.serverOptions | ||
); | ||
@@ -415,3 +499,3 @@ } | ||
fetcherOptions, | ||
options.serverSession | ||
options.serverOptions | ||
); | ||
@@ -418,0 +502,0 @@ } catch (error) { |
@@ -0,1 +1,2 @@ | ||
import { ServerOptions } from '../../../cookieHandling/types.js'; | ||
import { SDKResponse } from '../../../library/types.js'; | ||
@@ -7,2 +8,4 @@ import { AcceptedQueryTypes } from '../../Query.js'; | ||
export { PageViewData } from './PageViewData.js'; | ||
import 'cookie'; | ||
import 'http'; | ||
import '../../../library/ActionError.js'; | ||
@@ -17,3 +20,3 @@ import '../../../library/FetchError.js'; | ||
query?: AcceptedQueryTypes; | ||
serverSession?: string; | ||
serverOptions?: ServerOptions; | ||
}) => Promise<SDKResponse<PageResponse>>; | ||
@@ -20,0 +23,0 @@ getPreview: (options: { |
{ | ||
"name": "@commercetools/frontend-sdk", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"license": "UNLICENSED", | ||
@@ -16,9 +16,7 @@ "main": "lib/index.js", | ||
"@frontastic/extension-types": "^0.0.11", | ||
"cookies": "^0.8.0", | ||
"js-cookie": "3.0.1" | ||
"cookie": "^0.5.0" | ||
}, | ||
"devDependencies": { | ||
"@types/cookies": "^0.7.7", | ||
"@types/cookie": "^0.5.1", | ||
"@types/core-js": "2.5.5", | ||
"@types/js-cookie": "3.0.2", | ||
"@types/node": "^18.14.0", | ||
@@ -25,0 +23,0 @@ "prettier": "2.7.1", |
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
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
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
Sorry, the diff of this file is not supported yet
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
245700
2
7
147
3357
+ Addedcookie@^0.5.0
+ Addedcookie@0.5.0(transitive)
- Removedcookies@^0.8.0
- Removedjs-cookie@3.0.1
- Removedcookies@0.8.0(transitive)
- Removeddepd@2.0.0(transitive)
- Removedjs-cookie@3.0.1(transitive)
- Removedkeygrip@1.1.0(transitive)
- Removedtsscmp@1.0.6(transitive)