New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@oracle/content-management-sdk

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oracle/content-management-sdk - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

CHANGELOG.md

2

dist/content.umd.min.js

@@ -1,1 +0,1 @@

!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global=global||self).contentManagementSdk={})}(this,function(exports){function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),_setPrototypeOf(subClass.prototype.constructor=subClass,superClass)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}var theLogger,isNodeJS="undefined"==typeof window&&"object"==typeof process,utils_bind=function(func,owner){return function(){return func.apply(owner,[].slice.call(arguments))}},utils_extend=function(dest,orig){for(var prop in orig)orig.hasOwnProperty(prop)&&(dest[prop]=orig[prop]);return dest},logger=((theLogger={logLevel:"none",logLevels:["error","warn","info","debug","log"]}).updateLogger=function(newLogger){if(newLogger)for(var i=0;i<this.logLevels.length;i+=1){var logLevel=theLogger.logLevels[i];theLogger[logLevel]="function"==typeof newLogger[logLevel]?utils_bind(newLogger[logLevel],newLogger):dontLog}},theLogger.updateLogger({}),theLogger);function dontLog(){}var requireConfig={requirePaths:{},getContentLayoutRequirePath:function(paths){var contentServer=paths.contentServer,baseRequirePath="object"==typeof paths.cacheBuster?paths.cacheBuster:{layoutKey:paths.cacheBuster,systemKey:paths.cacheBuster},layoutCacheBuster=baseRequirePath.layoutKey?"/"+baseRequirePath.layoutKey:"",systemCacheBuster=baseRequirePath.systemKey?"/"+baseRequirePath.systemKey:"";return this.requirePaths[contentServer]||((paths={})[(baseRequirePath="contentLayoutPath"+Math.floor(1e8+9e8*Math.random()))+"published"]=contentServer+"/_compdelivery"+layoutCacheBuster,paths[baseRequirePath+"draft"]=contentServer+"/_themes/_components"+layoutCacheBuster,paths[baseRequirePath+"system"]=contentServer+"/_sitescloud"+systemCacheBuster+"/sitebuilder/contentlayouts",this.requirePaths[contentServer]=baseRequirePath,requirejs.config({paths:paths})),this.requirePaths[contentServer]},preloadContentLayout:function(requireLayout,resolve,reject){require([requireLayout],function(){resolve()},function(err){logger.warn("ContentClient.renderLayout: Unable to render the layout. Ensure you can access the layout: If running against published content, that the layout has been published. If draft, that you are logged onto the Sites server"),reject("Failed to get layout: "+requireLayout+" with error: "+err)})},renderContentLayout:function(requireLayout,layoutParams,container,resolve,reject){require([requireLayout],function(renderPromise){renderPromise=new renderPromise(layoutParams).render(container);"object"==typeof renderPromise&&"function"==typeof renderPromise.then?renderPromise.then(function(){resolve()},function(errorStatus){reject(errorStatus)}):resolve()},function(err){logger.warn("ContentClient.renderLayout: Unable to render the layout. Ensure you can access the layout: If published, that the layout has been published. If draft, that you are logged onto the Sites server"),reject("failed to get layout: "+requireLayout+" with error: "+err)})}},RestAPINode=function(){function RestAPINode(args){Object.assign(this,args)}var _proto=RestAPINode.prototype;return _proto.extractServer=function(parsedURL){parsedURL=require("url").parse(parsedURL||"http://localhost");return parsedURL.protocol+"//"+parsedURL.hostname+(parsedURL.port?":"+parsedURL.port:"")},_proto.callRestServer=function(targetURL,restArgs){try{var self=this;logger.debug("_rest.callRestServer: Calling "+restArgs.method+" request with:"),logger.debug(targetURL),logger.debug(restArgs);var protocolCalls={"http:":require("http"),"https:":require("https")},url=null;isNodeJS&&(url=require("url"));var nodePromise=new Promise(function(resolve,reject){var restRequest,options=url.parse(targetURL),protocolCall=protocolCalls[options.protocol||"https:"],proxy="https:"===(options.protocol||"https:")?process.env.oce_https_proxy:process.env.oce_http_proxy;if(proxy)try{logger.debug("Using proxy: "+proxy);var HttpsProxyAgent=require("https-proxy-agent");logger.debug("Loaded proxy agent");var beforeSendOK=new HttpsProxyAgent(proxy);logger.debug("Using proxy: "+proxy+" connecting to "+targetURL),options.agent=beforeSendOK}catch(e){logger.warn("Could not initialize https-proxy-agent. Is the package installed in your application?. Making direct call to "+targetURL)}function requestResponse(response){var body="",responseStatus=response.statusCode;response.on("data",function(chunk){body+=chunk}),response.on("end",function(){if(200<=responseStatus&&responseStatus<300)try{var jsonResponse=JSON.parse(body);resolve(jsonResponse)}catch(e){reject({error:body})}else reject(response)})}var bodyString,beforeSendOK=function(currentOptions){return new Promise(function(bsResolve,bsReject){try{if("function"==typeof restArgs.beforeSend){var beforeSendResult=restArgs.beforeSend(currentOptions);if(beforeSendResult&&"function"==typeof beforeSendResult.then)return beforeSendResult.then(function(){return bsResolve(!0)}).catch(function(e){return bsReject({status:e,statusText:"Error in beforeSend() callback promise"})})}return bsResolve(!0)}catch(e){return bsReject({status:e,statusText:"Error in beforeSend() callback"})}})};options.method=restArgs.method.toUpperCase()||"","GET"===options.method&&targetURL?beforeSendOK(options).then(function(result){result&&(restRequest=protocolCall.get(options,requestResponse))}):"POST"===options.method&&restArgs.noCSRFToken&&restArgs.postData?(bodyString=JSON.stringify(restArgs.postData),options.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","Content-Length":bodyString.length},beforeSendOK(options).then(function(result){result&&(restRequest=protocolCall.request(options,requestResponse).write(bodyString))})):reject({error:"unsupported REST request: "+JSON.stringify(restArgs)}),restRequest&&(restRequest.on("error",function(error){reject({error:error})}),restRequest.on("socket",function(socket){socket.setTimeout(restArgs.timeout),socket.on("timeout",function(){reject({error:"request timed out after: "+restArgs.timeout})})}))});return Promise.resolve(nodePromise).then(function(response2){return"function"==typeof self.coerceData?self.coerceData(response2):Promise.resolve(response2)})}catch(e){return Promise.reject(e)}},RestAPINode}(),RestAPIBrowser=function(){function RestAPIBrowser(args){Object.assign(this,args)}var _proto2=RestAPIBrowser.prototype;return _proto2.extractServer=function(parsedURL){var contentServer=parsedURL||window.location&&window.location.href,parsedURL=document.createElement("a");return parsedURL.href=contentServer,parsedURL.protocol+"//"+parsedURL.hostname+(parsedURL.port?":"+parsedURL.port:"")},_proto2.callRestServer=function(targetURL,restArgs){try{var self=this;logger.debug("_rest.callRestServer: Calling "+restArgs.method+" request with:"),logger.debug(restArgs);var xmlHTTPPromise=new Promise(function(resolve,reject){var currentXHR,xhr=new XMLHttpRequest,xhrParams={method:restArgs.method&&restArgs.method.toUpperCase()||"",url:targetURL,timeout:restArgs.timeout,headers:{}},timeoutOverridden=!0;if(restArgs.authorization&&("published"===restArgs.contentType&&-1!==["session","anonymous"].indexOf(restArgs.authorization)||(xhrParams.headers={Authorization:restArgs.authorization})),"GET"===xhrParams.method&&xhrParams.url||("POST"===xhrParams.method&&xhrParams.url&&restArgs.noCSRFToken&&restArgs.postData?(xhrParams.headers["Content-Type"]="application/json; charset=UTF-8",xhrParams.headers["X-Requested-With"]="XMLHttpRequest",xhrParams.data=restArgs.postData):-1!==["POST","PUT"].indexOf(xhrParams.method)&&xhrParams.url&&restArgs.postData?(xhrParams.headers["Content-Type"]="application/json; charset=UTF-8",xhrParams.headers["X-Requested-With"]="XMLHttpRequest",xhrParams.headers["X-CSRF-Token"]=self.getCSRFToken(xhrParams.url),xhrParams.data=restArgs.postData):"DELETE"===xhrParams.method&&xhrParams.url?xhrParams.headers["X-CSRF-Token"]=self.getCSRFToken(xhrParams.url):(logger.error("_rest.callRestServer: invalid arguments:"),logger.error(restArgs),reject({status:400,statusText:'Expected to see arguments: { "method": "GET/POST/PUT/DELETE", "url": url } but recieved: '+JSON.stringify(restArgs)}),timeoutOverridden=!1)),timeoutOverridden){for(var header in xhr.onload=function(){200<=this.status&&this.status<300?resolve(JSON.parse(xhr.response||xhr.responseText)):reject({status:this.status,statusText:xhr.statusText})},xhr.onerror=function(){reject({status:this.status,statusText:xhr.statusText})},xhr.ontimeout=function(){reject({status:this.status,statusText:xhr.statusText})},xhr.open(xhrParams.method,xhrParams.url),xhrParams.headers)xhrParams.headers.hasOwnProperty(header)&&xhr.setRequestHeader(header,xhrParams.headers[header]);timeoutOverridden=Object.getOwnPropertyDescriptor(xhr,"timeout");void 0!==timeoutOverridden&&!timeoutOverridden.writable||(xhr.timeout=xhrParams.timeout),currentXHR=xhr,new Promise(function(bsResolve,bsReject){try{if("function"==typeof restArgs.beforeSend){var beforeSendResult=restArgs.beforeSend(currentXHR);if(beforeSendResult&&"function"==typeof beforeSendResult.then)return beforeSendResult.then(function(){return bsResolve(!0)}).catch(function(e){return bsReject({status:e,statusText:"Error in beforeSend() callback promise"})})}return bsResolve(!0)}catch(e){return bsReject({status:e,statusText:"Error in beforeSend() callback"})}}).then(function(result){result&&(xhrParams.data?xhr.send(JSON.stringify(xhrParams.data)):xhr.send())})}});return Promise.resolve(xmlHTTPPromise).then(function(response){return"function"==typeof self.coerceData?self.coerceData(response):Promise.resolve(response)})}catch(e){return Promise.reject(e)}},RestAPIBrowser}(),ContentAPIConfiguration={contextRoot:"/content",defaultVersion:"v1",supportedVersions:[{semanticVersion:"1.0.0",contentVersion:"v1"},{semanticVersion:"1.1.0",contentVersion:"v1.1"}],state:{published:"published",draft:"management"}},ContentAPI=function(){function ContentAPI(){this.restAPI=new(isNodeJS?RestAPINode:RestAPIBrowser)(ContentAPIConfiguration)}var _proto3=ContentAPI.prototype;return _proto3.extractServer=function(contentServerURL){return this.restAPI.extractServer(contentServerURL)},_proto3.callRestServer=function(targetURL,restArgs){try{return Promise.resolve(this.restAPI.callRestServer(targetURL,restArgs))}catch(e){return Promise.reject(e)}},ContentAPI.getContentVersion=function(caller,requestedVersion){for(var parsedVersion=/\s*((([<>]?=?)\s*(v)?([0-9]+)(\.([0-9]+))?(\.([0-9]+))?))\s*/g.exec(requestedVersion||"0.0.0")||[],semanticVersion=(parsedVersion[5]||"0")+"."+(parsedVersion[7]||"0")+"."+(parsedVersion[9]||"0"),i=0;i<ContentAPIConfiguration.supportedVersions.length;i+=1)if(ContentAPIConfiguration.supportedVersions[i].semanticVersion===semanticVersion)return ContentAPIConfiguration.supportedVersions[i].contentVersion;return logger.warn('Content SDK: "'+caller+'" has unrecognized Content Version: "'+requestedVersion+'" - defaulting to: version="'+this.defaultVersion+'". To avoid this message, use one of the supported versions when creating a content client: '+JSON.stringify(this.supportedVersions)),this.defaultVersion},_proto3.getCSRFToken=function(){return"CSRFToken"},_proto3.createPrefix=function(args){return args.contentServer+ContentAPIConfiguration.contextRoot+"/"+ContentAPIConfiguration.state[args.contentType]+"/api/"+this.contentVersion},_proto3.createSuffix=function(cacheBuster){var search=cacheBuster.search||"",channelToken=cacheBuster.channelToken?this.properties.tokenName+"="+cacheBuster.channelToken:"",suffix="object"==typeof cacheBuster.cacheBuster?cacheBuster.cacheBuster.contentKey:cacheBuster.cacheBuster,cacheBuster=suffix?"cb="+suffix:"",suffix="";return suffix+=search,suffix+=(suffix&&channelToken?"&":"")+channelToken,suffix+=(suffix&&cacheBuster?"&":"")+cacheBuster},_proto3.formatURL=function(path,url){var prefix=this.createPrefix(url),url=this.createSuffix(url),url=prefix+path+(url?(-1===path.indexOf("?")?"?":"&")+url:"");return logger.info(url),url},_proto3.resolveGetTypesPath=function(){return"/types"},_proto3.resolveGetTypePath=function(args){return"/types/"+args.typeName},_proto3.isDigitalAsset=function(id){return/^DigitalAsset_/i.test(id)||36===id.length&&(/^CONT/.test(id)||/^CORE/.test(id))},_proto3.getRenditionURL=function(itemGUID,type,restArgs){var format,download,cacheBusterValue,joinChar,digitalAssets,url="";return itemGUID&&(this.isDigitalAsset(itemGUID)?(format=restArgs.format,download=restArgs.download,cacheBusterValue="object"==typeof restArgs.cacheBuster?restArgs.cacheBuster.contentKey:restArgs.cacheBuster,joinChar="?",digitalAssets=restArgs.secureContent?this.properties.secureAssetURLName:this.properties.assetURLName,type=type||this.properties.digitalAssetDefault,url=this.createPrefix(restArgs)+"/"+digitalAssets+"/"+itemGUID+"/"+type,cacheBusterValue&&(url+=joinChar+"cb="+cacheBusterValue,joinChar="&"),format&&(url+=joinChar+"format="+format,joinChar="&"),download&&(url+=joinChar+"download=true",joinChar="&"),"published"===restArgs.contentType&&restArgs.channelToken&&(url+=joinChar+this.properties.tokenName+"="+restArgs.channelToken,joinChar="&")):url=restArgs.contentServer+"/documents/file/"+itemGUID),logger.info(url),url},_proto3.makeQueryParameters=function(search){var queryParams=utils_extend({},search),searchParams={postData:{},getData:"",assetVersion:""},parameters="",search=queryParams.search;delete queryParams.ids,delete queryParams.IDs,delete queryParams.id,delete queryParams.ID,delete queryParams.itemGUID,delete queryParams.itemGUIDs,delete queryParams.slug,delete queryParams.timeout,delete queryParams.search,delete queryParams.types,delete queryParams.beforeSend,delete queryParams.contentType,delete queryParams.language;var property,order,propVal,separator="";for(property in queryParams)queryParams.hasOwnProperty(property)&&property===encodeURI(property)&&(propVal=queryParams[property],"orderBy"===property&&Array.isArray(propVal)&&1===propVal.length&&(order=propVal[0].order&&propVal[0].order.toLowerCase()||"",propVal=propVal[0].name+(order?":"+("des"===order?"desc":order):"")),"expand"!==property&&("version"===property?void 0!==propVal&&propVal&&(searchParams.assetVersion=propVal):"object"!=typeof propVal&&(parameters+=separator+property+"="+encodeURI(propVal),separator="&")));return parameters+=search?separator+search:"",searchParams.method="GET",searchParams.getData=parameters,searchParams.useAggregate=queryParams.itemDepth||queryParams.expand,searchParams},ContentAPI}(),ContentApiV11Impl=function(_ContentApiV1Impl){function ContentApiV11Impl(contentVersion){var _this8=_ContentApiV1Impl.call(this)||this;return contentVersion&&(_this8.requestedContentVersion=contentVersion),_this8.contentVersion="v1.1",_this8.properties={tokenName:"channelToken",digitalAssetDefault:"native",assetURLName:"assets",secureAssetURLName:"assets"},_this8}_inheritsLoose(ContentApiV11Impl,_ContentApiV1Impl);var _proto5=ContentApiV11Impl.prototype;return _proto5.resolveGetItemListPath=function(args){var itemListURL="/items",joinChar="?";return args.types&&(itemListURL+=joinChar+"field:type:equals="+args.types,joinChar="&"),args.useAggregate&&(itemListURL+=joinChar+'expand="all"',joinChar="&"),itemListURL},_proto5.resolveGetItemPath=function(args){var language=args.language?"/variations/language/"+args.language+"?fields=all":"",aggregate=args.useAggregate?(language?"&":"?")+"expand="+args.useAggregate:"",slug=args.slug?".by.slug/"+args.slug:"",versionStr="";return language||""!==args.assetVersion&&(versionStr="/versions/"+args.assetVersion),args.itemGUID?"/items/"+args.itemGUID+versionStr+language+aggregate:"/items/"+slug+versionStr+language+aggregate},_proto5.resolveQueryTaxonomyCategoriesPath=function(args){return"/taxonomies/"+args.taxonomyGUID+"/categories"},_proto5.resolveGetTaxonomiesPath=function(){return"/taxonomies"},_proto5.resolveGetRecommendationPath=function(args){return args.id?"/personalization/recommendationResults/.by.id/"+args.id:"/personalization/recommendationResults/"+args.apiName},_proto5.resolveSearchPath=function(){return"/items"},_proto5.resolveGetBulkItemListPath=function(languageQuery){var idQuery='(id eq "'+languageQuery.itemGUIDs.join('" or id eq "')+'")',languageQuery=languageQuery.language?'(language eq "'+languageQuery.language+'")':"";return"/items?q="+(languageQuery?"("+idQuery+" and "+languageQuery+")":idQuery)},_proto5.coerceData=function(response){var self=this;return new Promise(function(resolve){return"v1"===self.requestedContentVersion&&("object"==typeof response.fields?response.data||(response.data=response.fields):Array.isArray(response.items)&&response.items.forEach(function(item){"object"!=typeof item.fields||item.data||(item.data=item.fields)})),resolve(response)})},ContentApiV11Impl}(function(_ContentAPI){function ContentApiV1Impl(){var _this7=_ContentAPI.call(this)||this;return _this7.contentVersion="v1",_this7.properties={tokenName:"access-token",digitalAssetDefault:"default",assetURLName:"digital-assets",secureAssetURLName:"secure-digital-assets"},_this7}_inheritsLoose(ContentApiV1Impl,_ContentAPI);var _proto4=ContentApiV1Impl.prototype;return _proto4.resolveGetItemListPath=function(args){return"/items"+(args.useAggregate?"/aggregate":"")+(args.types?"?field:type:equals="+args.types:"")},_proto4.resolveGetItemPath=function(args){return"/items/"+args.itemGUID+(args.useAggregate?"/aggregate":"")},_proto4.resolveSearchPath=function(){return"/items/queries"},_proto4.resolveGetBulkItemListPath=function(args){return"/items/bulk"+(args.useAggregate?"/aggregate":"")+"?ids="+args.itemGUIDs.join(",")},ContentApiV1Impl}(ContentAPI)),restAPIFactory_createRestAPI=function(contentVersion){return"v1"===ContentAPI.getContentVersion("ContentSDK create content client",contentVersion)?new ContentApiV11Impl("v1"):new ContentApiV11Impl},ContentDeliveryClientImpl=function(){function ContentDeliveryClientImpl(args){this.restAPI=restAPIFactory_createRestAPI(args.contentVersion),logger.updateLogger(args.logger),this.info={accessToken:args.channelToken||args.accessToken,channelToken:args.channelToken||args.accessToken,cacheBuster:args.cacheBuster,beforeSend:args.beforeSend,clientType:"delivery",contentServer:this.restAPI.extractServer(args.contentServer),contentType:"published",secureContent:args.secureContent||!1,timeout:args.timeout||0,contentVersion:this.restAPI.requestedContentVersion||this.restAPI.contentVersion},this.isCompiler=args.isCompiler,this.info.authorization=args.authorization,this.validContentTypes=["published"],this.validLayoutTypes=this.validContentTypes,this.publicSDK={getInfo:utils_bind(this.getInfo,this),getItem:utils_bind(this.getItem,this),getItems:utils_bind(this.getItems,this),searchItems:utils_bind(this.queryItems,this),queryItems:utils_bind(this.queryItems,this),getRenditionURL:utils_bind(this.getRenditionURL,this),getLayoutInfo:utils_bind(this.getLayoutInfo,this),getRecommendationResults:utils_bind(this.getRecommendationResults,this),loadContentLayout:utils_bind(this.loadContentLayout,this),renderItem:utils_bind(this.renderItem,this),expandMacros:utils_bind(this.expandMacros,this),getTaxonomies:utils_bind(this.getTaxonomies,this),queryTaxonomyCategories:utils_bind(this.queryTaxonomyCategories,this)},logger.debug("ContentClient.create: Content Info:"),logger.debug(this.info)}var _proto6=ContentDeliveryClientImpl.prototype;return _proto6.resolveRESTArgs=function(method,args){var searchParams=this.restAPI.makeQueryParameters(args),restArgs=utils_extend({},this.info);return restArgs.method=method,restArgs.contentType=this.getContentType(args.contentType),restArgs.authorization=this.getInfo().authorization,restArgs.language=args.language,restArgs.beforeSend=args.beforeSend||restArgs.beforeSend,restArgs.timeout=args.timeout||restArgs.timeout,restArgs.postData=searchParams.postData,restArgs.useAggregate=searchParams.useAggregate,restArgs.assetVersion=searchParams.assetVersion,restArgs.search=searchParams.getData,args.format&&(restArgs.format=args.format),args.download&&(restArgs.download=args.download),"GET"===restArgs.method&&(restArgs.method=searchParams.method||restArgs.method),restArgs},_proto6.getContentType=function(contentType){var requestedType="string"==typeof contentType&&contentType.toLowerCase()||this.info.contentType;return-1!==this.validContentTypes.indexOf(requestedType)?requestedType:(logger.warn("Invalid value for content type request: "+contentType+". Allowed values are: "+JSON.stringify(this.validContentTypes)+". Defaulting to: "+this.info.contentType),this.info.contentType)},_proto6.getLayoutType=function(layoutType){var requestedType="string"==typeof layoutType&&layoutType.toLowerCase()||this.info.contentType;return-1!==this.validLayoutTypes.indexOf(requestedType)?requestedType:(logger.warn("Invalid value for layout type request: "+layoutType+". Allowed values are: "+JSON.stringify(this.validLayoutTypes)+". Defaulting to: "+this.info.contentType),this.info.contentType)},_proto6.renderLayout=function(requireLayout,layoutParams,container,preLoadLayout,resolve,reject){isNodeJS?reject({error:"renderLayout function not supported under NodeJS"}):preLoadLayout?requireConfig.preloadContentLayout(requireLayout,resolve,reject):((layoutParams=utils_extend({},layoutParams)).contentClient||(layoutParams.contentClient=this.publicSDK),requireConfig.renderContentLayout(requireLayout,layoutParams,container,resolve,reject))},_proto6.getInfo=function(){return utils_extend({},this.info)},_proto6.getItem=function(url){var restCallArgs=url||{},guid=restCallArgs.id||restCallArgs.ID||restCallArgs.itemGUID,restCallArgs=this.resolveRESTArgs("GET",restCallArgs),url=this.restAPI.formatURL(this.restAPI.resolveGetItemPath({itemGUID:guid,assetVersion:restCallArgs.assetVersion,useAggregate:restCallArgs.useAggregate,language:url.language,slug:url.slug}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getRecommendationResults=function(params){var restCallArgs,assetState=params||{},id=assetState.id||assetState.ID||assetState.itemGUID,url=assetState.apiName;"published"===(params.contentType||this.info.contentType)?(restCallArgs=this.resolveRESTArgs("GET",assetState),params.audienceAttributes&&Object.keys(params.audienceAttributes).forEach(function(audienceAttributeName){var queryParam=params.audienceAttributes[audienceAttributeName],queryParam=(queryParam=!Array.isArray(queryParam)?[queryParam]:queryParam).map(function(value){return encodeURIComponent("attribute."+audienceAttributeName)+"="+encodeURIComponent(value)}).join("&");restCallArgs.search?restCallArgs.search=restCallArgs.search+"&"+queryParam:restCallArgs.search=queryParam})):((restCallArgs=this.resolveRESTArgs("POST",assetState)).noCSRFToken=!0,assetState="published"===this.info.contentType?"PUBLISHED":"ALL",params.audienceAttributes&&(restCallArgs.postData={audienceAttributes:params.audienceAttributes,assetState:assetState}));url=this.restAPI.formatURL(this.restAPI.resolveGetRecommendationPath({id:id,apiName:url}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getItems=function(params){var url,self=this,args=params||{},guids=args.ids||args.IDs||args.itemGUIDs,restCallArgs=self.resolveRESTArgs("GET",args);if(logger.debug("ContentClient.getItems: arguments"),logger.debug(args),Array.isArray(guids)&&0<guids.length){var chunkGUIDs,length=guids.length,bulkChunks=[];return new Promise(function(resolve,reject){for(var i=0;i<length;i+=10)chunkGUIDs=guids.slice(i,i+10),url=self.restAPI.formatURL(self.restAPI.resolveGetBulkItemListPath({itemGUIDs:chunkGUIDs,types:args.types,useAggregate:restCallArgs.useAggregate,language:restCallArgs.language}),restCallArgs),bulkChunks.push(self.restAPI.callRestServer(url,restCallArgs));Promise.all(bulkChunks).then(function(arrayOfResults){var allContentItems={items:[]};"v1"===self.info.contentVersion?(allContentItems.items={},arrayOfResults.forEach(function(results){results&&results.items&&(allContentItems.items=utils_extend(allContentItems.items,results.items))})):arrayOfResults.forEach(function(results){allContentItems.items=allContentItems.items.concat(results.items)}),resolve(allContentItems)},function(err){reject(err)})})}return url=self.restAPI.formatURL(self.restAPI.resolveGetItemListPath({itemGUID:args.itemGUID,types:args.types,useAggregate:restCallArgs.useAggregate}),restCallArgs),self.restAPI.callRestServer(url,restCallArgs)},_proto6.queryItems=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url);logger.debug("ContentClient.queryItems: arguments"),logger.debug(url),restCallArgs.noCSRFToken=!0;url=this.restAPI.formatURL(this.restAPI.resolveSearchPath(),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.queryTaxonomyCategories=function(url){var restCallArgs=url||{},url=restCallArgs.id||restCallArgs.ID||restCallArgs.itemGUID,restCallArgs=this.resolveRESTArgs("GET",restCallArgs),url=this.restAPI.formatURL(this.restAPI.resolveQueryTaxonomyCategoriesPath({taxonomyGUID:url}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getTaxonomies=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url),url=this.restAPI.formatURL(this.restAPI.resolveGetTaxonomiesPath(url),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getRenditionURL=function(restCallArgs){var args=restCallArgs||{},guid=args.id||args.ID||args.itemGUID,restCallArgs=this.resolveRESTArgs("GET",args);return this.isCompiler?"[!--$SCS_DIGITAL_ASSET--]"+guid+"[/!--$SCS_DIGITAL_ASSET--]":this.restAPI.getRenditionURL(guid,args.type,restCallArgs)},_proto6.getLayoutInfo=function(params){var layoutType,layoutFactory,self=this,args=params||{},isSystemLayout=-1<["system-default-layout","system-tile-layout"].indexOf(args.layout);return new Promise(function(resolve,reject){var requireLayout;args.layout?(layoutFactory=isSystemLayout?(layoutType="system",args.layout):(layoutType=self.getLayoutType(args.layoutType),args.layout+"/assets/render"),requireLayout=requireConfig.getContentLayoutRequirePath(self.info)+layoutType+"/"+layoutFactory,logger.debug("ContentClient.getLayoutInfo: require path: "+requireLayout),require([requireLayout],function(layoutContentVersion){layoutContentVersion=layoutContentVersion.prototype.contentVersion;layoutContentVersion||(logger.warn('Content Layout: "'+args.layout+'" does not have a contentVersion specified. Assuming data needs to be fetched in "v1.0" format for this Content Layout. To avoid this message, add the prototype.contentVersion property to the Content Layout Factory object.'),layoutContentVersion="1.0.0"),resolve({name:args.layout,layoutFactory:layoutFactory,layoutType:layoutType,requirePath:requireLayout,contentVersion:layoutContentVersion})})):(logger.debug("ContentClient.getLayoutInfo: missing required parameters"),reject("missing parameters in call to getLayoutInfo: "+JSON.stringify(args)))})},_proto6.loadContentLayout=function(params){var layoutType,layoutFactory,self=this,args=params||{},isSystemLayout=-1<["system-default-layout","system-tile-layout"].indexOf(args.layout);return new Promise(function(resolve,reject){var requireLayout;args.layout?(layoutFactory=isSystemLayout?(layoutType="system",args.layout):(layoutType=self.getLayoutType(args.layoutType),args.layout+"/assets/render"),requireLayout=requireConfig.getContentLayoutRequirePath(self.info)+layoutType+"/"+layoutFactory,logger.debug("ContentClient.renderItem: require path: "+requireLayout),require([requireLayout],function(ContentLayout){resolve(ContentLayout)})):(logger.debug("ContentClient.renderItem: missing required parameters"),reject("missing parameters in call to renderLayout: "+JSON.stringify(args)))})},_proto6.renderItem=function(params){var layoutType,layoutFactory,self=this,args=params||{},isSystemLayout=-1<["system-default-layout","system-tile-layout"].indexOf(args.layout);return new Promise(function(resolve,reject){var requireLayout;args.layout?(layoutFactory=isSystemLayout?(layoutType="system",args.layout):(layoutType=self.getLayoutType(args.layoutType),args.layout+"/assets/render"),requireLayout=requireConfig.getContentLayoutRequirePath(self.info)+layoutType+"/"+layoutFactory,logger.debug("ContentClient.renderItem: require path: "+requireLayout),self.renderLayout(requireLayout,args.data,args.container,args.preloadLayout,resolve,reject)):(logger.debug("ContentClient.renderItem: missing required parameters"),reject("missing parameters in call to renderLayout: "+JSON.stringify(args)))})},_proto6.expandMacros=function(fieldValue){var afterValue=fieldValue||"";logger.log("expandMacros: beforeValue: "+fieldValue);var macros=[{name:"DIGITAL_ASSET",macro:/\[!--\$CEC_DIGITAL_ASSET--\]*(.*?) *\[\/!--\$CEC_DIGITAL_ASSET--\]/g,value:utils_bind(function(matchString,idStrParts){var assetId=idStrParts,isDownload=!1;return idStrParts.indexOf(",")&&(assetId=(idStrParts=idStrParts.split(","))[0],isDownload="true"===idStrParts[1]),this.getRenditionURL({id:assetId,download:isDownload})},this)},{name:"PAGE_LINK",macro:/\[!--\$SCS_PAGE--\]*(.*?) *\[\/!--\$SCS_PAGE--\]/g,value:utils_bind(function(matchString,page){var pageId,renderApi=window&&window.SCSRenderAPI||{};return"function"==typeof renderApi.getPageLinkData?pageId=(pageId=renderApi.getPageLinkData(page))&&pageId.href:"function"==typeof renderApi.getPageLinkUrl&&(pageId=renderApi.getPageLinkUrl(page)),pageId||"#"},this)}];this.isCompiler&&(macros=[]);afterValue=function expandField(obj){var expandedString,expandedValue=obj;return"string"==typeof obj?(expandedString=obj,macros.forEach(function(macroEntry){expandedString=expandedString.replace(macroEntry.macro,macroEntry.value)}),expandedValue=expandedString):obj&&"object"==typeof obj&&(Array.isArray(obj)?expandedValue=obj.map(expandField):(expandedValue={},Object.keys(obj).forEach(function(key){expandedValue[key]=expandField(obj[key])}))),expandedValue}(afterValue);return logger.log("expandMacros: afterValue: "+afterValue),afterValue},ContentDeliveryClientImpl}(),ContentPreviewClientImpl=function(_ContentDeliveryClien){function ContentPreviewClientImpl(args){var _this9=_ContentDeliveryClien.call(this,args)||this;return _this9.restAPI=restAPIFactory_createRestAPI(args.contentVersion),logger.updateLogger(args.logger),_this9.info={accessToken:args.channelToken||args.accessToken,channelToken:args.channelToken||args.accessToken,beforeSend:args.beforeSend,cacheBuster:args.cacheBuster,clientType:"preview",contentServer:_this9.restAPI.extractServer(args.contentServer),contentType:args.contentType&&"published"===args.contentType.toLowerCase()?"published":"draft",secureContent:args.secureContent||!1,timeout:args.timeout||0,contentVersion:_this9.restAPI.requestedContentVersion||_this9.restAPI.contentVersion},_this9.isCompiler=args.isCompiler,_this9.info.authorization=args.authorization,_this9.validContentTypes=["published","draft"],_this9.validLayoutTypes=_this9.validContentTypes,_this9.publicSDK={getInfo:utils_bind(_this9.getInfo,_assertThisInitialized(_this9)),getItem:utils_bind(_this9.getItem,_assertThisInitialized(_this9)),getItems:utils_bind(_this9.getItems,_assertThisInitialized(_this9)),searchItems:utils_bind(_this9.queryItems,_assertThisInitialized(_this9)),queryItems:utils_bind(_this9.queryItems,_assertThisInitialized(_this9)),getRenditionURL:utils_bind(_this9.getRenditionURL,_assertThisInitialized(_this9)),getLayoutInfo:utils_bind(_this9.getLayoutInfo,_assertThisInitialized(_this9)),getRecommendationResults:utils_bind(_this9.getRecommendationResults,_assertThisInitialized(_this9)),loadContentLayout:utils_bind(_this9.loadContentLayout,_assertThisInitialized(_this9)),renderItem:utils_bind(_this9.renderItem,_assertThisInitialized(_this9)),expandMacros:utils_bind(_this9.expandMacros,_assertThisInitialized(_this9)),getTypes:utils_bind(_this9.getTypes,_assertThisInitialized(_this9)),getType:utils_bind(_this9.getType,_assertThisInitialized(_this9)),getTaxonomies:utils_bind(_this9.queryTaxonomies,_assertThisInitialized(_this9)),queryTaxonomies:utils_bind(_this9.queryTaxonomies,_assertThisInitialized(_this9)),queryTaxonomyCategories:utils_bind(_this9.queryTaxonomyCategories,_assertThisInitialized(_this9))},logger.debug("ContentClient.create: Content Info:"),logger.debug(_this9.info),_this9}_inheritsLoose(ContentPreviewClientImpl,_ContentDeliveryClien);var _proto7=ContentPreviewClientImpl.prototype;return _proto7.getTypes=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url);logger.debug("ContentClient.getTypes: arguments"),logger.debug(url);url=this.restAPI.formatURL(this.restAPI.resolveGetTypesPath(),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto7.getType=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url);logger.debug("ContentClient.getType: arguments"),logger.debug(url);url=this.restAPI.formatURL(this.restAPI.resolveGetTypePath({typeName:url.typeName}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto7.queryTaxonomies=function(params){return this.getTaxonomies(params)},ContentPreviewClientImpl}(ContentDeliveryClientImpl),contentSDK=function(){function contentSDK(){}return contentSDK.createDeliveryClient=function(newSDK){newSDK=new ContentDeliveryClientImpl("object"==typeof newSDK?newSDK:{});return logger.debug("ContentSDK.createDelivery: created new Content SDK client object:"),logger.debug(newSDK),newSDK?newSDK.publicSDK:void 0},contentSDK.createPreviewClient=function(newSDK){newSDK=new ContentPreviewClientImpl("object"==typeof newSDK?newSDK:{});return logger.debug("ContentSDK.createPreviewClient: created new Content SDK client object:"),logger.debug(newSDK),newSDK?newSDK.publicSDK:void 0},contentSDK}();exports.contentSDK=contentSDK,exports.createDeliveryClient=function(param){return contentSDK.createDeliveryClient(param)},exports.createPreviewClient=function(param){return contentSDK.createPreviewClient(param)}});
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global=global||self).contentManagementSdk={})}(this,function(exports){function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),_setPrototypeOf(subClass.prototype.constructor=subClass,superClass)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o})(o,p)}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}var theLogger,isNodeJS="undefined"==typeof window&&"object"==typeof process,utils_bind=function(func,owner){return function(){return func.apply(owner,[].slice.call(arguments))}},utils_extend=function(dest,orig){for(var prop in orig)orig.hasOwnProperty(prop)&&(dest[prop]=orig[prop]);return dest},logger=((theLogger={logLevel:"none",logLevels:["error","warn","info","debug","log"]}).updateLogger=function(newLogger){if(newLogger)for(var i=0;i<this.logLevels.length;i+=1){var logLevel=theLogger.logLevels[i];theLogger[logLevel]="function"==typeof newLogger[logLevel]?utils_bind(newLogger[logLevel],newLogger):dontLog}},theLogger.updateLogger({}),theLogger);function dontLog(){}var requireConfig={requirePaths:{},getContentLayoutRequirePath:function(paths){var contentServer=paths.contentServer,baseRequirePath="object"==typeof paths.cacheBuster?paths.cacheBuster:{layoutKey:paths.cacheBuster,systemKey:paths.cacheBuster},layoutCacheBuster=baseRequirePath.layoutKey?"/"+baseRequirePath.layoutKey:"",systemCacheBuster=baseRequirePath.systemKey?"/"+baseRequirePath.systemKey:"";return this.requirePaths[contentServer]||((paths={})[(baseRequirePath="contentLayoutPath"+Math.floor(1e8+9e8*Math.random()))+"published"]=contentServer+"/_compdelivery"+layoutCacheBuster,paths[baseRequirePath+"draft"]=contentServer+"/_themes/_components"+layoutCacheBuster,paths[baseRequirePath+"system"]=contentServer+"/_sitescloud"+systemCacheBuster+"/sitebuilder/contentlayouts",this.requirePaths[contentServer]=baseRequirePath,requirejs.config({paths:paths})),this.requirePaths[contentServer]},preloadContentLayout:function(requireLayout,resolve,reject){require([requireLayout],function(){resolve()},function(err){logger.warn("ContentClient.renderLayout: Unable to render the layout. Ensure you can access the layout: If running against published content, that the layout has been published. If draft, that you are logged onto the Sites server"),reject("Failed to get layout: "+requireLayout+" with error: "+err)})},renderContentLayout:function(requireLayout,layoutParams,container,resolve,reject){require([requireLayout],function(renderPromise){renderPromise=new renderPromise(layoutParams).render(container);"object"==typeof renderPromise&&"function"==typeof renderPromise.then?renderPromise.then(function(){resolve()},function(errorStatus){reject(errorStatus)}):resolve()},function(err){logger.warn("ContentClient.renderLayout: Unable to render the layout. Ensure you can access the layout: If published, that the layout has been published. If draft, that you are logged onto the Sites server"),reject("failed to get layout: "+requireLayout+" with error: "+err)})}},RestAPINode=function(){function RestAPINode(args){Object.assign(this,args)}var _proto=RestAPINode.prototype;return _proto.extractServer=function(parsedURL){parsedURL=require("url").parse(parsedURL||"http://localhost");return parsedURL.protocol+"//"+parsedURL.hostname+(parsedURL.port?":"+parsedURL.port:"")},_proto.callRestServer=function(targetURL,restArgs){try{var self=this;logger.debug("_rest.callRestServer: Calling "+restArgs.method+" request with:"),logger.debug(targetURL),logger.debug(restArgs);var protocolCalls={"http:":require("http"),"https:":require("https")},url=null;isNodeJS&&(url=require("url"));var nodePromise=new Promise(function(resolve,reject){var restRequest,options=url.parse(targetURL),protocolCall=protocolCalls[options.protocol||"https:"],proxy="https:"===(options.protocol||"https:")?process.env.oce_https_proxy:process.env.oce_http_proxy;if(proxy)try{logger.debug("Using proxy: "+proxy);var HttpsProxyAgent=require("https-proxy-agent");logger.debug("Loaded proxy agent");var beforeSendOK=new HttpsProxyAgent(proxy);logger.debug("Using proxy: "+proxy+" connecting to "+targetURL),options.agent=beforeSendOK}catch(e){logger.warn("Could not initialize https-proxy-agent. Is the package installed in your application?. Making direct call to "+targetURL)}function requestResponse(response){var body="",responseStatus=response.statusCode;response.on("data",function(chunk){body+=chunk}),response.on("end",function(){if(200<=responseStatus&&responseStatus<300)try{var jsonResponse=JSON.parse(body);resolve(jsonResponse)}catch(e){reject({error:body})}else reject(response)})}var bodyString,beforeSendOK=function(currentOptions){return new Promise(function(bsResolve,bsReject){try{if("function"!=typeof restArgs.beforeSend)return bsResolve(!0);var beforeSendResult=restArgs.beforeSend(currentOptions);return beforeSendResult&&"function"==typeof beforeSendResult.then?beforeSendResult.then(function(){return bsResolve(beforeSendResult)}).catch(function(e){return bsReject({status:e,statusText:"Error in beforeSend() callback promise"})}):bsResolve(void 0===beforeSendResult||beforeSendResult)}catch(e){return bsReject({status:e,statusText:"Error in beforeSend() callback"})}})};options.method=restArgs.method.toUpperCase()||"","GET"===options.method&&targetURL?beforeSendOK(options).then(function(result){result?restRequest=protocolCall.get(options,requestResponse):(logger.debug("Call aborted by beforeSend"),reject({error:"call aborted by beforeSend()"}))}):"POST"===options.method&&restArgs.noCSRFToken&&restArgs.postData?(bodyString=JSON.stringify(restArgs.postData),options.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","Content-Length":bodyString.length},beforeSendOK(options).then(function(result){result?restRequest=protocolCall.request(options,requestResponse).write(bodyString):(logger.debug("Call aborted by beforeSend"),reject({error:"call aborted by beforeSend()"}))})):reject({error:"unsupported REST request: "+JSON.stringify(restArgs)}),restRequest?(restRequest.on("error",function(error){reject({error:error})}),restRequest.on("socket",function(socket){socket.setTimeout(restArgs.timeout),socket.on("timeout",function(){reject({error:"request timed out after: "+restArgs.timeout})})})):logger.debug("no restRequest")});return Promise.resolve(nodePromise).then(function(response2){return"function"==typeof self.coerceData?self.coerceData(response2):Promise.resolve(response2)})}catch(e){return Promise.reject(e)}},RestAPINode}(),RestAPIBrowser=function(){function RestAPIBrowser(args){Object.assign(this,args)}var _proto2=RestAPIBrowser.prototype;return _proto2.extractServer=function(parsedURL){var contentServer=parsedURL||window.location&&window.location.href,parsedURL=document.createElement("a");return parsedURL.href=contentServer,parsedURL.protocol+"//"+parsedURL.hostname+(parsedURL.port?":"+parsedURL.port:"")},_proto2.callRestServer=function(targetURL,restArgs){try{var self=this;logger.debug("_rest.callRestServer: Calling "+restArgs.method+" request with:"),logger.debug(restArgs);var xmlHTTPPromise=new Promise(function(resolve,reject){var currentXHR,xhr=new XMLHttpRequest,xhrParams={method:restArgs.method&&restArgs.method.toUpperCase()||"",url:targetURL,timeout:restArgs.timeout,headers:{}},timeoutOverridden=!0;if(restArgs.authorization&&("published"===restArgs.contentType&&-1!==["session","anonymous"].indexOf(restArgs.authorization)||(xhrParams.headers={Authorization:restArgs.authorization})),"GET"===xhrParams.method&&xhrParams.url||("POST"===xhrParams.method&&xhrParams.url&&restArgs.noCSRFToken&&restArgs.postData?(xhrParams.headers["Content-Type"]="application/json; charset=UTF-8",xhrParams.headers["X-Requested-With"]="XMLHttpRequest",xhrParams.data=restArgs.postData):-1!==["POST","PUT"].indexOf(xhrParams.method)&&xhrParams.url&&restArgs.postData?(xhrParams.headers["Content-Type"]="application/json; charset=UTF-8",xhrParams.headers["X-Requested-With"]="XMLHttpRequest",xhrParams.headers["X-CSRF-Token"]=self.getCSRFToken(xhrParams.url),xhrParams.data=restArgs.postData):"DELETE"===xhrParams.method&&xhrParams.url?xhrParams.headers["X-CSRF-Token"]=self.getCSRFToken(xhrParams.url):(logger.error("_rest.callRestServer: invalid arguments:"),logger.error(restArgs),reject({status:400,statusText:'Expected to see arguments: { "method": "GET/POST/PUT/DELETE", "url": url } but recieved: '+JSON.stringify(restArgs)}),timeoutOverridden=!1)),timeoutOverridden){for(var header in xhr.onload=function(){200<=this.status&&this.status<300?resolve(JSON.parse(xhr.response||xhr.responseText)):reject({status:this.status,statusText:xhr.statusText})},xhr.onerror=function(){reject({status:this.status,statusText:xhr.statusText})},xhr.ontimeout=function(){reject({status:this.status,statusText:xhr.statusText})},xhr.open(xhrParams.method,xhrParams.url),xhrParams.headers)xhrParams.headers.hasOwnProperty(header)&&xhr.setRequestHeader(header,xhrParams.headers[header]);timeoutOverridden=Object.getOwnPropertyDescriptor(xhr,"timeout");void 0!==timeoutOverridden&&!timeoutOverridden.writable||(xhr.timeout=xhrParams.timeout),currentXHR=xhr,new Promise(function(bsResolve,bsReject){try{if("function"!=typeof restArgs.beforeSend)return bsResolve(!0);var beforeSendResult=restArgs.beforeSend(currentXHR);return beforeSendResult&&"function"==typeof beforeSendResult.then?beforeSendResult.then(function(){return bsResolve(beforeSendResult)}).catch(function(e){return bsReject({status:e,statusText:"Error in beforeSend() callback promise"})}):bsResolve(void 0===beforeSendResult||beforeSendResult)}catch(e){return bsReject({status:e,statusText:"Error in beforeSend() callback"})}}).then(function(result){result&&(xhrParams.data?xhr.send(JSON.stringify(xhrParams.data)):xhr.send())})}});return Promise.resolve(xmlHTTPPromise).then(function(response){return"function"==typeof self.coerceData?self.coerceData(response):Promise.resolve(response)})}catch(e){return Promise.reject(e)}},RestAPIBrowser}(),ContentAPIConfiguration={contextRoot:"/content",defaultVersion:"v1",supportedVersions:[{semanticVersion:"1.0.0",contentVersion:"v1"},{semanticVersion:"1.1.0",contentVersion:"v1.1"}],state:{published:"published",draft:"management"}},ContentAPI=function(){function ContentAPI(){this.restAPI=new(isNodeJS?RestAPINode:RestAPIBrowser)(ContentAPIConfiguration)}var _proto3=ContentAPI.prototype;return _proto3.extractServer=function(contentServerURL){return this.restAPI.extractServer(contentServerURL)},_proto3.callRestServer=function(targetURL,restArgs){try{return Promise.resolve(this.restAPI.callRestServer(targetURL,restArgs))}catch(e){return Promise.reject(e)}},ContentAPI.getContentVersion=function(caller,requestedVersion){for(var parsedVersion=/\s*((([<>]?=?)\s*(v)?([0-9]+)(\.([0-9]+))?(\.([0-9]+))?))\s*/g.exec(requestedVersion||"0.0.0")||[],semanticVersion=(parsedVersion[5]||"0")+"."+(parsedVersion[7]||"0")+"."+(parsedVersion[9]||"0"),i=0;i<ContentAPIConfiguration.supportedVersions.length;i+=1)if(ContentAPIConfiguration.supportedVersions[i].semanticVersion===semanticVersion)return ContentAPIConfiguration.supportedVersions[i].contentVersion;return logger.warn('Content SDK: "'+caller+'" has unrecognized Content Version: "'+requestedVersion+'" - defaulting to: version="'+this.defaultVersion+'". To avoid this message, use one of the supported versions when creating a content client: '+JSON.stringify(this.supportedVersions)),this.defaultVersion},_proto3.getCSRFToken=function(){return"CSRFToken"},_proto3.createPrefix=function(args){return args.contentServer+ContentAPIConfiguration.contextRoot+"/"+ContentAPIConfiguration.state[args.contentType]+"/api/"+this.contentVersion},_proto3.createSuffix=function(cacheBuster){var search=cacheBuster.search||"",channelToken=cacheBuster.channelToken?this.properties.tokenName+"="+cacheBuster.channelToken:"",suffix="object"==typeof cacheBuster.cacheBuster?cacheBuster.cacheBuster.contentKey:cacheBuster.cacheBuster,cacheBuster=suffix?"cb="+suffix:"",suffix="";return suffix+=search,suffix+=(suffix&&channelToken?"&":"")+channelToken,suffix+=(suffix&&cacheBuster?"&":"")+cacheBuster},_proto3.formatURL=function(path,url){var prefix=this.createPrefix(url),url=this.createSuffix(url),url=prefix+path+(url?(-1===path.indexOf("?")?"?":"&")+url:"");return logger.info(url),url},_proto3.resolveGetTypesPath=function(){return"/types"},_proto3.resolveGetTypePath=function(args){return"/types/"+args.typeName},_proto3.isDigitalAsset=function(id){return/^DigitalAsset_/i.test(id)||36===id.length&&(/^CONT/.test(id)||/^CORE/.test(id))},_proto3.getRenditionURL=function(itemGUID,identifier,rendition,restArgs){var format,download,cacheBusterValue,joinChar,digitalAssets,url="";return(identifier||itemGUID)&&(identifier||this.isDigitalAsset(itemGUID)?(format=restArgs.format,download=restArgs.download,cacheBusterValue="object"==typeof restArgs.cacheBuster?restArgs.cacheBuster.contentKey:restArgs.cacheBuster,joinChar="?",digitalAssets=restArgs.secureContent?this.properties.secureAssetURLName:this.properties.assetURLName,rendition=rendition||this.properties.digitalAssetDefault,identifier=itemGUID||".by.slug/"+identifier,url=this.createPrefix(restArgs)+"/"+digitalAssets+"/"+identifier+"/"+rendition,cacheBusterValue&&(url+=joinChar+"cb="+cacheBusterValue,joinChar="&"),format&&(url+=joinChar+"format="+format,joinChar="&"),download?(url+=joinChar+"download=true",joinChar="&"):!1===download&&(url+=joinChar+"download=false",joinChar="&"),"published"===restArgs.contentType&&restArgs.channelToken&&(url+=joinChar+this.properties.tokenName+"="+restArgs.channelToken,joinChar="&")):url=restArgs.contentServer+"/documents/file/"+itemGUID),logger.info(url),url},_proto3.makeQueryParameters=function(search){var queryParams=utils_extend({},search),searchParams={postData:{},getData:"",assetVersion:""},parameters="",search=queryParams.search;delete queryParams.ids,delete queryParams.IDs,delete queryParams.id,delete queryParams.ID,delete queryParams.itemGUID,delete queryParams.itemGUIDs,delete queryParams.slug,delete queryParams.timeout,delete queryParams.search,delete queryParams.types,delete queryParams.beforeSend,delete queryParams.contentType,delete queryParams.language;var property,order,propVal,separator="";for(property in queryParams)queryParams.hasOwnProperty(property)&&property===encodeURI(property)&&(propVal=queryParams[property],"orderBy"===property&&Array.isArray(propVal)&&1===propVal.length&&(order=propVal[0].order&&propVal[0].order.toLowerCase()||"",propVal=propVal[0].name+(order?":"+("des"===order?"desc":order):"")),"expand"!==property&&("version"===property?void 0!==propVal&&propVal&&(searchParams.assetVersion=propVal):"object"!=typeof propVal&&(parameters+=separator+property+"="+encodeURI(propVal),separator="&")));return parameters+=search?separator+search:"",searchParams.method="GET",searchParams.getData=parameters,searchParams.useAggregate=queryParams.itemDepth||queryParams.expand,searchParams},ContentAPI}(),ContentApiV11Impl=function(_ContentApiV1Impl){function ContentApiV11Impl(contentVersion){var _this8=_ContentApiV1Impl.call(this)||this;return contentVersion&&(_this8.requestedContentVersion=contentVersion),_this8.contentVersion="v1.1",_this8.properties={tokenName:"channelToken",digitalAssetDefault:"native",assetURLName:"assets",secureAssetURLName:"assets"},_this8}_inheritsLoose(ContentApiV11Impl,_ContentApiV1Impl);var _proto5=ContentApiV11Impl.prototype;return _proto5.resolveGetItemListPath=function(args){var itemListURL="/items",joinChar="?";return args.types&&(itemListURL+=joinChar+"field:type:equals="+args.types,joinChar="&"),args.useAggregate&&(itemListURL+=joinChar+'expand="all"',joinChar="&"),itemListURL},_proto5.resolveGetItemPath=function(args){var language=args.language?"/variations/language/"+args.language+"?fields=all":"",aggregate=args.useAggregate?(language?"&":"?")+"expand="+args.useAggregate:"",slug=args.slug?".by.slug/"+args.slug:"",versionStr="";return language||args.assetVersion&&(versionStr="/versions/"+args.assetVersion),args.itemGUID?"/items/"+args.itemGUID+versionStr+language+aggregate:"/items/"+slug+versionStr+language+aggregate},_proto5.resolveQueryTaxonomyCategoriesPath=function(args){return"/taxonomies/"+args.taxonomyGUID+"/categories"},_proto5.resolveGetTaxonomiesPath=function(){return"/taxonomies"},_proto5.resolveGetRecommendationPath=function(args){return args.id?"/personalization/recommendationResults/.by.id/"+args.id:"/personalization/recommendationResults/"+args.apiName},_proto5.resolveSearchPath=function(){return"/items"},_proto5.resolveGetBulkItemListPath=function(languageQuery){var idQuery='(id eq "'+languageQuery.itemGUIDs.join('" or id eq "')+'")',languageQuery=languageQuery.language?'(language eq "'+languageQuery.language+'")':"";return"/items?q="+(languageQuery?"("+idQuery+" and "+languageQuery+")":idQuery)},_proto5.coerceData=function(response){var self=this;return new Promise(function(resolve){return"v1"===self.requestedContentVersion&&("object"==typeof response.fields?response.data||(response.data=response.fields):Array.isArray(response.items)&&response.items.forEach(function(item){"object"!=typeof item.fields||item.data||(item.data=item.fields)})),resolve(response)})},ContentApiV11Impl}(function(_ContentAPI){function ContentApiV1Impl(){var _this7=_ContentAPI.call(this)||this;return _this7.contentVersion="v1",_this7.properties={tokenName:"access-token",digitalAssetDefault:"default",assetURLName:"digital-assets",secureAssetURLName:"secure-digital-assets"},_this7}_inheritsLoose(ContentApiV1Impl,_ContentAPI);var _proto4=ContentApiV1Impl.prototype;return _proto4.resolveGetItemListPath=function(args){return"/items"+(args.useAggregate?"/aggregate":"")+(args.types?"?field:type:equals="+args.types:"")},_proto4.resolveGetItemPath=function(args){return"/items/"+args.itemGUID+(args.useAggregate?"/aggregate":"")},_proto4.resolveSearchPath=function(){return"/items/queries"},_proto4.resolveGetBulkItemListPath=function(args){return"/items/bulk"+(args.useAggregate?"/aggregate":"")+"?ids="+args.itemGUIDs.join(",")},ContentApiV1Impl}(ContentAPI)),restAPIFactory_createRestAPI=function(contentVersion){return"v1"===ContentAPI.getContentVersion("ContentSDK create content client",contentVersion)?new ContentApiV11Impl("v1"):new ContentApiV11Impl},ContentDeliveryClientImpl=function(){function ContentDeliveryClientImpl(args){this.restAPI=restAPIFactory_createRestAPI(args.contentVersion),logger.updateLogger(args.logger),this.info={accessToken:args.channelToken||args.accessToken,channelToken:args.channelToken||args.accessToken,cacheBuster:args.cacheBuster,beforeSend:args.beforeSend,clientType:"delivery",contentServer:this.restAPI.extractServer(args.contentServer),contentType:"published",secureContent:args.secureContent||!1,timeout:args.timeout||0,contentVersion:this.restAPI.requestedContentVersion||this.restAPI.contentVersion},this.isCompiler=args.isCompiler,this.info.authorization=args.authorization,this.validContentTypes=["published"],this.validLayoutTypes=this.validContentTypes,this.publicSDK={getInfo:utils_bind(this.getInfo,this),getItem:utils_bind(this.getItem,this),getItems:utils_bind(this.getItems,this),searchItems:utils_bind(this.queryItems,this),queryItems:utils_bind(this.queryItems,this),getRenditionURL:utils_bind(this.getRenditionURL,this),getLayoutInfo:utils_bind(this.getLayoutInfo,this),getRecommendationResults:utils_bind(this.getRecommendationResults,this),loadContentLayout:utils_bind(this.loadContentLayout,this),renderItem:utils_bind(this.renderItem,this),expandMacros:utils_bind(this.expandMacros,this),getTaxonomies:utils_bind(this.getTaxonomies,this),queryTaxonomyCategories:utils_bind(this.queryTaxonomyCategories,this)},logger.debug("ContentClient.create: Content Info:"),logger.debug(this.info)}var _proto6=ContentDeliveryClientImpl.prototype;return _proto6.resolveRESTArgs=function(method,args){var searchParams=this.restAPI.makeQueryParameters(args),restArgs=utils_extend({},this.info);return restArgs.method=method,restArgs.contentType=this.getContentType(args.contentType),restArgs.authorization=this.getInfo().authorization,restArgs.language=args.language,restArgs.beforeSend=args.beforeSend||restArgs.beforeSend,restArgs.timeout=args.timeout||restArgs.timeout,restArgs.postData=searchParams.postData,restArgs.useAggregate=searchParams.useAggregate,restArgs.assetVersion=searchParams.assetVersion,restArgs.search=searchParams.getData,args.format&&(restArgs.format=args.format),!0!==args.download&&!1!==args.download||(restArgs.download=args.download),"GET"===restArgs.method&&(restArgs.method=searchParams.method||restArgs.method),restArgs},_proto6.getContentType=function(contentType){var requestedType="string"==typeof contentType&&contentType.toLowerCase()||this.info.contentType;return-1!==this.validContentTypes.indexOf(requestedType)?requestedType:(logger.warn("Invalid value for content type request: "+contentType+". Allowed values are: "+JSON.stringify(this.validContentTypes)+". Defaulting to: "+this.info.contentType),this.info.contentType)},_proto6.getLayoutType=function(layoutType){var requestedType="string"==typeof layoutType&&layoutType.toLowerCase()||this.info.contentType;return-1!==this.validLayoutTypes.indexOf(requestedType)?requestedType:(logger.warn("Invalid value for layout type request: "+layoutType+". Allowed values are: "+JSON.stringify(this.validLayoutTypes)+". Defaulting to: "+this.info.contentType),this.info.contentType)},_proto6.renderLayout=function(requireLayout,layoutParams,container,preLoadLayout,resolve,reject){isNodeJS?reject({error:"renderLayout function not supported under NodeJS"}):preLoadLayout?requireConfig.preloadContentLayout(requireLayout,resolve,reject):((layoutParams=utils_extend({},layoutParams)).contentClient||(layoutParams.contentClient=this.publicSDK),requireConfig.renderContentLayout(requireLayout,layoutParams,container,resolve,reject))},_proto6.getInfo=function(){return utils_extend({},this.info)},_proto6.getItem=function(url){var restCallArgs=url||{},guid=restCallArgs.id||restCallArgs.ID||restCallArgs.itemGUID,restCallArgs=this.resolveRESTArgs("GET",restCallArgs),url=this.restAPI.formatURL(this.restAPI.resolveGetItemPath({itemGUID:guid,assetVersion:restCallArgs.assetVersion,useAggregate:restCallArgs.useAggregate,language:url.language,slug:url.slug}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getRecommendationResults=function(params){var restCallArgs,assetState=params||{},id=assetState.id||assetState.ID||assetState.itemGUID,url=assetState.apiName;"published"===(params.contentType||this.info.contentType)?(restCallArgs=this.resolveRESTArgs("GET",assetState),params.audienceAttributes&&Object.keys(params.audienceAttributes).forEach(function(audienceAttributeName){var queryParam=params.audienceAttributes[audienceAttributeName],queryParam=(queryParam=!Array.isArray(queryParam)?[queryParam]:queryParam).map(function(value){return encodeURIComponent("attribute."+audienceAttributeName)+"="+encodeURIComponent(value)}).join("&");restCallArgs.search?restCallArgs.search=restCallArgs.search+"&"+queryParam:restCallArgs.search=queryParam})):((restCallArgs=this.resolveRESTArgs("POST",assetState)).noCSRFToken=!0,assetState="published"===this.info.contentType?"PUBLISHED":"ALL",params.audienceAttributes&&(restCallArgs.postData={audienceAttributes:params.audienceAttributes,assetState:assetState}));url=this.restAPI.formatURL(this.restAPI.resolveGetRecommendationPath({id:id,apiName:url}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getItems=function(params){var url,self=this,args=params||{},guids=args.ids||args.IDs||args.itemGUIDs,restCallArgs=self.resolveRESTArgs("GET",args);if(logger.debug("ContentClient.getItems: arguments"),logger.debug(args),Array.isArray(guids)&&0<guids.length){var chunkGUIDs,length=guids.length,bulkChunks=[];return new Promise(function(resolve,reject){for(var i=0;i<length;i+=10)chunkGUIDs=guids.slice(i,i+10),url=self.restAPI.formatURL(self.restAPI.resolveGetBulkItemListPath({itemGUIDs:chunkGUIDs,types:args.types,useAggregate:restCallArgs.useAggregate,language:restCallArgs.language}),restCallArgs),bulkChunks.push(self.restAPI.callRestServer(url,restCallArgs));Promise.all(bulkChunks).then(function(arrayOfResults){var allContentItems={items:[]};"v1"===self.info.contentVersion?(allContentItems.items={},arrayOfResults.forEach(function(results){results&&results.items&&(allContentItems.items=utils_extend(allContentItems.items,results.items))})):arrayOfResults.forEach(function(results){allContentItems.items=allContentItems.items.concat(results.items)}),resolve(allContentItems)},function(err){reject(err)})})}return url=self.restAPI.formatURL(self.restAPI.resolveGetItemListPath({itemGUID:args.itemGUID,types:args.types,useAggregate:restCallArgs.useAggregate}),restCallArgs),self.restAPI.callRestServer(url,restCallArgs)},_proto6.queryItems=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url);logger.debug("ContentClient.queryItems: arguments"),logger.debug(url),restCallArgs.noCSRFToken=!0;url=this.restAPI.formatURL(this.restAPI.resolveSearchPath(),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.queryTaxonomyCategories=function(url){var restCallArgs=url||{},url=restCallArgs.id||restCallArgs.ID||restCallArgs.itemGUID,restCallArgs=this.resolveRESTArgs("GET",restCallArgs),url=this.restAPI.formatURL(this.restAPI.resolveQueryTaxonomyCategoriesPath({taxonomyGUID:url}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getTaxonomies=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url),url=this.restAPI.formatURL(this.restAPI.resolveGetTaxonomiesPath(url),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto6.getRenditionURL=function(renditionName){var restCallArgs=renditionName||{},guid=restCallArgs.id||restCallArgs.ID||restCallArgs.itemGUID,slug=restCallArgs.slug,renditionName=restCallArgs.rendition||restCallArgs.type,restCallArgs=this.resolveRESTArgs("GET",restCallArgs);return this.isCompiler?"[!--$SCS_DIGITAL_ASSET--]"+guid+"[/!--$SCS_DIGITAL_ASSET--]":this.restAPI.getRenditionURL(guid,slug,renditionName,restCallArgs)},_proto6.getLayoutInfo=function(params){var layoutType,layoutFactory,self=this,args=params||{},isSystemLayout=-1<["system-default-layout","system-tile-layout"].indexOf(args.layout);return new Promise(function(resolve,reject){var requireLayout;args.layout?(layoutFactory=isSystemLayout?(layoutType="system",args.layout):(layoutType=self.getLayoutType(args.layoutType),args.layout+"/assets/render"),requireLayout=requireConfig.getContentLayoutRequirePath(self.info)+layoutType+"/"+layoutFactory,logger.debug("ContentClient.getLayoutInfo: require path: "+requireLayout),require([requireLayout],function(layoutContentVersion){layoutContentVersion=layoutContentVersion.prototype.contentVersion;layoutContentVersion||(logger.warn('Content Layout: "'+args.layout+'" does not have a contentVersion specified. Assuming data needs to be fetched in "v1.0" format for this Content Layout. To avoid this message, add the prototype.contentVersion property to the Content Layout Factory object.'),layoutContentVersion="1.0.0"),resolve({name:args.layout,layoutFactory:layoutFactory,layoutType:layoutType,requirePath:requireLayout,contentVersion:layoutContentVersion})})):(logger.debug("ContentClient.getLayoutInfo: missing required parameters"),reject("missing parameters in call to getLayoutInfo: "+JSON.stringify(args)))})},_proto6.loadContentLayout=function(params){var layoutType,layoutFactory,self=this,args=params||{},isSystemLayout=-1<["system-default-layout","system-tile-layout"].indexOf(args.layout);return new Promise(function(resolve,reject){var requireLayout;args.layout?(layoutFactory=isSystemLayout?(layoutType="system",args.layout):(layoutType=self.getLayoutType(args.layoutType),args.layout+"/assets/render"),requireLayout=requireConfig.getContentLayoutRequirePath(self.info)+layoutType+"/"+layoutFactory,logger.debug("ContentClient.renderItem: require path: "+requireLayout),require([requireLayout],function(ContentLayout){resolve(ContentLayout)})):(logger.debug("ContentClient.renderItem: missing required parameters"),reject("missing parameters in call to renderLayout: "+JSON.stringify(args)))})},_proto6.renderItem=function(params){var layoutType,layoutFactory,self=this,args=params||{},isSystemLayout=-1<["system-default-layout","system-tile-layout"].indexOf(args.layout);return new Promise(function(resolve,reject){var requireLayout;args.layout?(layoutFactory=isSystemLayout?(layoutType="system",args.layout):(layoutType=self.getLayoutType(args.layoutType),args.layout+"/assets/render"),requireLayout=requireConfig.getContentLayoutRequirePath(self.info)+layoutType+"/"+layoutFactory,logger.debug("ContentClient.renderItem: require path: "+requireLayout),self.renderLayout(requireLayout,args.data,args.container,args.preloadLayout,resolve,reject)):(logger.debug("ContentClient.renderItem: missing required parameters"),reject("missing parameters in call to renderLayout: "+JSON.stringify(args)))})},_proto6.expandMacros=function(fieldValue){var afterValue=fieldValue||"";logger.log("expandMacros: beforeValue: "+fieldValue);var macros=[{name:"DIGITAL_ASSET",macro:/\[!--\$CEC_DIGITAL_ASSET--\]*(.*?) *\[\/!--\$CEC_DIGITAL_ASSET--\]/g,value:utils_bind(function(matchString,idStrParts){var assetId=idStrParts,isDownload=!1;return idStrParts.indexOf(",")&&(assetId=(idStrParts=idStrParts.split(","))[0],isDownload="true"===idStrParts[1]),this.getRenditionURL({id:assetId,download:isDownload})},this)},{name:"PAGE_LINK",macro:/\[!--\$SCS_PAGE--\]*(.*?) *\[\/!--\$SCS_PAGE--\]/g,value:utils_bind(function(matchString,page){var pageId,renderApi=window&&window.SCSRenderAPI||{};return"function"==typeof renderApi.getPageLinkData?pageId=(pageId=renderApi.getPageLinkData(page))&&pageId.href:"function"==typeof renderApi.getPageLinkUrl&&(pageId=renderApi.getPageLinkUrl(page)),pageId||"#"},this)}];this.isCompiler&&(macros=[]);afterValue=function expandField(obj){var expandedString,expandedValue=obj;return"string"==typeof obj?(expandedString=obj,macros.forEach(function(macroEntry){expandedString=expandedString.replace(macroEntry.macro,macroEntry.value)}),expandedValue=expandedString):obj&&"object"==typeof obj&&(Array.isArray(obj)?expandedValue=obj.map(expandField):(expandedValue={},Object.keys(obj).forEach(function(key){expandedValue[key]=expandField(obj[key])}))),expandedValue}(afterValue);return logger.log("expandMacros: afterValue: "+afterValue),afterValue},ContentDeliveryClientImpl}(),ContentPreviewClientImpl=function(_ContentDeliveryClien){function ContentPreviewClientImpl(args){var _this9=_ContentDeliveryClien.call(this,args)||this;return _this9.restAPI=restAPIFactory_createRestAPI(args.contentVersion),logger.updateLogger(args.logger),_this9.info={accessToken:args.channelToken||args.accessToken,channelToken:args.channelToken||args.accessToken,beforeSend:args.beforeSend,cacheBuster:args.cacheBuster,clientType:"preview",contentServer:_this9.restAPI.extractServer(args.contentServer),contentType:args.contentType&&"published"===args.contentType.toLowerCase()?"published":"draft",secureContent:args.secureContent||!1,timeout:args.timeout||0,contentVersion:_this9.restAPI.requestedContentVersion||_this9.restAPI.contentVersion},_this9.isCompiler=args.isCompiler,_this9.info.authorization=args.authorization,_this9.validContentTypes=["published","draft"],_this9.validLayoutTypes=_this9.validContentTypes,_this9.publicSDK={getInfo:utils_bind(_this9.getInfo,_assertThisInitialized(_this9)),getItem:utils_bind(_this9.getItem,_assertThisInitialized(_this9)),getItems:utils_bind(_this9.getItems,_assertThisInitialized(_this9)),searchItems:utils_bind(_this9.queryItems,_assertThisInitialized(_this9)),queryItems:utils_bind(_this9.queryItems,_assertThisInitialized(_this9)),getRenditionURL:utils_bind(_this9.getRenditionURL,_assertThisInitialized(_this9)),getLayoutInfo:utils_bind(_this9.getLayoutInfo,_assertThisInitialized(_this9)),getRecommendationResults:utils_bind(_this9.getRecommendationResults,_assertThisInitialized(_this9)),loadContentLayout:utils_bind(_this9.loadContentLayout,_assertThisInitialized(_this9)),renderItem:utils_bind(_this9.renderItem,_assertThisInitialized(_this9)),expandMacros:utils_bind(_this9.expandMacros,_assertThisInitialized(_this9)),getTypes:utils_bind(_this9.getTypes,_assertThisInitialized(_this9)),getType:utils_bind(_this9.getType,_assertThisInitialized(_this9)),getTaxonomies:utils_bind(_this9.queryTaxonomies,_assertThisInitialized(_this9)),queryTaxonomies:utils_bind(_this9.queryTaxonomies,_assertThisInitialized(_this9)),queryTaxonomyCategories:utils_bind(_this9.queryTaxonomyCategories,_assertThisInitialized(_this9))},logger.debug("ContentClient.create: Content Info:"),logger.debug(_this9.info),_this9}_inheritsLoose(ContentPreviewClientImpl,_ContentDeliveryClien);var _proto7=ContentPreviewClientImpl.prototype;return _proto7.getTypes=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url);logger.debug("ContentClient.getTypes: arguments"),logger.debug(url);url=this.restAPI.formatURL(this.restAPI.resolveGetTypesPath(),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto7.getType=function(restCallArgs){var url=restCallArgs||{},restCallArgs=this.resolveRESTArgs("GET",url);logger.debug("ContentClient.getType: arguments"),logger.debug(url);url=this.restAPI.formatURL(this.restAPI.resolveGetTypePath({typeName:url.typeName}),restCallArgs);return this.restAPI.callRestServer(url,restCallArgs)},_proto7.queryTaxonomies=function(params){return this.getTaxonomies(params)},ContentPreviewClientImpl}(ContentDeliveryClientImpl),contentSDK=function(){function contentSDK(){}return contentSDK.createDeliveryClient=function(newSDK){newSDK=new ContentDeliveryClientImpl("object"==typeof newSDK?newSDK:{});return logger.debug("ContentSDK.createDelivery: created new Content SDK client object:"),logger.debug(newSDK),newSDK?newSDK.publicSDK:void 0},contentSDK.createPreviewClient=function(newSDK){newSDK=new ContentPreviewClientImpl("object"==typeof newSDK?newSDK:{});return logger.debug("ContentSDK.createPreviewClient: created new Content SDK client object:"),logger.debug(newSDK),newSDK?newSDK.publicSDK:void 0},contentSDK}();exports.contentSDK=contentSDK,exports.createDeliveryClient=function(param){return contentSDK.createDeliveryClient(param)},exports.createPreviewClient=function(param){return contentSDK.createPreviewClient(param)}});

@@ -5,3 +5,3 @@ {

"author": "Oracle America, Inc.",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/oracle/content-management-sdk",

@@ -26,7 +26,8 @@ "keywords": [

"files": [
"CHANGELOG.md",
"CONTRIBUTING.md",
"LICENSE.txt",
"README.md",
"CONTRIBUTING.md",
"SECURITY.md",
"LICENSE.txt",
"THIRD_PARTY_LICENSES.txt",
"THIRD_PARTY_LICENSES_DEV.txt",
"dist/content.js",

@@ -49,9 +50,10 @@ "dist/content.js.map",

"pack": "npm pack",
"build": "npm run bundle && npm run minify && npm run pack"
"build": "npm run bundle && npm run minify && npm run pack",
"publish": "npm publish --access public"
},
"dependencies": {},
"devDependencies": {
"microbundle": "^0.13.0",
"uglify-js": "^3.13.4"
}
"microbundle": "~0.13.0",
"uglify-js": "~3.13.5"
},
"dependencies": {}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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