scrivito_sdk 1.17.0.rc2 → 1.17.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 146486584acb9660d1f7ceb8d7ecbe072bdb0b3e2ea9fab5437db0d66ded97a7
4
- data.tar.gz: d8d757425944ffd948c56e5513c1e01a91092a205aaec407143ae302b31350e6
3
+ metadata.gz: 24bd5086592408534913facabf378aca4cee04e9d749b33bc9b22e2fd253849f
4
+ data.tar.gz: c840807dab6c5ec6c0f9f4cfa97b900a27ef739f415c06a18fb91c70609f2833
5
5
  SHA512:
6
- metadata.gz: ded66fee7754e12b25d6ebbaed8063190990c3e0c218f44d3e8386cd81a7a98ed9885002eaaf21ba880237d06efc9e2ddd8d655164c6cb73dd61b3df4a5ca60e
7
- data.tar.gz: 9ee6a548c78305663fac85d0b407a77bbac3eb2879bca4ef0afebd7d6604b9c3e2eed34fd400055f92a56a199004c96f891ac6af001d7f7c0af599e11141e2fc
6
+ metadata.gz: ae653310b1e55e892d45e37c1a1748a01231b5d34b8e1180cae0000ef6e2dddde3694415cdc609e065cf530f929587c5cb1e1d431d20f296a201b8a6f4286da9
7
+ data.tar.gz: 7ad67012b3de012bada117385977b1438d6791bb2a5750da7e27dbadff818af5d0e84da79921929277b6e5f228f57b50f4c499af86a3a4ed40616252c6363533
@@ -719,10 +719,13 @@ module Scrivito
719
719
  }
720
720
  end
721
721
 
722
+ # @note If the custom attribute +created_at+ is defined, this value will be returned
723
+ # instead of the system attribute +_created_at+. To access the system attribute
724
+ # regardless of a custom attribute, call {#[] <code>obj[:_created_at]</code>}.
722
725
  # @return [nil, ActiveSupport::TimeWithZone]
723
726
  # @api public
724
727
  def created_at
725
- read_attribute('_created_at')
728
+ read_custom_or_system_attribute('created_at')
726
729
  end
727
730
 
728
731
  # @return [ActiveSupport::TimeWithZone]
@@ -731,16 +734,22 @@ module Scrivito
731
734
  read_attribute('_last_changed')
732
735
  end
733
736
 
737
+ # @note If the custom attribute +first_published_at+ is defined, this value will be returned
738
+ # instead of the system attribute +_first_published_at+. To access the system attribute
739
+ # regardless of a custom attribute, call {#[] <code>obj[:_first_published_at]</code>}.
734
740
  # @return [nil, ActiveSupport::TimeWithZone]
735
741
  # @api public
736
742
  def first_published_at
737
- read_attribute('_first_published_at')
743
+ read_custom_or_system_attribute('first_published_at')
738
744
  end
739
745
 
746
+ # @note If the custom attribute +published_at+ is defined, this value will be returned
747
+ # instead of the system attribute +_published_at+. To access the system attribute
748
+ # regardless of a custom attribute, call {#[] <code>obj[:_published_at]</code>}.
740
749
  # @return [nil, ActiveSupport::TimeWithZone]
741
750
  # @api public
742
751
  def published_at
743
- read_attribute('_published_at')
752
+ read_custom_or_system_attribute('published_at')
744
753
  end
745
754
 
746
755
  def new?(revision=workspace.base_revision)
@@ -1072,6 +1081,12 @@ module Scrivito
1072
1081
 
1073
1082
  private
1074
1083
 
1084
+ def read_custom_or_system_attribute(attribute_name)
1085
+ return read_attribute(attribute_name) if has_custom_attribute?(attribute_name)
1086
+
1087
+ read_attribute("_#{attribute_name}")
1088
+ end
1089
+
1075
1090
  def children_including_deleted
1076
1091
  workspace.objs.find_by_parent_path_including_deleted(path)
1077
1092
  end
@@ -1,7 +1,7 @@
1
1
  ##
2
2
  ## Bundle of CA Root Certificates
3
3
  ##
4
- ## Certificate data from Mozilla as of: Wed Jul 8 12:49:14 2020 GMT
4
+ ## Certificate data from Mozilla as of: Thu Jul 9 12:40:37 2020 GMT
5
5
  ##
6
6
  ## This is a bundle of X.509 certificates of public Certificate Authorities
7
7
  ## (CA). These were automatically extracted from Mozilla's root certificates
@@ -1,4 +1,4 @@
1
- /*! Copyright (c) 2020 Infopark Group GmbH (https://scrivito.com) */!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=744)}({0:function(t,e,n){"use strict";n.d(e,"p",(function(){return p})),n.d(e,"d",(function(){return v})),n.d(e,"e",(function(){return m})),n.d(e,"a",(function(){return s.ArgumentError})),n.d(e,"g",(function(){return s.InternalError})),n.d(e,"h",(function(){return s.ResourceNotFoundError})),n.d(e,"i",(function(){return s.ScrivitoError})),n.d(e,"Q",(function(){return d})),n.d(e,"G",(function(){return f})),n.d(e,"I",(function(){return i})),n.d(e,"O",(function(){return u})),n.d(e,"M",(function(){return y})),n.d(e,"F",(function(){return b})),n.d(e,"x",(function(){return w})),n.d(e,"D",(function(){return _})),n.d(e,"E",(function(){return O})),n.d(e,"o",(function(){return N})),n.d(e,"q",(function(){return L})),n.d(e,"N",(function(){return I})),n.d(e,"R",(function(){return P})),n.d(e,"y",(function(){return A})),n.d(e,"f",(function(){return R})),n.d(e,"c",(function(){return D})),n.d(e,"z",(function(){return M})),n.d(e,"m",(function(){return B})),n.d(e,"L",(function(){return F})),n.d(e,"K",(function(){return q})),n.d(e,"P",(function(){return U})),n.d(e,"H",(function(){return $})),n.d(e,"t",(function(){return Q})),n.d(e,"u",(function(){return W})),n.d(e,"B",(function(){return K})),n.d(e,"w",(function(){return G})),n.d(e,"A",(function(){return Y})),n.d(e,"C",(function(){return V})),n.d(e,"S",(function(){return J})),n.d(e,"T",(function(){return tt})),n.d(e,"v",(function(){return et})),n.d(e,"J",(function(){return rt})),n.d(e,"j",(function(){return it})),n.d(e,"b",(function(){return at})),n.d(e,"s",(function(){return st})),n.d(e,"n",(function(){return lt})),n.d(e,"r",(function(){return ct})),n.d(e,"k",(function(){return dt})),n.d(e,"l",(function(){return vt}));var r=n(2);function i(t){try{return Object(r.isFunction)(t)?function(t){if(function(t){return!!t._scrivitoPrivateSchema}(t)){return"[class "+t._scrivitoPrivateSchema.name+"]"}if(function(t){var e=t.prototype;return e&&e.isReactComponent}(t)){return'[class React.Component "'+(t.displayName||t.name)+'"]'}return a(t.toString())}(t):Object(r.isObject)(t)?function(t){var e=t._scrivitoPrivateContent;if(e&&Object(r.isFunction)(e.toPrettyPrint))return e.toPrettyPrint();if(Object(r.isElement)(t))return"[object HTMLElement "+o(t.outerHTML)+"]";return o(t)}(t):o(t)}catch(t){return""}}function o(t){var e=JSON.stringify(t);return e?a(e):e}function a(t){return t.length>100?t.slice(0,100)+"...":t}var s=n(52),u=n(58);u.struct.strict=!0,u.interface.strict=!0,u.fail=function(t){throw new TypeError(t)};var l,c=[];function f(t){l?c.push(t):setTimeout(t,0)}function d(t){f((function(){throw t}))}function p(t,e,n){var r=n.docPermalink;return function(){for(var n,i=[],o=0;on)return"Expected "+n+" arguments, got "+o;var a=Object(r.flatten)(e.map((function(e,n){var r=e[0],o=e[1],a=t[n];return u.validate(a,o).errors.map((function(t){return function(t,e){var n=function(t,e){var n="argument '"+t+"'";if(0===e.path.length)return n;return"key '"+e.path.join("/")+"' in "+n}(t,e);if(void 0===e.actual)return"Missing required "+n+".";if(e.expected===u.Nil)return"Unexpected "+n+".";var r=u.getTypeName(e.expected),o="got "+i(e.actual)+", expected type "+r+".";return"Unexpected value for "+n+": "+o}(r,t)}))})));return a.length>0?a.join(" "):void 0}var v=function(){function t(){}return t.prototype.current=function(){return this.currentContext},t.prototype.runWith=function(t,e){var n=this.currentContext;try{return this.currentContext=t,e()}finally{this.currentContext=n}},t}(),m=function(){function t(){var t=this;this.promise=new it((function(e,n){t.resolve=function(n){t.settled=!0,e(n)},t.reject=function(e){t.settled=!0,n(e)}}))}return t.prototype.isPending=function(){return!this.settled},t}();function y(t){try{return{errorThrown:!1,result:t()}}catch(t){return{errorThrown:!0,error:t}}}var g=!1;function b(){for(var t,e=[],n=0;n=2?t[1]:t[0]},e.flatten=function t(e){return e.reduce((function(e,n){return e.concat(Array.isArray(n)?t(n):n)}),[])},e.groupConsecutiveElementsWhile=function(t,e){for(var n,r=[],i=0;i0&&e(n,t[i-1])?r[r.length-1].push(n):r.push([n]);return r.map((function(t){return 1===t.length?t[0]:t}))},e.sliceFromReverseWhile=function(t,e,n){for(var r={elements:[],sliceStartsAt:-1},i=e;i>=0&&n(t[i]);i--)r.sliceStartsAt=i,r.elements.unshift(t[i]);return r},e.intersperse=function(t,e){return t.reduce((function(n,r,i){return n.push(r),i0)if(this._replicationActive)this._bufferedBackendState=t;else{if(t._deleted)this._updateLocalState(null);else{var e=P(this._backendState,t);this._updateLocalState(N(this.localState,e))}this._backendState=t}},t.prototype.finishSaving=function(){var t;if(this._nextRequestDeferred)t=this._nextRequestDeferred.promise;else{if(!this._currentRequestDeferred)return f.j.resolve();t=this._currentRequestDeferred.promise}return t.catch((function(){return f.j.reject()}))},t.prototype._startReplication=function(){var t=this;u.a.isEmpty(P(this._backendState,this._localState))?this._nextRequestDeferred&&(this._nextRequestDeferred.resolve(),this._nextRequestDeferred=null):this._replicationActive?this._nextRequestDeferred||(this._nextRequestDeferred=new f.e):this._scheduledReplication||(this._scheduledReplication=!0,this._initDeferredForRequest(),I.writeStarted(this._currentRequestDeferred.promise),Object(f.G)((function(){return t._performThrottledReplication()})))},t.prototype._performReplication=function(){var t=this,e=this._localState,n=P(this._backendState,this._localState);this._scheduledReplication=!1,this._replicationActive=!0,this._replicatePatchToBackend(n).then((function(n){t._handleBackendUpdate(e,n),t._currentRequestDeferred.resolve(t._objId),t._currentRequestDeferred=null,t._replicationActive=!1,t._startReplication()}),(function(e){t._currentRequestDeferred.reject(e),t._currentRequestDeferred=null,t._replicationActive=!1}))},t.prototype._replicatePatchToBackend=function(t){if(u.a.isEmpty(t))return f.j.resolve(this._backendState);var e="workspaces/"+this._workspaceId+"/objs/"+this._objId;return b.d.put(e,{obj:t})},t.prototype._initDeferredForRequest=function(){if(this._nextRequestDeferred){var t=this._nextRequestDeferred;this._nextRequestDeferred=null,this._currentRequestDeferred=t}else this._currentRequestDeferred=new f.e},t.prototype._handleBackendUpdate=function(t,e){var n=P(t,this._localState);this._backendState=function(t,e){if(L(t,e)>0)return t;return e}(e,this._bufferedBackendState),this._bufferedBackendState=void 0,this._updateLocalState(N(this._backendState,n))},t.prototype._updateLocalState=function(t){this._localState=t,F(this._workspaceId,this._objId,this._localState)},Object.defineProperty(t.prototype,"backendState",{get:function(){return this._backendState},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localState",{get:function(){return this._localState},enumerable:!0,configurable:!0}),t.prototype.isNotStoredInBackend=function(){return null===this._backendState},t.prototype.isRequestInFlight=function(){return this._replicationActive},t}();function P(t,e){return E(t,e)}function N(t,e){return C(t,e)}function L(t,e){return t?e?function(t,e){if(t>e)return 1;if(e>t)return-1;return 0}(t._version,e._version):1:-1}var I=new(function(){function t(){this.replicationCache={},this.disabled=!1,this.writeWriteCallbacks={},this.subscriptionToken=0}return t.prototype.get=function(t,e){return this.replicationCache[t]||(this.replicationCache[t]={}),this.replicationCache[t][e]||(this.replicationCache[t][e]=new A(t,e)),this.replicationCache[t][e]},t.prototype.subscribeWrites=function(t){return this.subscriptionToken+=1,this.writeWriteCallbacks[this.subscriptionToken]=t,this.subscriptionToken},t.prototype.unsubscribeWrites=function(t){delete this.writeWriteCallbacks[t]},t.prototype.isDisabled=function(){return this.disabled},t.prototype.writeStarted=function(t){Object(s.each)(this.writeWriteCallbacks,(function(e){e(t)}))},t.prototype.disableReplication=function(){this.disabled=!0},t.prototype.enableReplication=function(){this.disabled=!1},t.prototype.clearWriteCallbacks=function(){this.writeWriteCallbacks={}},t.prototype.clearCache=function(){this.replicationCache={}},t}());function D(t){I=t}function R(){return c.m.subState("objData")}var M=new l.LoadableCollection({name:"objdata",state:R,loader:function(t){var e=t[0],n=t[1];return I.get(e,n).start(),new f.j((function(){}))}});var B=function(){function t(t,e){this._workspaceId=t,this._id=e,this._loadableData=M.get([t,e])}return t.prototype.get=function(){return Object(c.h)("for performance reasons, avoid this method when rendering"),this._loadableData.get()},t.prototype.getWidget=function(t){return Object(c.h)("for performance reasons, avoid this method when rendering"),this.getWidgetState(t).get()},t.prototype.getWidgetWithBadPerformance=function(t){return this.getWidgetState(t).get()},t.prototype.getAttribute=function(t){if("_widget_pool"===t)throw new f.g("_widget_pool is not an attribute, use getWidget or getWidgetAttribute");return this.getSubReader(t).get()},t.prototype.getWidgetAttribute=function(t,e){return this.getWidgetState(t).subState(e).get()},t.prototype.isNonExistent=function(){return!!this.getSubReader("_deleted").get()||!this.getSubReader("_id").get()},t.prototype.set=function(t){Object(c.g)("Changing CMS content"),this._loadableData.set(t)},t.prototype.setError=function(t){this._loadableData.setError(t)},t.prototype.ensureAvailable=function(){return this._loadableData.ensureAvailable()},t.prototype.isAvailable=function(){return this._loadableData.isAvailable()},t.prototype.update=function(t){var e=C(this.get(),t);this.set(e),this._replication().notifyLocalState(e)},t.prototype.finishSaving=function(){return this._replication().finishSaving()},t.prototype.workspaceId=function(){return this._workspaceId},t.prototype.equals=function(e){return e instanceof t&&(this.workspaceId()===e.workspaceId()&&this._id===e._id)},t.prototype._replication=function(){return I.get(this._workspaceId,this._id)},t.prototype.getWidgetState=function(t){return this.getSubReader("_widget_pool").subState(t)},t.prototype.getSubReader=function(t){return this._loadableData.reader().subState(t)},t}();function q(t,e){var n=U(t,e);return n.set(null),I.get(t,e).notifyBackendState(null),n}function F(t,e,n){U(t,e).set(n)}function z(t,e){var n=U(t,e);if(n.ensureAvailable())return n}function U(t,e){return new B(t,e)}var H=function(){return(H=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0){var i=new K(t,e,n,r-1);return Object(l.load)((function(){return i.continuationForNextBatch()}))}return f.j.resolve()}(r,i,n,o).then((function(t){if(u())throw new Error;var e={size:n,continuation:t,include_objs:!s()},o=H({},i,e);return b.e.retrieveObjQuery(r,o).then((function(t){var e=t.objs;return e&&a((function(){return e.forEach((function(t){t._id&&I.get(r,t._id).notifyBackendState(t)}))})),function(t,e){e.forEach((function(e){return function(t,e){Object(l.load)((function(){return z(t,e)}))}(t,e)}))}(r,t.results),{results:t.results,total:t.total,continuation:t.continuation}}))}))},invalidation:function(t){var e=t[0];t[1],t[2];return Object(l.loadableWithDefault)(void 0,(function(){return i(e)}))||""}}),K=function(){function t(t,e,n,r){void 0===r&&(r=0),this._workspaceId=t,this._params=e,this._batchSize=n,this._index=r}return t.store=function(t,e,n,r){void 0===r&&(r=n.length),V.get([t,$(e),0]).set({results:n,total:r})},t.firstBatchFor=function(e,n,r){return new t(e,$(n),r)},t.countFor=function(t,e){return this.firstBatchFor(t,e,0).count()},t.prototype.objIds=function(){return this._response().results},t.prototype.count=function(){return this._response().total||0},t.prototype.nextBatch=function(){if(this.continuationForNextBatch())return new t(this._workspaceId,this._params,this._batchSize,this._index+1)},Object.defineProperty(t.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),t.prototype.continuationForNextBatch=function(){return this._response().continuation},t.prototype._response=function(){return this._data().get()||W},t.prototype._data=function(){return V.get([this._workspaceId,this._params,this._index],this._batchSize)},t}(),Q=K;function $(t){var e=Object(s.omit)({query:t.query,offset:t.offset,sort_by:t.sortBy,sort_order:t.sortDirection},s.isUndefined);return t.includeDeleted&&(e.options={include_deleted:!0}),e}var G=function(){function t(t,e,n){this._workspaceId=t,this._params=e,this._batchSize=n}return t.store=function(t,e,n,r){Q.store(t,e,n,r)},t.count=function(t,e){return Q.countFor(t,e)},t.prototype.iterator=function(){var t={},e=Q.firstBatchFor(this._workspaceId,this._params,this._batchSize),n=0;return{next:function r(){if(!e)return{done:!0};var i=e.objIds();if(n
1
+ /*! Copyright (c) 2020 Infopark Group GmbH (https://scrivito.com) */!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=744)}({0:function(t,e,n){"use strict";n.d(e,"p",(function(){return p})),n.d(e,"d",(function(){return v})),n.d(e,"e",(function(){return m})),n.d(e,"a",(function(){return s.ArgumentError})),n.d(e,"g",(function(){return s.InternalError})),n.d(e,"h",(function(){return s.ResourceNotFoundError})),n.d(e,"i",(function(){return s.ScrivitoError})),n.d(e,"Q",(function(){return d})),n.d(e,"G",(function(){return f})),n.d(e,"I",(function(){return i})),n.d(e,"O",(function(){return u})),n.d(e,"M",(function(){return y})),n.d(e,"F",(function(){return b})),n.d(e,"x",(function(){return w})),n.d(e,"D",(function(){return _})),n.d(e,"E",(function(){return O})),n.d(e,"o",(function(){return N})),n.d(e,"q",(function(){return L})),n.d(e,"N",(function(){return I})),n.d(e,"R",(function(){return P})),n.d(e,"y",(function(){return A})),n.d(e,"f",(function(){return R})),n.d(e,"c",(function(){return D})),n.d(e,"z",(function(){return M})),n.d(e,"m",(function(){return B})),n.d(e,"L",(function(){return F})),n.d(e,"K",(function(){return q})),n.d(e,"P",(function(){return U})),n.d(e,"H",(function(){return $})),n.d(e,"t",(function(){return Q})),n.d(e,"u",(function(){return W})),n.d(e,"B",(function(){return K})),n.d(e,"w",(function(){return G})),n.d(e,"A",(function(){return Y})),n.d(e,"C",(function(){return V})),n.d(e,"S",(function(){return J})),n.d(e,"T",(function(){return tt})),n.d(e,"v",(function(){return et})),n.d(e,"J",(function(){return rt})),n.d(e,"j",(function(){return it})),n.d(e,"b",(function(){return at})),n.d(e,"s",(function(){return st})),n.d(e,"n",(function(){return lt})),n.d(e,"r",(function(){return ct})),n.d(e,"k",(function(){return dt})),n.d(e,"l",(function(){return vt}));var r=n(2);function i(t){try{return Object(r.isFunction)(t)?function(t){if(function(t){return!!t._scrivitoPrivateSchema}(t)){return"[class "+t._scrivitoPrivateSchema.name+"]"}if(function(t){var e=t.prototype;return e&&e.isReactComponent}(t)){return'[class React.Component "'+(t.displayName||t.name)+'"]'}return a(t.toString())}(t):Object(r.isObject)(t)?function(t){var e=t._scrivitoPrivateContent;if(e&&Object(r.isFunction)(e.toPrettyPrint))return e.toPrettyPrint();if(Object(r.isElement)(t))return"[object HTMLElement "+o(t.outerHTML)+"]";return o(t)}(t):o(t)}catch(t){return""}}function o(t){var e=JSON.stringify(t);return e?a(e):e}function a(t){return t.length>100?t.slice(0,100)+"...":t}var s=n(52),u=n(58);u.struct.strict=!0,u.interface.strict=!0,u.fail=function(t){throw new TypeError(t)};var l,c=[];function f(t){l?c.push(t):setTimeout(t,0)}function d(t){f((function(){throw t}))}function p(t,e,n){var r=n.docPermalink;return function(){for(var n,i=[],o=0;on)return"Expected "+n+" arguments, got "+o;var a=Object(r.flatten)(e.map((function(e,n){var r=e[0],o=e[1],a=t[n];return u.validate(a,o).errors.map((function(t){return function(t,e){var n=function(t,e){var n="argument '"+t+"'";if(0===e.path.length)return n;return"key '"+e.path.join("/")+"' in "+n}(t,e);if(void 0===e.actual)return"Missing required "+n+".";if(e.expected===u.Nil)return"Unexpected "+n+".";var r=u.getTypeName(e.expected),o="got "+i(e.actual)+", expected type "+r+".";return"Unexpected value for "+n+": "+o}(r,t)}))})));return a.length>0?a.join(" "):void 0}var v=function(){function t(){}return t.prototype.current=function(){return this.currentContext},t.prototype.runWith=function(t,e){var n=this.currentContext;try{return this.currentContext=t,e()}finally{this.currentContext=n}},t}(),m=function(){function t(){var t=this;this.promise=new it((function(e,n){t.resolve=function(n){t.settled=!0,e(n)},t.reject=function(e){t.settled=!0,n(e)}}))}return t.prototype.isPending=function(){return!this.settled},t}();function y(t){try{return{errorThrown:!1,result:t()}}catch(t){return{errorThrown:!0,error:t}}}var g=!1;function b(){for(var t,e=[],n=0;n=2?t[1]:t[0]},e.flatten=function t(e){return e.reduce((function(e,n){return e.concat(Array.isArray(n)?t(n):n)}),[])},e.groupConsecutiveElementsWhile=function(t,e){for(var n,r=[],i=0;i0&&e(n,t[i-1])?r[r.length-1].push(n):r.push([n]);return r.map((function(t){return 1===t.length?t[0]:t}))},e.sliceFromReverseWhile=function(t,e,n){for(var r={elements:[],sliceStartsAt:-1},i=e;i>=0&&n(t[i]);i--)r.sliceStartsAt=i,r.elements.unshift(t[i]);return r},e.intersperse=function(t,e){return t.reduce((function(n,r,i){return n.push(r),i0)if(this._replicationActive)this._bufferedBackendState=t;else{if(t._deleted)this._updateLocalState(null);else{var e=P(this._backendState,t);this._updateLocalState(N(this.localState,e))}this._backendState=t}},t.prototype.finishSaving=function(){var t;if(this._nextRequestDeferred)t=this._nextRequestDeferred.promise;else{if(!this._currentRequestDeferred)return f.j.resolve();t=this._currentRequestDeferred.promise}return t.catch((function(){return f.j.reject()}))},t.prototype._startReplication=function(){var t=this;u.a.isEmpty(P(this._backendState,this._localState))?this._nextRequestDeferred&&(this._nextRequestDeferred.resolve(),this._nextRequestDeferred=null):this._replicationActive?this._nextRequestDeferred||(this._nextRequestDeferred=new f.e):this._scheduledReplication||(this._scheduledReplication=!0,this._initDeferredForRequest(),I.writeStarted(this._currentRequestDeferred.promise),Object(f.G)((function(){return t._performThrottledReplication()})))},t.prototype._performReplication=function(){var t=this,e=this._localState,n=P(this._backendState,this._localState);this._scheduledReplication=!1,this._replicationActive=!0,this._replicatePatchToBackend(n).then((function(n){t._handleBackendUpdate(e,n),t._currentRequestDeferred.resolve(t._objId),t._currentRequestDeferred=null,t._replicationActive=!1,t._startReplication()}),(function(e){t._currentRequestDeferred.reject(e),t._currentRequestDeferred=null,t._replicationActive=!1}))},t.prototype._replicatePatchToBackend=function(t){if(u.a.isEmpty(t))return f.j.resolve(this._backendState);var e="workspaces/"+this._workspaceId+"/objs/"+this._objId;return b.d.put(e,{obj:t})},t.prototype._initDeferredForRequest=function(){if(this._nextRequestDeferred){var t=this._nextRequestDeferred;this._nextRequestDeferred=null,this._currentRequestDeferred=t}else this._currentRequestDeferred=new f.e},t.prototype._handleBackendUpdate=function(t,e){var n=P(t,this._localState);this._backendState=function(t,e){if(L(t,e)>0)return t;return e}(e,this._bufferedBackendState),this._bufferedBackendState=void 0,this._updateLocalState(N(this._backendState,n))},t.prototype._updateLocalState=function(t){this._localState=t,F(this._workspaceId,this._objId,this._localState)},Object.defineProperty(t.prototype,"backendState",{get:function(){return this._backendState},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localState",{get:function(){return this._localState},enumerable:!0,configurable:!0}),t.prototype.isNotStoredInBackend=function(){return null===this._backendState},t.prototype.isRequestInFlight=function(){return this._replicationActive},t}();function P(t,e){return E(t,e)}function N(t,e){return C(t,e)}function L(t,e){return t?e?function(t,e){if(t>e)return 1;if(e>t)return-1;return 0}(t._version,e._version):1:-1}var I=new(function(){function t(){this.replicationCache={},this.disabled=!1,this.writeWriteCallbacks={},this.subscriptionToken=0}return t.prototype.get=function(t,e){return this.replicationCache[t]||(this.replicationCache[t]={}),this.replicationCache[t][e]||(this.replicationCache[t][e]=new A(t,e)),this.replicationCache[t][e]},t.prototype.subscribeWrites=function(t){return this.subscriptionToken+=1,this.writeWriteCallbacks[this.subscriptionToken]=t,this.subscriptionToken},t.prototype.unsubscribeWrites=function(t){delete this.writeWriteCallbacks[t]},t.prototype.isDisabled=function(){return this.disabled},t.prototype.writeStarted=function(t){Object(s.each)(this.writeWriteCallbacks,(function(e){e(t)}))},t.prototype.disableReplication=function(){this.disabled=!0},t.prototype.enableReplication=function(){this.disabled=!1},t.prototype.clearWriteCallbacks=function(){this.writeWriteCallbacks={}},t.prototype.clearCache=function(){this.replicationCache={}},t}());function D(t){I=t}function R(){return c.m.subState("objData")}var M=new l.LoadableCollection({name:"objdata",state:R,loader:function(t){var e=t[0],n=t[1];return I.get(e,n).start(),new f.j((function(){}))}});var B=function(){function t(t,e){this._workspaceId=t,this._id=e,this._loadableData=M.get([t,e])}return t.prototype.get=function(){return Object(c.h)("for performance reasons, avoid this method when rendering"),this._loadableData.get()},t.prototype.getWidget=function(t){return Object(c.h)("for performance reasons, avoid this method when rendering"),this.getWidgetState(t).get()},t.prototype.getWidgetWithBadPerformance=function(t){return this.getWidgetState(t).get()},t.prototype.getAttribute=function(t){if("_widget_pool"===t)throw new f.g("_widget_pool is not an attribute, use getWidget or getWidgetAttribute");return this.getSubReader(t).get()},t.prototype.getWidgetAttribute=function(t,e){return this.getWidgetState(t).subState(e).get()},t.prototype.isNonExistent=function(){return!!this.getSubReader("_deleted").get()||!this.getSubReader("_id").get()},t.prototype.set=function(t){Object(c.g)("Changing CMS content"),this._loadableData.set(t)},t.prototype.setError=function(t){this._loadableData.setError(t)},t.prototype.ensureAvailable=function(){return this._loadableData.ensureAvailable()},t.prototype.isAvailable=function(){return this._loadableData.isAvailable()},t.prototype.update=function(t){var e=C(this.get(),t);this.set(e),this._replication().notifyLocalState(e)},t.prototype.finishSaving=function(){return this._replication().finishSaving()},t.prototype.workspaceId=function(){return this._workspaceId},t.prototype.equals=function(e){return e instanceof t&&(this.workspaceId()===e.workspaceId()&&this._id===e._id)},t.prototype._replication=function(){return I.get(this._workspaceId,this._id)},t.prototype.getWidgetState=function(t){return this.getSubReader("_widget_pool").subState(t)},t.prototype.getSubReader=function(t){return this._loadableData.reader().subState(t)},t}();function q(t,e){var n=U(t,e);return n.set(null),I.get(t,e).notifyBackendState(null),n}function F(t,e,n){U(t,e).set(n)}function z(t,e){var n=U(t,e);if(n.ensureAvailable())return n}function U(t,e){return new B(t,e)}var H=function(){return(H=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0){var i=new K(t,e,n,r-1);return Object(l.load)((function(){return i.continuationForNextBatch()}))}return f.j.resolve()}(r,i,n,o).then((function(t){if(u())throw new Error;var e={size:n,continuation:t,include_objs:!s()},o=H({},i,e);return b.e.retrieveObjQuery(r,o).then((function(t){var e=t.objs;return e&&a((function(){return e.forEach((function(t){t._id&&I.get(r,t._id).notifyBackendState(t)}))})),function(t,e){e.forEach((function(e){return function(t,e){Object(l.load)((function(){return z(t,e)}))}(t,e)}))}(r,t.results),{results:t.results,total:t.total,continuation:t.continuation}}))}))},invalidation:function(t){var e=t[0];t[1],t[2];return Object(l.loadableWithDefault)(void 0,(function(){return i(e)}))||""}}),K=function(){function t(t,e,n,r){void 0===r&&(r=0),this._workspaceId=t,this._params=e,this._batchSize=n,this._index=r}return t.store=function(t,e,n,r){void 0===r&&(r=n.length),V.get([t,$(e),0]).set({results:n,total:r})},t.firstBatchFor=function(e,n,r){return new t(e,$(n),r)},t.countFor=function(t,e){return this.firstBatchFor(t,e,0).count()},t.prototype.objIds=function(){return this._response().results},t.prototype.count=function(){return this._response().total||0},t.prototype.nextBatch=function(){if(this.continuationForNextBatch())return new t(this._workspaceId,this._params,this._batchSize,this._index+1)},Object.defineProperty(t.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),t.prototype.continuationForNextBatch=function(){return this._response().continuation},t.prototype._response=function(){return this._data().get()||W},t.prototype._data=function(){return V.get([this._workspaceId,this._params,this._index],this._batchSize)},t}(),Q=K;function $(t){var e=Object(s.omit)({query:t.query,offset:t.offset,sort_by:t.sortBy,sort_order:t.sortDirection},s.isUndefined);return t.includeDeleted&&(e.options={include_deleted:!0}),e}var G=function(){function t(t,e,n){this._workspaceId=t,this._params=e,this._batchSize=n}return t.store=function(t,e,n,r){Q.store(t,e,n,r)},t.count=function(t,e){return Q.countFor(t,e)},t.prototype.iterator=function(){var t={},e=Q.firstBatchFor(this._workspaceId,this._params,this._batchSize),n=0;return{next:function r(){if(!e)return{done:!0};var i=e.objIds();if(n
2
2
  /*!
3
3
  * URI.js - Mutating URLs
4
4
  *
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0.rc2
4
+ version: 1.17.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Infopark Group GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-08 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable