@rest-hooks/normalizr
Advanced tools
Comparing version 8.2.0 to 8.2.1
@@ -6,2 +6,16 @@ # Change Log | ||
### [8.2.1](https://github.com/coinbase/rest-hooks/compare/@rest-hooks/normalizr@8.2.0-beta.2...@rest-hooks/normalizr@8.2.1) (2022-04-01) | ||
### 🐛 Bug Fix | ||
* Default optimistic race condition handling should assume in-order server response ([#1852](https://github.com/coinbase/rest-hooks/issues/1852)) ([cf38c3f](https://github.com/coinbase/rest-hooks/commit/cf38c3f67ff0041b528e9d8cf21d31704b76fc01)) | ||
### 📝 Documentation | ||
* **fix:** Restore version routes ([#1848](https://github.com/coinbase/rest-hooks/issues/1848)) ([72d81cd](https://github.com/coinbase/rest-hooks/commit/72d81cdfce7e20a0e583ff1f6cd854ca16801f9a)) | ||
## [8.2.0](https://github.com/coinbase/rest-hooks/compare/@rest-hooks/normalizr@8.1.0...@rest-hooks/normalizr@8.2.0) (2022-03-17) | ||
@@ -8,0 +22,0 @@ |
@@ -149,3 +149,3 @@ define(['exports'], (function (exports) { 'use strict'; | ||
Entity.useIncoming = function useIncoming(existingMeta, incomingMeta, existing, incoming) { | ||
return existingMeta.date <= incomingMeta.date; | ||
return existingMeta.fetchedAt <= incomingMeta.fetchedAt; | ||
} | ||
@@ -1155,7 +1155,7 @@ /** Creates new instance copying over defined values of arguments */ | ||
if (inStoreEntity) { | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2; | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5; | ||
var inStoreMeta = entityMeta[schemaKey][id]; | ||
var useIncoming = // we may have in store but not in meta; so this existance check is still important | ||
!inStoreMeta || schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
!inStoreMeta || (schema.useIncoming ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date); | ||
@@ -1174,9 +1174,13 @@ if (useIncoming) { | ||
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt), | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey2.date) | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0), | ||
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0) | ||
}; | ||
} else { | ||
var _meta$fetchedAt2; | ||
entities[schemaKey][id] = processedEntity; | ||
entityMeta[schemaKey][id] = { | ||
expiresAt: entityExpiresAt, | ||
date: meta.date | ||
date: meta.date, | ||
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date | ||
}; | ||
@@ -1252,3 +1256,4 @@ } | ||
date: Date.now(), | ||
expiresAt: Infinity | ||
expiresAt: Infinity, | ||
fetchedAt: 0 | ||
}; | ||
@@ -1255,0 +1260,0 @@ } |
@@ -150,3 +150,3 @@ var rest_hooks_normalizr = (function (exports) { | ||
Entity.useIncoming = function useIncoming(existingMeta, incomingMeta, existing, incoming) { | ||
return existingMeta.date <= incomingMeta.date; | ||
return existingMeta.fetchedAt <= incomingMeta.fetchedAt; | ||
} | ||
@@ -1156,7 +1156,7 @@ /** Creates new instance copying over defined values of arguments */ | ||
if (inStoreEntity) { | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2; | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5; | ||
var inStoreMeta = entityMeta[schemaKey][id]; | ||
var useIncoming = // we may have in store but not in meta; so this existance check is still important | ||
!inStoreMeta || schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
!inStoreMeta || (schema.useIncoming ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date); | ||
@@ -1175,9 +1175,13 @@ if (useIncoming) { | ||
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt), | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey2.date) | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0), | ||
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0) | ||
}; | ||
} else { | ||
var _meta$fetchedAt2; | ||
entities[schemaKey][id] = processedEntity; | ||
entityMeta[schemaKey][id] = { | ||
expiresAt: entityExpiresAt, | ||
date: meta.date | ||
date: meta.date, | ||
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date | ||
}; | ||
@@ -1253,3 +1257,4 @@ } | ||
date: Date.now(), | ||
expiresAt: Infinity | ||
expiresAt: Infinity, | ||
fetchedAt: 0 | ||
}; | ||
@@ -1256,0 +1261,0 @@ } |
@@ -1,1 +0,1 @@ | ||
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function o(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}var s=function(){function e(){}return e.toJSON=function(){return{name:this.name,schema:this.schema,key:this.key}},e.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)},e.useIncoming=function(e,t,n,r){return e.date<=t.date},e.merge=function(e,t){return Object.assign({},e,t)},e.fromJS=function(e){void 0===e&&(e={});var t=new this(e);return Object.assign(t,e),t},e.process=function(e){function t(t,n,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,n){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation&&Array.isArray(e)){var r="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nFirst three members: "+JSON.stringify(e.slice(0,3),null,2);if("warn"!==this.automaticValidation){var i=new Error(r);throw i.status=400,i}console.warn(r)}return Object.assign({},e)})),e.normalize=function(e,t,n,r,i,o){var s=this,a=this.process(e,t,n),u=this.pk(a,t,n);if(void 0!==u&&""!==u){var c=this.key;if(c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e})))return u;var f=this.validate(a);if(f){var l=new Error(f);throw l.status=400,l}return o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}})),i(this,a,u),u}if("production"!==process.env.NODE_ENV){var h=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value (processed): "+(a&&JSON.stringify(a,null,2))+"\n ");throw h.status=400,h}},e.validate=function(e){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n=new Set(Object.keys(this.defaults)),r=Object.keys(e),i=[[],[],[]],o=i[0],s=i[1],a=i[2],u=0,c=r;u<c.length;u++){var f=c[u];n.has(f)?o.push(f):a.push(f)}for(var l,h=t(n);!(l=h()).done;){var p=l.value;o.includes(p)||s.push(p)}if(n.size){var d=Math.max(r.length/2,1)<=a.length&&n.size>Math.max(a.length,2)&&Math.pow(o.length,1.5)/2<=a.length,y=o.length<Math.min(1,n.size/2);if(d||y){var m="",v="substantially different than expected keys";y&&(m+="\n Missing: "+s,v="no matching keys found"),d&&(m+="\n Unexpected keys: "+a,v="a large number of unexpected keys found");var g="Attempted to initialize "+this.name+" with "+v+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+o+m+"\n Value (processed): "+JSON.stringify(e,null,2);if(!(o.length>=4&&d||"warn"===this.automaticValidation))return g;console.warn(g)}}}if("production"!==process.env.NODE_ENV)for(var b=0,O=Object.keys(this.schema);b<O.length;b++){var k=O[b];if(!Object.prototype.hasOwnProperty.call(e,k)&&!Object.prototype.hasOwnProperty.call(this.defaults,k))return"Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(this.defaults)+"\n Schema key(missing): "+k+"\n "}},e.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);if(i&&t[this.key])return t[this.key][i][e[0][i]]}},e.expiresAt=function(e,t){return e.expiresAt},e.denormalize=function(e,t){var n=this;if(i(e)){if(this.validate(e.toJS()))return[void 0,!1,!0];null==t.setLocal||t.setLocal(e);var r=o(this.schema,e,t),s=r[0],a=r[1],u=r[2];return[this.fromJS(s.toObject()),a,u]}if(this.validate(e))return[void 0,!1,!0];var c=this.fromJS(e);null==t.setLocal||t.setLocal(c);var f=!1;return Object.keys(this.schema).forEach((function(r){var i=n.schema[r],o=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0,s=t(o,i),a=s[0];!s[2]||Object.prototype.hasOwnProperty.call(e,r)&&!n.defaults[r]||(f=!0),Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==a&&n.set(c,r,a)})),[c,!0,f]},e.set=function(e,t,n){e[t]=n},r(e,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}},{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();if(s.schema={},"production"!==process.env.NODE_ENV){var a=s.fromJS;s.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return a.call(this,e)}}function u(e){return null!==e&&void 0!==e.pk}var c=Symbol("ENTITY WAS DELETED");function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,f(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function d(e,t,n){return(d=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&f(i,n.prototype),i}).apply(null,arguments)}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)})(e)}var m=function(){this.children=new WeakMap},v=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return l(t,e),t}(y(Error)),g=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new v;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new m,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),b=function(){function e(e,t){this.schema=void 0,t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=e},t.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},t.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},t.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},t.denormalizeValue=function(e,t){if(void 0===e)return[e,!1,!1];var n=i(e)?e.get("schema"):e.schema;return this.isSingleSchema||n?t((this.isSingleSchema?void 0:i(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[n]):[e,!0,!1]},r(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),O=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},k=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},w=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},j=function(e,t,n,r,i,o,s){return e=O(e),k(t).map((function(t,a){return i(t,n,r,e,o,s)}))},E=function(e,t,n){e=O(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(w).map((function(e){return e[0]})):t,i,r]};function S(e,t,n,r){}var _=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return k(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(w).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(b),A=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},z=function(e,t,n){if(i(t))return o(e,t,n);var r=Object.assign({},t),s=!0,a=!1;return Object.keys(e).forEach((function(t){var i=n(r[t],e[t]),o=i[0],u=i[1],c=i[2];void 0!==r[t]&&(r[t]=o),c&&(a=!0),u||(s=!1)})),[r,s,a]};function N(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var x=function(){function e(e){this.schema=void 0,this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return A.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return z.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return N(this.schema,e,t,n)},e}(),V=Symbol("draft"),D=function(e,t,n,r,i,o,s,a){var u=r(e,t);if(u===c)return[void 0,!0,!0];if("production"!==process.env.NODE_ENV&&"symbol"==typeof u&&u.toString().includes("DELETED"))throw new Error("Unrecognized symbol detected.\nMake sure you do not have multiple versions of @rest-hooks/normalizr installed.");if("object"!=typeof u||null===u)return[u,!1,!1];void 0===i[t.key]&&(i[t.key]={});var f=!0,l=!1;if(i[t.key][e]){if(Object.prototype.hasOwnProperty.call(i[t.key][e],V))return a.i=i[t.key][e].i,[i[t.key][e][V],f,l];s.push(u)}else{var h=s.length;s.push(u);var p=function(e){var t=e.og||e,n=function(e,n){return t(e,n)};return n.og=e,n}(n);p.setLocal=function(n){var r;return i[t.key][e]=((r={})[V]=n,r.i=h,r)};var d=function(e,t,n){e[t.key]||(e[t.key]={});e[t.key][n]||(e[t.key][n]=new g);return e[t.key][n]}(o,t,e),y=t.denormalize(u,p);i[t.key][e]=y[0],f=y[1],l=y[2];var m=s.slice(-1===a.i?h:a.i);d.has(m)?i[t.key][e]=d.get(m):d.set(m,i[t.key][e]),a.i===h&&(a.i=-1)}return[i[t.key][e],f,l]},P=function(e){var t=i(e);return function(n,r){var i,o=r.key;return"object"==typeof n?n:t?e.getIn([o,n]):null==(i=e[o])?void 0:i[n]}},J=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new g),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=function(e,t,n,r){var i=P(e),o=[],s={i:-1};function a(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?E:z)(n,e,a)}return null===e?[e,!0,!1]:u(n)?void 0===e?[e,!1,!1]:D(e,n,a,i,r,t,o,s):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}return function(e,t){var r=a(e,t);return Object(e)!==e?r:(o.push(e),n.has(o)?[n.get(o),r[1],r[2]]:(n.set(o,r[0]),r))}}(n,r,i,o);return[].concat(s(e,t),[o])};var I=function e(t,n,r,i,o,s){return t&&i?i.normalize&&"function"==typeof i.normalize?"object"!=typeof t?t:i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):"object"!=typeof t||"object"!=typeof i?t:(Array.isArray(i)?j:A)(i,t,n,r,e,o,s):t};var M=function(e,n,r,i,o,s){if(void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={}),void 0===s&&(s={date:Date.now(),expiresAt:1/0}),void 0===n)return{entities:r,indexes:i,result:e,entityMeta:o};var a=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(n);if(null===e||typeof e!==a&&(void 0===n.key||"string"!=typeof e)){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(n,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+a+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(n,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+a+'", found "'+(null===e?"null":typeof e)+'".')}var u=Object.assign({},r),f=Object.assign({},i),l=Object.assign({},o),h=function(e,n,r,i,o,s){return function(a,u,f){var l=a.key;l in e||(e[l]={},r[l]=Object.assign({},r[l]),o[l]=Object.assign({},o[l]));var h=e[l][f];if(h)e[l][f]=a.merge(h,u);else{var p=a.expiresAt?a.expiresAt(s,u):s.expiresAt,d=r[l][f];if(d){var y,m,v=o[l][f],g=!v||a.useIncoming(v,s,d,u);e[l][f]=g?typeof u!=typeof d?u:a.merge(d,u):d,o[l][f]={expiresAt:Math.max(p,null==(y=o[l][f])?void 0:y.expiresAt),date:Math.max(s.date,null==(m=o[l][f])?void 0:m.date)}}else e[l][f]=u,o[l][f]={expiresAt:p,date:s.date}}if(Array.isArray(a.indexes)){var b=e[l][f];l in n||(n[l]={},i[l]=Object.assign({},i[l]));for(var O,k=t(a.indexes);!(O=k()).done;){var w=O.value;w in n[l]||(i[l][w]=n[l][w]={});var j=n[l][w];h&&delete j[h[w]],r[l]&&r[l][f]&&r[l][f][w]!==b[w]&&(j[r[l][f][w]]=c),w in b?j[b[w]]=f:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+w+"\nEntity: "+JSON.stringify(b,void 0,2))}}r[l][f]=e[l][f]}}({},{},u,f,l,s);return{entities:u,indexes:f,result:I(e,e,void 0,n,h,{}),entityMeta:l}},T=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}l(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){if(e[0]){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}}},t}(b),L=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(b),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){var s=this._entity.process(e,t,n),a=this._entity.pk(s,t,n);if("production"!==process.env.NODE_ENV&&(void 0===a||""===a)){var u,f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(u=this._entity.name)?u:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}return i(this,c,a),a},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},t.useIncoming=function(e,t,n,r){return e.date<=t.date},r(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),R=Object.freeze({__proto__:null,Union:T,Values:L,Array:_,Object:x,Delete:U});function B(e,t,n){return function(e){return!!e&&"function"==typeof e.infer}(e)?e.infer(t,n,B):"object"==typeof e&&e?(Array.isArray(e)?S:N)(e,t,n,B):e}export{c as DELETED,s as Entity,g as WeakListMap,J as denormalize,B as inferResults,u as isEntity,M as normalize,R as schema}; | ||
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function o(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}var s=function(){function e(){}return e.toJSON=function(){return{name:this.name,schema:this.schema,key:this.key}},e.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)},e.useIncoming=function(e,t,n,r){return e.fetchedAt<=t.fetchedAt},e.merge=function(e,t){return Object.assign({},e,t)},e.fromJS=function(e){void 0===e&&(e={});var t=new this(e);return Object.assign(t,e),t},e.process=function(e){function t(t,n,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,n){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation&&Array.isArray(e)){var r="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nFirst three members: "+JSON.stringify(e.slice(0,3),null,2);if("warn"!==this.automaticValidation){var i=new Error(r);throw i.status=400,i}console.warn(r)}return Object.assign({},e)})),e.normalize=function(e,t,n,r,i,o){var s=this,a=this.process(e,t,n),u=this.pk(a,t,n);if(void 0!==u&&""!==u){var c=this.key;if(c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e})))return u;var f=this.validate(a);if(f){var l=new Error(f);throw l.status=400,l}return o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}})),i(this,a,u),u}if("production"!==process.env.NODE_ENV){var h=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value (processed): "+(a&&JSON.stringify(a,null,2))+"\n ");throw h.status=400,h}},e.validate=function(e){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n=new Set(Object.keys(this.defaults)),r=Object.keys(e),i=[[],[],[]],o=i[0],s=i[1],a=i[2],u=0,c=r;u<c.length;u++){var f=c[u];n.has(f)?o.push(f):a.push(f)}for(var l,h=t(n);!(l=h()).done;){var p=l.value;o.includes(p)||s.push(p)}if(n.size){var d=Math.max(r.length/2,1)<=a.length&&n.size>Math.max(a.length,2)&&Math.pow(o.length,1.5)/2<=a.length,y=o.length<Math.min(1,n.size/2);if(d||y){var m="",v="substantially different than expected keys";y&&(m+="\n Missing: "+s,v="no matching keys found"),d&&(m+="\n Unexpected keys: "+a,v="a large number of unexpected keys found");var g="Attempted to initialize "+this.name+" with "+v+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+o+m+"\n Value (processed): "+JSON.stringify(e,null,2);if(!(o.length>=4&&d||"warn"===this.automaticValidation))return g;console.warn(g)}}}if("production"!==process.env.NODE_ENV)for(var b=0,O=Object.keys(this.schema);b<O.length;b++){var k=O[b];if(!Object.prototype.hasOwnProperty.call(e,k)&&!Object.prototype.hasOwnProperty.call(this.defaults,k))return"Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(this.defaults)+"\n Schema key(missing): "+k+"\n "}},e.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);if(i&&t[this.key])return t[this.key][i][e[0][i]]}},e.expiresAt=function(e,t){return e.expiresAt},e.denormalize=function(e,t){var n=this;if(i(e)){if(this.validate(e.toJS()))return[void 0,!1,!0];null==t.setLocal||t.setLocal(e);var r=o(this.schema,e,t),s=r[0],a=r[1],u=r[2];return[this.fromJS(s.toObject()),a,u]}if(this.validate(e))return[void 0,!1,!0];var c=this.fromJS(e);null==t.setLocal||t.setLocal(c);var f=!1;return Object.keys(this.schema).forEach((function(r){var i=n.schema[r],o=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0,s=t(o,i),a=s[0];!s[2]||Object.prototype.hasOwnProperty.call(e,r)&&!n.defaults[r]||(f=!0),Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==a&&n.set(c,r,a)})),[c,!0,f]},e.set=function(e,t,n){e[t]=n},r(e,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}},{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();if(s.schema={},"production"!==process.env.NODE_ENV){var a=s.fromJS;s.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return a.call(this,e)}}function u(e){return null!==e&&void 0!==e.pk}var c=Symbol("ENTITY WAS DELETED");function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,f(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function d(e,t,n){return(d=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&f(i,n.prototype),i}).apply(null,arguments)}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)})(e)}var m=function(){this.children=new WeakMap},v=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return l(t,e),t}(y(Error)),g=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new v;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new m,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),b=function(){function e(e,t){this.schema=void 0,t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=e},t.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},t.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},t.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},t.denormalizeValue=function(e,t){if(void 0===e)return[e,!1,!1];var n=i(e)?e.get("schema"):e.schema;return this.isSingleSchema||n?t((this.isSingleSchema?void 0:i(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[n]):[e,!0,!1]},r(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),O=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},k=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},w=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},j=function(e,t,n,r,i,o,s){return e=O(e),k(t).map((function(t,a){return i(t,n,r,e,o,s)}))},E=function(e,t,n){e=O(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(w).map((function(e){return e[0]})):t,i,r]};function S(e,t,n,r){}var A=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return k(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(w).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(b),_=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},z=function(e,t,n){if(i(t))return o(e,t,n);var r=Object.assign({},t),s=!0,a=!1;return Object.keys(e).forEach((function(t){var i=n(r[t],e[t]),o=i[0],u=i[1],c=i[2];void 0!==r[t]&&(r[t]=o),c&&(a=!0),u||(s=!1)})),[r,s,a]};function x(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var N=function(){function e(e){this.schema=void 0,this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return z.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return x(this.schema,e,t,n)},e}(),V=Symbol("draft"),D=function(e,t,n,r,i,o,s,a){var u=r(e,t);if(u===c)return[void 0,!0,!0];if("production"!==process.env.NODE_ENV&&"symbol"==typeof u&&u.toString().includes("DELETED"))throw new Error("Unrecognized symbol detected.\nMake sure you do not have multiple versions of @rest-hooks/normalizr installed.");if("object"!=typeof u||null===u)return[u,!1,!1];void 0===i[t.key]&&(i[t.key]={});var f=!0,l=!1;if(i[t.key][e]){if(Object.prototype.hasOwnProperty.call(i[t.key][e],V))return a.i=i[t.key][e].i,[i[t.key][e][V],f,l];s.push(u)}else{var h=s.length;s.push(u);var p=function(e){var t=e.og||e,n=function(e,n){return t(e,n)};return n.og=e,n}(n);p.setLocal=function(n){var r;return i[t.key][e]=((r={})[V]=n,r.i=h,r)};var d=function(e,t,n){e[t.key]||(e[t.key]={});e[t.key][n]||(e[t.key][n]=new g);return e[t.key][n]}(o,t,e),y=t.denormalize(u,p);i[t.key][e]=y[0],f=y[1],l=y[2];var m=s.slice(-1===a.i?h:a.i);d.has(m)?i[t.key][e]=d.get(m):d.set(m,i[t.key][e]),a.i===h&&(a.i=-1)}return[i[t.key][e],f,l]},P=function(e){var t=i(e);return function(n,r){var i,o=r.key;return"object"==typeof n?n:t?e.getIn([o,n]):null==(i=e[o])?void 0:i[n]}},J=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new g),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=function(e,t,n,r){var i=P(e),o=[],s={i:-1};function a(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?E:z)(n,e,a)}return null===e?[e,!0,!1]:u(n)?void 0===e?[e,!1,!1]:D(e,n,a,i,r,t,o,s):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}return function(e,t){var r=a(e,t);return Object(e)!==e?r:(o.push(e),n.has(o)?[n.get(o),r[1],r[2]]:(n.set(o,r[0]),r))}}(n,r,i,o);return[].concat(s(e,t),[o])};var I=function e(t,n,r,i,o,s){return t&&i?i.normalize&&"function"==typeof i.normalize?"object"!=typeof t?t:i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):"object"!=typeof t||"object"!=typeof i?t:(Array.isArray(i)?j:_)(i,t,n,r,e,o,s):t};var M=function(e,n,r,i,o,s){if(void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={}),void 0===s&&(s={date:Date.now(),expiresAt:1/0,fetchedAt:0}),void 0===n)return{entities:r,indexes:i,result:e,entityMeta:o};var a=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(n);if(null===e||typeof e!==a&&(void 0===n.key||"string"!=typeof e)){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(n,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+a+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(n,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+a+'", found "'+(null===e?"null":typeof e)+'".')}var u=Object.assign({},r),f=Object.assign({},i),l=Object.assign({},o),h=function(e,n,r,i,o,s){return function(a,u,f){var l=a.key;l in e||(e[l]={},r[l]=Object.assign({},r[l]),o[l]=Object.assign({},o[l]));var h=e[l][f];if(h)e[l][f]=a.merge(h,u);else{var p=a.expiresAt?a.expiresAt(s,u):s.expiresAt,d=r[l][f];if(d){var y,m,v,g,b,O,k=o[l][f],w=!k||(a.useIncoming?a.useIncoming(k,s,d,u):o[l][f].date<=s.date);e[l][f]=w?typeof u!=typeof d?u:a.merge(d,u):d,o[l][f]={expiresAt:Math.max(p,null==(y=o[l][f])?void 0:y.expiresAt),date:Math.max(s.date,null!=(m=null==(v=o[l][f])?void 0:v.date)?m:0),fetchedAt:Math.max(null!=(g=s.fetchedAt)?g:0,null!=(b=null==(O=o[l][f])?void 0:O.fetchedAt)?b:0)}}else{var j;e[l][f]=u,o[l][f]={expiresAt:p,date:s.date,fetchedAt:null!=(j=s.fetchedAt)?j:s.date}}}if(Array.isArray(a.indexes)){var E=e[l][f];l in n||(n[l]={},i[l]=Object.assign({},i[l]));for(var S,A=t(a.indexes);!(S=A()).done;){var _=S.value;_ in n[l]||(i[l][_]=n[l][_]={});var z=n[l][_];h&&delete z[h[_]],r[l]&&r[l][f]&&r[l][f][_]!==E[_]&&(z[r[l][f][_]]=c),_ in E?z[E[_]]=f:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+_+"\nEntity: "+JSON.stringify(E,void 0,2))}}r[l][f]=e[l][f]}}({},{},u,f,l,s);return{entities:u,indexes:f,result:I(e,e,void 0,n,h,{}),entityMeta:l}},T=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}l(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){if(e[0]){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}}},t}(b),L=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(b),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){var s=this._entity.process(e,t,n),a=this._entity.pk(s,t,n);if("production"!==process.env.NODE_ENV&&(void 0===a||""===a)){var u,f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(u=this._entity.name)?u:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}return i(this,c,a),a},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},t.useIncoming=function(e,t,n,r){return e.date<=t.date},r(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),R=Object.freeze({__proto__:null,Union:T,Values:L,Array:A,Object:N,Delete:U});function B(e,t,n){return function(e){return!!e&&"function"==typeof e.infer}(e)?e.infer(t,n,B):"object"==typeof e&&e?(Array.isArray(e)?S:x)(e,t,n,B):e}export{c as DELETED,s as Entity,g as WeakListMap,J as denormalize,B as inferResults,u as isEntity,M as normalize,R as schema}; |
@@ -96,3 +96,3 @@ 'use strict'; | ||
static useIncoming(existingMeta, incomingMeta, existing, incoming) { | ||
return existingMeta.date <= incomingMeta.date; | ||
return existingMeta.fetchedAt <= incomingMeta.fetchedAt; | ||
} | ||
@@ -908,7 +908,7 @@ /** Creates new instance copying over defined values of arguments */ | ||
if (inStoreEntity) { | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2; | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5; | ||
const inStoreMeta = entityMeta[schemaKey][id]; | ||
const useIncoming = // we may have in store but not in meta; so this existance check is still important | ||
!inStoreMeta || schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
!inStoreMeta || (schema.useIncoming ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date); | ||
@@ -927,9 +927,13 @@ if (useIncoming) { | ||
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt), | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey2.date) | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0), | ||
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0) | ||
}; | ||
} else { | ||
var _meta$fetchedAt2; | ||
entities[schemaKey][id] = processedEntity; | ||
entityMeta[schemaKey][id] = { | ||
expiresAt: entityExpiresAt, | ||
date: meta.date | ||
date: meta.date, | ||
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date | ||
}; | ||
@@ -989,3 +993,4 @@ } | ||
date: Date.now(), | ||
expiresAt: Infinity | ||
expiresAt: Infinity, | ||
fetchedAt: 0 | ||
}) => { | ||
@@ -992,0 +997,0 @@ // no schema means we don't process at all |
@@ -153,3 +153,3 @@ (function (global, factory) { | ||
Entity.useIncoming = function useIncoming(existingMeta, incomingMeta, existing, incoming) { | ||
return existingMeta.date <= incomingMeta.date; | ||
return existingMeta.fetchedAt <= incomingMeta.fetchedAt; | ||
} | ||
@@ -1159,7 +1159,7 @@ /** Creates new instance copying over defined values of arguments */ | ||
if (inStoreEntity) { | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2; | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5; | ||
var inStoreMeta = entityMeta[schemaKey][id]; | ||
var useIncoming = // we may have in store but not in meta; so this existance check is still important | ||
!inStoreMeta || schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
!inStoreMeta || (schema.useIncoming ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date); | ||
@@ -1178,9 +1178,13 @@ if (useIncoming) { | ||
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt), | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey2.date) | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0), | ||
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0) | ||
}; | ||
} else { | ||
var _meta$fetchedAt2; | ||
entities[schemaKey][id] = processedEntity; | ||
entityMeta[schemaKey][id] = { | ||
expiresAt: entityExpiresAt, | ||
date: meta.date | ||
date: meta.date, | ||
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date | ||
}; | ||
@@ -1256,3 +1260,4 @@ } | ||
date: Date.now(), | ||
expiresAt: Infinity | ||
expiresAt: Infinity, | ||
fetchedAt: 0 | ||
}; | ||
@@ -1259,0 +1264,0 @@ } |
@@ -42,3 +42,3 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
static useIncoming(existingMeta, incomingMeta, existing, incoming) { | ||
return existingMeta.date <= incomingMeta.date; | ||
return existingMeta.fetchedAt <= incomingMeta.fetchedAt; | ||
} | ||
@@ -331,2 +331,2 @@ /** Creates new instance copying over defined values of arguments */ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbnRpdGllcy9FbnRpdHkudHMiXSwibmFtZXMiOlsiaXNJbW11dGFibGUiLCJkZW5vcm1hbGl6ZUltbXV0YWJsZSIsIkVudGl0eSIsInRvSlNPTiIsIm5hbWUiLCJzY2hlbWEiLCJrZXkiLCJwcm9jZXNzIiwiZW52IiwiTk9ERV9FTlYiLCJFcnJvciIsInBrIiwidmFsdWUiLCJwYXJlbnQiLCJwcm90b3R5cGUiLCJjYWxsIiwidXNlSW5jb21pbmciLCJleGlzdGluZ01ldGEiLCJpbmNvbWluZ01ldGEiLCJleGlzdGluZyIsImluY29taW5nIiwiZGF0ZSIsIm1lcmdlIiwiZnJvbUpTIiwicHJvcHMiLCJpbnN0YW5jZSIsIk9iamVjdCIsImFzc2lnbiIsImlucHV0IiwiYXV0b21hdGljVmFsaWRhdGlvbiIsIkFycmF5IiwiaXNBcnJheSIsImVycm9yTWVzc2FnZSIsIkpTT04iLCJzdHJpbmdpZnkiLCJzbGljZSIsImVycm9yIiwic3RhdHVzIiwiY29uc29sZSIsIndhcm4iLCJub3JtYWxpemUiLCJ2aXNpdCIsImFkZEVudGl0eSIsInZpc2l0ZWRFbnRpdGllcyIsInByb2Nlc3NlZEVudGl0eSIsImlkIiwidW5kZWZpbmVkIiwiZW50aXR5VHlwZSIsInNvbWUiLCJlbnRpdHkiLCJ2YWxpZGF0ZSIsInB1c2giLCJrZXlzIiwiZm9yRWFjaCIsImhhc093blByb3BlcnR5Iiwia2V5c09mUmVjb3JkIiwiU2V0IiwiZGVmYXVsdHMiLCJrZXlzT2ZQ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0aW9uIGZyb21KUzxUIGV4dGVuZHMgdHlwZW9mIEVudGl0eT4oXG4gICAgdGhpczogVCxcbiAgICBwcm9wczogUGFydGlhbDxBYnN0cmFjdEluc3RhbmNlVHlwZTxUPj4sXG4gICk6IEFic3RyYWN0SW5zdGFuY2VUeXBlPFQ+IHtcbiAgICBpZiAoKHRoaXMgYXMgYW55KS5wcm90b3R5cGUucGsgPT09IHVuZGVmaW5lZClcbiAgICAgIHRocm93IG5ldyBFcnJvcignY2Fubm90IGNvbnN0cnVjdCBvbiBhYnN0cmFjdCB0eXBlcycpO1xuICAgIHJldHVybiBzdXBlckZyb20uY2FsbCh0aGlzLCBwcm9wcykgYXMgYW55O1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNFbnRpdHkoc2NoZW1hOiBTY2hlbWEpOiBzY2hlbWEgaXMgdHlwZW9mIEVudGl0eSB7XG4gIHJldHVybiBzY2hlbWEgIT09IG51bGwgJiYgKHNjaGVtYSBhcyBhbnkpLnBrICE9PSB1bmRlZmluZWQ7XG59XG5cbmZ1bmN0aW9uIGluZGV4RnJvbVBhcmFtczxJIGV4dGVuZHMgc3RyaW5nPihcbiAgcGFyYW1zOiBSZWFkb25seTxvYmplY3Q+LFxuICBpbmRleGVzPzogUmVhZG9ubHk8SVtdPixcbikge1xuICBpZiAoIWluZGV4ZXMpIHJldHVybiB1bmRlZmluZWQ7XG4gIHJldHVybiBpbmRleGVzLmZpbmQoaW5kZXggPT5cbiAgICBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocGFyYW1zLCBpbmRleCksXG4gICk7XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbnRpdGllcy9FbnRpdHkudHMiXSwibmFtZXMiOlsiaXNJbW11dGFibGUiLCJkZW5vcm1hbGl6ZUltbXV0YWJsZSIsIkVudGl0eSIsInRvSlNP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5sZW5ndGg7XG4gICAgICAgIGNvbnN0IGZvdW5kTm90aGluZyA9IGZvdW5kLmxlbmd0aCA8IE1hdGgubWluKDEsIGtleXNPZlJlY29yZC5zaXplIC8gMik7XG4gICAgICAgIC8vIGlmIHdlIGZpbmQgbm90aGluZyAod2UgZXhwZWN0IGF0IGxlYXN0IG9uZSBtZW1iZXIgZm9yIGEgcGspXG4gICAgICAgIC8vIG9yIHdlIGZpbmQgdG9vIG1hbnkgdW5leHBlY3RlZCBtZW1iZXJzXG4gICAgICAgIGlmICh0b29NYW55VW5leHBlY3RlZCB8fCBmb3VuZE5vdGhpbmcpIHtcbiAgICAgICAgICBsZXQgZXh0cmEgPSAnJztcbiAgICAgICAgICBsZXQgcmVhc29uID0gJ3N1YnN0YW50aWFsbHkgZGlmZmVyZW50IHRoYW4gZXhwZWN0ZWQga2V5cyc7XG4gICAgICAgICAgaWYgKGZvdW5kTm90aGluZykge1xuICAgICAgICAgICAgZXh0cmEgKz0gYFxcbiAgICBNaXNzaW5nOiAke21pc3Npbmd9YDtcbiAgICAgICAgICAgIHJlYXNvbiA9ICdubyBtYXRjaGluZyBrZXlzIGZvdW5kJztcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHRvb01hbnlVbmV4cGVjdGVkKSB7XG4gICAgICAgICAgICBleHRyYSArPSBgXFxuICAgIFVuZXhwZWN0ZWQga2V5czogJHt1bmV4cGVjdGVkfWA7XG4gICAgICAgICAgICByZWFzb24gPSAnYSBsYXJnZSBudW1iZXIgb2YgdW5leHBlY3RlZCBrZXlzIGZvdW5kJztcbiAgICAgICAgICB9XG4gICAgICAgICAgY29uc3QgZXJyb3JNZXNzYWdlID0gYEF0dGVtcHRlZCB0byBpbml0aWFsaXplICR7XG4gICAgICAgICAgICB0aGlzLm5hbWVcbiAgICAgICAgICB9IHdpdGggJHtyZWFzb259XG5cbiAgVGhpcyBpcyBsaWtlbHkgZHVlIHRvIGEgbWFsZm9ybWVkIHJlc3BvbnNlLlxuICBUc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N0cnVjdCBvbiBhYnN0cmFjdCB0eXBlcycpO1xuICAgIHJldHVybiBzdXBlckZyb20uY2FsbCh0aGlzLCBwcm9wcykgYXMgYW55O1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNFbnRpdHkoc2NoZW1hOiBTY2hlbWEpOiBzY2hlbWEgaXMgdHlwZW9mIEVudGl0eSB7XG4gIHJldHVybiBzY2hlbWEgIT09IG51bGwgJiYgKHNjaGVtYSBhcyBhbnkpLnBrICE9PSB1bmRlZmluZWQ7XG59XG5cbmZ1bmN0aW9uIGluZGV4RnJvbVBhcmFtczxJIGV4dGVuZHMgc3RyaW5nPihcbiAgcGFyYW1zOiBSZWFkb25seTxvYmplY3Q+LFxuICBpbmRleGVzPzogUmVhZG9ubHk8SVtdPixcbikge1xuICBpZiAoIWluZGV4ZXMpIHJldHVybiB1bmRlZmluZWQ7XG4gIHJldHVybiBpbmRleGVzLmZpbmQoaW5kZXggPT5cbiAgICBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocGFyYW1zLCBpbmRleCksXG4gICk7XG59XG4iXX0= |
@@ -44,7 +44,7 @@ import { DELETED } from "./special.js"; | ||
if (inStoreEntity) { | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2; | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5; | ||
const inStoreMeta = entityMeta[schemaKey][id]; | ||
const useIncoming = // we may have in store but not in meta; so this existance check is still important | ||
!inStoreMeta || schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
!inStoreMeta || (schema.useIncoming ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date); | ||
@@ -63,9 +63,13 @@ if (useIncoming) { | ||
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt), | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey2.date) | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0), | ||
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0) | ||
}; | ||
} else { | ||
var _meta$fetchedAt2; | ||
entities[schemaKey][id] = processedEntity; | ||
entityMeta[schemaKey][id] = { | ||
expiresAt: entityExpiresAt, | ||
date: meta.date | ||
date: meta.date, | ||
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date | ||
}; | ||
@@ -124,3 +128,4 @@ } | ||
date: Date.now(), | ||
expiresAt: Infinity | ||
expiresAt: Infinity, | ||
fetchedAt: 0 | ||
}) => { | ||
@@ -182,2 +187,2 @@ // no schema means we don't process at all | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ub3JtYWxpemUudHMiXSwibmFtZXMiOlsiREVMRVRFRCIsIm5vcm1hbGl6ZSIsImFycmF5Tm9ybWFsaXplIiwib2JqZWN0Tm9ybWFsaXplIiwidmlzaXQiLCJ2YWx1ZSIsInBhcmVudCIsImtleSIsInNjaGVtYSIsImFkZEVudGl0eSIsInZpc2l0ZWRFbnRpdGllcyIsIm1ldGhvZCIsIkFycmF5IiwiaXNBcnJheSIsImFkZEVudGl0aWVzIiwiZW50aXRpZXMiLCJpbmRleGVzIiwiZXhpc3RpbmdFbnRpdGllcyIsImV4aXN0aW5nS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XG4gICAgICAgICAgICBlbnRpdGllc1tzY2hlbWFLZXldW2lkXSA9IHNjaGVtYS5tZXJnZShcbiAgICAgICAgICAgICAgaW5TdG9yZUVudGl0eSxcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkRW50aXR5LFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gPSBpblN0b3JlRW50aXR5O1xuICAgICAgICB9XG5cbiAgICAgICAgZW50aXR5TWV0YVtzY2hlbWFLZXldW2lkXSA9IHtcbiAgICAgICAgICBleHBpcmVzQXQ6IE1hdGgubWF4KFxuICAgICAgICAgICAgZW50aXR5RXhwaXJlc0F0LFxuICAgICAgICAgICAgZW50aXR5TWV0YVtzY2hlbWFLZXldW2lkXT8uZXhwaXJlc0F0LFxuICAgICAgICAgICksXG4gICAgICAgICAgZGF0ZTogTWF0aC5tYXgobWV0YS5kYXRlLCBlbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdPy5kYXRlKSxcbiAgICAgICAgfTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gcHJvY2Vzc2VkRW50aXR5O1xuICAgICAgICBlbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdID0ge1xuICAgICAgICAgIGV4cGlyZXNBdDogZW50aXR5RXhwaXJlc0F0LFxuICAgICAgICAgIGRhdGU6IG1ldGEuZGF0ZSxcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyB1cGRhdGUgaW5kZXhcbiAgICBpZiAoQXJyYXkuaXNBcnJheShzY2hlbWEuaW5kZXhlcykpIHtcbiAgICAgIGNvbnN0IGVudGl0eSA9IGVudGl0aWVzW3NjaGVtYUtleV1baWRdO1xuICAgICAgaWYgKCEoc2NoZW1hS2V5IGluIGluZGV4ZXMpKSB7XG4gICAgICAgIGluZGV4ZXNbc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kZXggPSB7IC4uLmV4aXN0aW5nSW5kZXhlcyB9O1xuICBjb25zdCBlbnRpdHlNZXRhOiBhbnkgPSB7IC4uLmV4aXN0aW5nRW50aXR5TWV0YSB9O1xuICBjb25zdCBhZGRFbnRpdHkgPSBhZGRFbnRpdGllcyhcbiAgICBuZXdFbnRpdGllcyxcbiAgICBuZXdJbmRleGVzLFxuICAgIGVudGl0aWVzLFxuICAgIGluZGV4ZXMsXG4gICAgZW50aXR5TWV0YSxcbiAgICBtZXRhLFxuICApO1xuICBjb25zdCB2aXNpdGVkRW50aXRpZXMgPSB7fTtcblxuICBjb25zdCByZXN1bHQgPSB2aXNpdChcbiAgICBpbnB1dCxcbiAgICBpbnB1dCxcbiAgICB1bmRlZmluZWQsXG4gICAgc2NoZW1hLFxuICAgIGFkZEVudGl0eSxcbiAgICB2aXNpdGVkRW50aXRpZXMsXG4gICk7XG4gIHJldHVybiB7IGVudGl0aWVzLCBpbmRleGVzLCByZXN1bHQsIGVudGl0eU1ldGEgfTtcbn07XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ub3JtYWxpemUudHMiXSwibmFtZXMiOlsiREVMRVRFRCIsIm5vcm1hbGl6ZSIsImFycmF5Tm9ybWFsaXplIiwib2JqZWN0Tm9ybWFsaXplIiwidmlzaXQiLCJ2YWx1ZSIsInBhcmVudCIsImtleSIsInNjaGVtYSIsImFkZEVudGl0eSIsInZpc2l0ZWRFbnRpdGllcyIsIm1ldGhvZCIsIkFycmF5IiwiaXNBcnJheSIsImFkZEVudGl0aWVzIiwiZW50aXRpZXMiLCJpbmRleGVzIiwiZXhpc3RpbmdFbnRpdGllcyIsImV4aXN0aW5nSW5kZXhlcyIsImVudGl0eU1ldGEiLCJtZXRhIiwicHJvY2Vzc2VkRW50aXR5IiwiaWQiLCJzY2hlbWFLZXkiLCJleGlzdGluZ0VudGl0eSIsIm1lcmdlIiwi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cmVNZXRhID0gZW50aXR5TWV0YVtzY2hlbWFLZXldW2lkXTtcbiAgICAgICAgY29uc3QgdXNlSW5jb21pbmcgPVxuICAgICAgICAgIC8vIHdlIG1heSBoYXZlIGluIHN0b3JlIGJ1dCBub3QgaW4gbWV0YTsgc28gdGhpcyBleGlzdGFuY2UgY2hlY2sgaXMgc3RpbGwgaW1wb3J0YW50XG4gICAgICAgICAgIWluU3RvcmVNZXRhIHx8XG4gICAgICAgICAgKHNjaGVtYS51c2VJbmNvbWluZ1xuICAgICAgICAgICAgPyBzY2hlbWEudXNlSW5jb21pbmcoXG4gICAgICAgICAgICAgICAgaW5TdG9yZU1ldGEsXG4gICAgICAgICAgICAgICAgbWV0YSxcbiAgICAgICAgICAgICAgICBpblN0b3JlRW50aXR5LFxuICAgICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgOiBlbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdLmRhdGUgPD0gbWV0YS5kYXRlKTtcbiAgICAgICAgaWYgKHVzZUluY29taW5nKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBwcm9jZXNzZWRFbnRpdHkgIT09IHR5cGVvZiBpblN0b3JlRW50aXR5KSB7XG4gICAgICAgICAgICBlbnRpdGllc1tzY2hlbWFLZXldW2lkXSA9IHByb2Nlc3NlZEVudGl0eTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gPSBzY2hlbWEubWVyZ2UoXG4gICAgICAgICAgICAgIGluU3RvcmVFbnRpdHksXG4gICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gaW5TdG9yZUVudGl0eTtcbiAgICAgICAgfVxuXG4gICAgICAgIGVudG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leCA9IHsgLi4uZXhpc3RpbmdJbmRleGVzIH07XG4gIGNvbnN0IGVudGl0eU1ldGE6IGFueSA9IHsgLi4uZXhpc3RpbmdFbnRpdHlNZXRhIH07XG4gIGNvbnN0IGFkZEVudGl0eSA9IGFkZEVudGl0aWVzKFxuICAgIG5ld0VudGl0aWVzLFxuICAgIG5ld0luZGV4ZXMsXG4gICAgZW50aXRpZXMsXG4gICAgaW5kZXhlcyxcbiAgICBlbnRpdHlNZXRhLFxuICAgIG1ldGEsXG4gICk7XG4gIGNvbnN0IHZpc2l0ZWRFbnRpdGllcyA9IHt9O1xuXG4gIGNvbnN0IHJlc3VsdCA9IHZpc2l0KFxuICAgIGlucHV0LFxuICAgIGlucHV0LFxuICAgIHVuZGVmaW5lZCxcbiAgICBzY2hlbWEsXG4gICAgYWRkRW50aXR5LFxuICAgIHZpc2l0ZWRFbnRpdGllcyxcbiAgKTtcbiAgcmV0dXJuIHsgZW50aXRpZXMsIGluZGV4ZXMsIHJlc3VsdCwgZW50aXR5TWV0YSB9O1xufTtcbiJdfQ== |
@@ -79,2 +79,2 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWFzL0RlbGV0ZS50cyJdLCJuYW1lcyI6WyJERUxFVEVEIiwiRGVsZXRlIiwiY29uc3RydWN0b3IiLCJlbnRpdHkiLCJwcm9jZXNzIiwiZW52IiwiTk9ERV9FTlYiLCJFcnJvciIsIl9lbnRpdHkiLCJrZXkiLCJub3JtYWxpemUiLCJpbnB1dCIsInBhcmVudCIsInZpc2l0IiwiYWRkRW50aXR5IiwidmlzaXRlZEVudGl0aWVzIiwicHJvY2Vzc2VkRW50aXR5IiwiaWQiLCJwayIsInVuZGVmaW5lZCIsImVycm9yIiwibmFtZSIsIkpTT04iLCJzdHJpbmdpZnkiLCJzdGF0dXMiLC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udmlzaXQoaWQsIHRoaXMuX2VudGl0eSkgYXMgYW55O1xuICB9XG5cbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgX2Rlbm9ybWFsaXplTnVsbGFibGUoKTogW1xuICAgIEFic3RyYWN0SW5zdGFuY2VUeXBlPEU+IHwgdW5kZWZpbmVkLFxuICAgIGJvb2xlYW4sXG4gICAgZmFsc2UsXG4gIF0ge1xuICAgIHJldHVybiBbXSBhcyBhbnk7XG4gIH1cblxuICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICBfbm9ybWFsaXplTnVsbGFibGUoKTogc3RyaW5nIHwgdW5kZWZpbmVkIHtcbiAgICByZXR1cm4gW10gYXMgYW55O1xuICB9XG5cbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgbWVyZ2UoZXhpc3Rpbmc6IGFueSwgaW5jb21pbmc6IGFueSkge1xuICAgIHJldHVybiBpbmNvbWluZztcbiAgfVxuXG4gIHVzZUluY29taW5nKFxuICAgIGV4aXN0aW5nTWV0YTogeyBkYXRlOiBudW1iZXI7IGZldGNoZWRBdDogbnVtYmVyIH0sXG4gICAgaW5jb21pbmdNZXRhOiB7IGRhdGU6IG51bWJlcjsgZmV0Y2hlZEF0OiBudW1iZXIgfSxcbiAgICBleGlzdGluZzogYW55LFxuICAgIGluY29taW5nOiBhbnksXG4gICkge1xuICAgIHJldHVybiBleGlzdGluZ01ldGEuZGF0ZSA8PSBpbmNvbWluZ01ldGEuZGF0ZTtcbiAgfVxufVxuIl19 |
@@ -50,4 +50,6 @@ import * as schema from "../schema"; | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): boolean; | ||
@@ -71,2 +73,3 @@ /** Creates new instance copying over defined values of arguments */ | ||
date: number; | ||
fetchedAt: number; | ||
}, input: any): number; | ||
@@ -73,0 +76,0 @@ static denormalize<T extends typeof Entity>(this: T, input: Readonly<Partial<AbstractInstanceType<T>>>, unvisit: schema.UnvisitFunction): [denormalized: AbstractInstanceType<T>, found: boolean, suspend: boolean]; |
@@ -42,3 +42,3 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
static useIncoming(existingMeta, incomingMeta, existing, incoming) { | ||
return existingMeta.date <= incomingMeta.date; | ||
return existingMeta.fetchedAt <= incomingMeta.fetchedAt; | ||
} | ||
@@ -334,2 +334,2 @@ /** Creates new instance copying over defined values of arguments */ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbnRpdGllcy9FbnRpdHkudHMiXSwibmFtZXMiOlsiaXNJbW11dGFibGUiLCJkZW5vcm1hbGl6ZUltbXV0YWJsZSIsIkVudGl0eSIsInRvSlNPTiIsIm5hbWUiLCJzY2hlbWEiLCJrZXkiLCJwcm9jZXNzIiwiZW52IiwiTk9ERV9FTlYiLCJFcnJvciIsInBrIiwidmFsdWUiLCJwYXJlbnQiLCJwcm90b3R5cGUiLCJjYWxsIiwidXNlSW5jb21pbmciLCJleGlzdGluZ01ldGEiLCJpbmNvbWluZ01ldGEiLCJleGlzdGluZyIsImluY29taW5nIiwiZGF0ZSIsIm1lcmdlIiwiZnJvbUpTIiwicHJvcHMiLCJpbnN0YW5jZSIsIk9iamVjdCIsImFzc2lnbiIsImlucHV0IiwiYXV0b21hdGljVmFsaWRhdGlvbiIsIkFycmF5IiwiaXNBcnJheSIsImVycm9yTWVzc2FnZSIsIkpTT04iLCJzdHJpbmdpZnkiLCJzbGljZSIsImVycm9yIiwic3RhdHVzIiwiY29uc29sZSIsIndhcm4iLCJub3JtYWxpemUiLCJ2aXNpdCIsImFkZEVudGl0eSIsInZpc2l0ZWRFbnRpdGllcyIsInByb2Nlc3NlZEVudGl0eSIsImlkIiwidW5kZWZpbmVkIiwiZW50aXR5VHlwZSIsInNvbWUiLCJlbnRpdHkiLCJ2YWx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QgdXNpbmcgVHlwZVNjcmlwdCB0aGlzIGlzIGEgZ29vZCBjYXRjaCB0byBlbnN1cmUgdGhleSBhcmUgZGVmaW5pbmdcbiAgLy8gdGhlIGFic3RyYWN0IG1lbWJlcnNcbiAgRW50aXR5LmZyb21KUyA9IGZ1bmN0aW9uIGZyb21KUzxUIGV4dGVuZHMgdHlwZW9mIEVudGl0eT4oXG4gICAgdGhpczogVCxcbiAgICBwcm9wczogUGFydGlhbDxBYnN0cmFjdEluc3RhbmNlVHlwZTxUPj4sXG4gICk6IEFic3RyYWN0SW5zdGFuY2VUeXBlPFQ+IHtcbiAgICBpZiAoKHRoaXMgYXMgYW55KS5wcm90b3R5cGUucGsgPT09IHVuZGVmaW5lZClcbiAgICAgIHRocm93IG5ldyBFcnJvcignY2Fubm90IGNvbnN0cnVjdCBvbiBhYnN0cmFjdCB0eXBlcycpO1xuICAgIHJldHVybiBzdXBlckZyb20uY2FsbCh0aGlzLCBwcm9wcykgYXMgYW55O1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNFbnRpdHkoc2NoZW1hOiBTY2hlbWEpOiBzY2hlbWEgaXMgdHlwZW9mIEVudGl0eSB7XG4gIHJldHVybiBzY2hlbWEgIT09IG51bGwgJiYgKHNjaGVtYSBhcyBhbnkpLnBrICE9PSB1bmRlZmluZWQ7XG59XG5cbmZ1bmN0aW9uIGluZGV4RnJvbVBhcmFtczxJIGV4dGVuZHMgc3RyaW5nPihcbiAgcGFyYW1zOiBSZWFkb25seTxvYmplY3Q+LFxuICBpbmRleGVzPzogUmVhZG9ubHk8SVtdPixcbikge1xuICBpZiAoIWluZGV4ZXMpIHJldHVybiB1bmRlZmluZWQ7XG4gIHJldHVybiBpbmRleGVzLmZpbmQoaW5kZXggPT5cbiAgICBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocGFyYW1zLCBpbmRleCksXG4gICk7XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;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dGhpczogVCxcbiAgICBwcm9wczogUGFydGlhbDxBYnN0cmFjdEluc3RhbmNlVHlwZTxUPj4sXG4gICk6IEFic3RyYWN0SW5zdGFuY2VUeXBlPFQ+IHtcbiAgICBpZiAoKHRoaXMgYXMgYW55KS5wcm90b3R5cGUucGsgPT09IHVuZGVmaW5lZClcbiAgICAgIHRocm93IG5ldyBFcnJvcignY2Fubm90IGNvbnN0cnVjdCBvbiBhYnN0cmFjdCB0eXBlcycpO1xuICAgIHJldHVybiBzdXBlckZyb20uY2FsbCh0aGlzLCBwcm9wcykgYXMgYW55O1xuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNFbnRpdHkoc2NoZW1hOiBTY2hlbWEpOiBzY2hlbWEgaXMgdHlwZW9mIEVudGl0eSB7XG4gIHJldHVybiBzY2hlbWEgIT09IG51bGwgJiYgKHNjaGVtYSBhcyBhbnkpLnBrICE9PSB1bmRlZmluZWQ7XG59XG5cbmZ1bmN0aW9uIGluZGV4RnJvbVBhcmFtczxJIGV4dGVuZHMgc3RyaW5nPihcbiAgcGFyYW1zOiBSZWFkb25seTxvYmplY3Q+LFxuICBpbmRleGVzPzogUmVhZG9ubHk8SVtdPixcbikge1xuICBpZiAoIWluZGV4ZXMpIHJldHVybiB1bmRlZmluZWQ7XG4gIHJldHVybiBpbmRleGVzLmZpbmQoaW5kZXggPT5cbiAgICBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocGFyYW1zLCBpbmRleCksXG4gICk7XG59XG4iXX0= |
@@ -7,2 +7,3 @@ import type { NormalizeNullable, NormalizedSchema, Schema, NormalizedIndex } from "./types"; | ||
readonly expiresAt: number; | ||
readonly fetchedAt: number; | ||
}; | ||
@@ -13,3 +14,4 @@ }; | ||
date: number; | ||
fetchedAt?: number; | ||
}) => NormalizedSchema<E, R>; | ||
//# sourceMappingURL=normalize.d.ts.map |
@@ -46,7 +46,7 @@ import { DELETED } from "./special.js"; | ||
if (inStoreEntity) { | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2; | ||
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5; | ||
const inStoreMeta = entityMeta[schemaKey][id]; | ||
const useIncoming = // we may have in store but not in meta; so this existance check is still important | ||
!inStoreMeta || schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
!inStoreMeta || (schema.useIncoming ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date); | ||
@@ -65,9 +65,13 @@ if (useIncoming) { | ||
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt), | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey2.date) | ||
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0), | ||
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0) | ||
}; | ||
} else { | ||
var _meta$fetchedAt2; | ||
entities[schemaKey][id] = processedEntity; | ||
entityMeta[schemaKey][id] = { | ||
expiresAt: entityExpiresAt, | ||
date: meta.date | ||
date: meta.date, | ||
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date | ||
}; | ||
@@ -127,3 +131,4 @@ } | ||
date: Date.now(), | ||
expiresAt: Infinity | ||
expiresAt: Infinity, | ||
fetchedAt: 0 | ||
}) => { | ||
@@ -188,2 +193,2 @@ // no schema means we don't process at all | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ub3JtYWxpemUudHMiXSwibmFtZXMiOlsiREVMRVRFRCIsIm5vcm1hbGl6ZSIsImFycmF5Tm9ybWFsaXplIiwib2JqZWN0Tm9ybWFsaXplIiwidmlzaXQiLCJ2YWx1ZSIsInBhcmVudCIsImtleSIsInNjaGVtYSIsImFkZEVudGl0eSIsInZpc2l0ZWRFbnRpdGllcyIsIm1ldGhvZCIsIkFycmF5IiwiaXNBcnJheSIsImFkZEVudGl0aWVzIiwiZW50aXRpZXMiLCJpbmRleGVzIiwiZXhpc3RpbmdFbnRpdGllcyIsImV4aXN0aW5nSW5kZXhlcyIsImVudGl0eU1ldGEiLCJtZXRhIiwicHJvY2Vzc2VkRW50aXR5IiwiaWQiLCJzY2hlbWFLZXkiLCJleGlzdGluZ0VudGl0eSIsIm1lcmdlIiwiZW50aXR5RXhwaXJlc0F0IiwiZXhwaXJlc0F0IiwiaW5TdG9yZUVudGl0eSIsImluU3RvcmVNZXRhIiwidXNlSW5jb21pbmciLCJNYXRoIiwibWF4IiwiZGF0ZSIsImVudGl0eSIsImluZGV4IiwiaW5kZXhNYXAiLCJwcm9jZXNzIiwiZW52IiwiTk9ERV9FTlYiLCJjb25zb2xlIiwid2FybiIsIkpTT04iLCJzdHJpbmdpZnkiLCJ1bmRlZmluZWQiLCJleHBlY3RlZFNjaGVtYVR5cGUiLCJpbmNsdWRlcyIsImlucHV0IiwiZXhpc3RpbmdFbnRpdHlNZXRhIiwiRGF0ZSIsIm5vdyIsIkluZmluaXR5IiwicmVzdWx0Iiwic2NoZW1hVHlwZSIsInBhcnNlV29ya3MiLCJwYXJzZSIsImUiLCJFcnJvciIsIm5ld0VudGl0aWVzIiwibmV3SW5kZXhlcyJdLCJtYXBwaW5ncyI6IkFBTUEsU0FBU0EsT0FBVDtBQUNBLFNBQVNDLFNBQV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tcbiAgICAgICAgY29uc3QgdXNlSW5jb21pbmcgPVxuICAgICAgICAgIC8vIHdlIG1heSBoYXZlIGluIHN0b3JlIGJ1dCBub3QgaW4gbWV0YTsgc28gdGhpcyBleGlzdGFuY2UgY2hlY2sgaXMgc3RpbGwgaW1wb3J0YW50XG4gICAgICAgICAgIWluU3RvcmVNZXRhIHx8XG4gICAgICAgICAgc2NoZW1hLnVzZUluY29taW5nKGluU3RvcmVNZXRhLCBtZXRhLCBpblN0b3JlRW50aXR5LCBwcm9jZXNzZWRFbnRpdHkpO1xuICAgICAgICBpZiAodXNlSW5jb21pbmcpIHtcbiAgICAgICAgICBpZiAodHlwZW9mIHByb2Nlc3NlZEVudGl0eSAhPT0gdHlwZW9mIGluU3RvcmVFbnRpdHkpIHtcbiAgICAgICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gcHJvY2Vzc2VkRW50aXR5O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBlbnRpdGllc1tzY2hlbWFLZXldW2lkXSA9IHNjaGVtYS5tZXJnZShcbiAgICAgICAgICAgICAgaW5TdG9yZUVudGl0eSxcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkRW50aXR5LFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gPSBpblN0b3JlRW50aXR5O1xuICAgICAgICB9XG5cbiAgICAgICAgZW50aXR5TWV0YVtzY2hlbWFLZXldW2lkXSA9IHtcbiAgICAgICAgICBleHBpcmVzQXQ6IE1hdGgubWF4KFxuICAgICAgICAgICAgZW50aXR5RXhwaXJlc0F0LFxuICAgICAgICAgICAgZW50aXR5TWV0YVtzY2hlbWFLZXldW2lkXT8uZXhwaXJlc0F0LFxuICAgICAgICAgICksXG4gICAgICAgICAgZGF0ZTogTWF0aC5tYXgobWV0YS5kYXRlLCBlbnRpdHlNZXRhW3NjaG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ICAgICAgICAgICAgKVxuICAgICAgICAgICAgOiBlbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdLmRhdGUgPD0gbWV0YS5kYXRlKTtcbiAgICAgICAgaWYgKHVzZUluY29taW5nKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBwcm9jZXNzZWRFbnRpdHkgIT09IHR5cGVvZiBpblN0b3JlRW50aXR5KSB7XG4gICAgICAgICAgICBlbnRpdGllc1tzY2hlbWFLZXldW2lkXSA9IHByb2Nlc3NlZEVudGl0eTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gPSBzY2hlbWEubWVyZ2UoXG4gICAgICAgICAgICAgIGluU3RvcmVFbnRpdHksXG4gICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gaW5TdG9yZUVudGl0eTtcbiAgICAgICAgfVxuXG4gICAgICAgIGVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0gPSB7XG4gICAgICAgICAgZXhwaXJlc0F0OiBNYXRoLm1heChcbiAgICAgICAgICAgIGVudGl0eUV4cGlyZXNBdCxcbiAgICAgICAgICAgIGVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0/LmV4cGlyZXNBdCxcbiAgICAgICAgICApLFxuICAgICAgICAgIGRhdGU6IE1hdGgubWF4KG1ldGEuZGF0ZSwgZW50aXR5TWV0YVtzY2hlbWFLZXldW2lkXT8uZGF0ZSA/PyAwKSxcbiAgICAgICAgICBmZXRjaGVkQXQ6IE1hdGgubWF4KFxuICAgICAgICAgICAgbWV0YS5mZXRjaGVkQXQgPz8gMCxcbiAgICAgICAgICAgIGVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0/LmZldGNoZWRBdCA/PyAwLFxuICAgICAgICAgICks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baW5kZXhdXTtcbiAgICAgICAgfVxuICAgICAgICAvLyBlbnRpdHkgYWxyZWFkeSBpbiBjYWNoZSBidXQgdGhlIGluZGV4IGNoYW5nZWRcbiAgICAgICAgaWYgKFxuICAgICAgICAgIGV4aXN0aW5nRW50aXRpZXNbc2NoZW1hS2V5XSAmJlxuICAgICAgICAgIGV4aXN0aW5nRW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gJiZcbiAgICAgICAgICBleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV1baWRdW2luZGV4XSAhPT0gZW50aXR5W2luZGV4XVxuICAgICAgICApIHtcbiAgICAgICAgICBpbmRleE1hcFtleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV1baWRdW2luZGV4XV0gPSBERUxFVEVEO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpbmRleCBpbiBlbnRpdHkpIHtcbiAgICAgICAgICBpbmRleE1hcFtlbnRpdHlbaW5kZXhdXSA9IGlkO1xuICAgICAgICB9IC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovIGVsc2UgaWYgKFxuICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bmRlZlxuICAgICAgICAgIHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbidcbiAgICAgICAgKSB7XG4gICAgICAgICAgY29uc29sZS53YXJuKGBJbmRleCBub3QgZm91bmQgaW4gZW50aXR5LiBJbmRleGVzIG11c3QgYmUgdG9wLWxldmVsIG1lbWJlcnMgb2YgeW91ciBlbnRpdHkuXG5JbmRleDogJHtpbmRleH1cbkVudGl0eTogJHtKU09OLnN0cmluZ2lmeShlbnRpdHksIHVuZGVmaW5lZCwgMil9YCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgLy8gc2V0IHRoaXMgYWZ0ZXIgaW5kZXggdXBkYXRlcyBzbyB3ZSBrbm93IHdoYXQgaW5kZXhlcyB0byByZW1vdmUgZn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bnRpdGllcyxcbiAgKTtcbiAgcmV0dXJuIHsgZW50aXRpZXMsIGluZGV4ZXMsIHJlc3VsdCwgZW50aXR5TWV0YSB9O1xufTtcbiJdfQ== |
@@ -77,2 +77,10 @@ import { | ||
merge(existing: any, incoming: any): any; | ||
expiresAt?(meta: any, input: any): number; | ||
useIncoming?( | ||
existingMeta: any, | ||
incomingMeta: any, | ||
existing: any, | ||
incoming: any, | ||
): boolean; | ||
indexes?: any; | ||
schema: Record<string, Schema>; | ||
@@ -79,0 +87,0 @@ prototype: T; |
@@ -25,6 +25,8 @@ import { SchemaClass, UnvisitFunction, EntityInterface } from "../schema"; | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): boolean; | ||
} | ||
//# sourceMappingURL=Delete.d.ts.map |
@@ -79,2 +79,2 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWFzL0RlbGV0ZS50cyJdLCJuYW1lcyI6WyJERUxFVEVEIiwiRGVsZXRlIiwiY29uc3RydWN0b3IiLCJlbnRpdHkiLCJwcm9jZXNzIiwiZW52IiwiTk9ERV9FTlYiLCJFcnJvciIsIl9lbnRpdHkiLCJrZXkiLCJub3JtYWxpemUiLCJpbnB1dCIsInBhcmVudCIsInZpc2l0IiwiYWRkRW50aXR5IiwidmlzaXRlZEVudGl0aWVzIiwicHJvY2Vzc2VkRW50aXR5IiwiaWQiLCJwayIsInVuZGVmaW5lZCIsImVycm9yIiwibmFtZSIsIkpTT04iLCJzdHJpbmdpZnkiLCJzdGF0dXMiLCJpbmZlciIsImFyZ3MiLCJpbmRleGVzIiwicmVjdXJzZSIsImRlbm9ybWFsaXplIiwidW52aXNpdCIsIl9kZW5vcm1hbGl6ZU51bGxhYmxlIiwiX25vcm1hb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FibGUoKTogW1xuICAgIEFic3RyYWN0SW5zdGFuY2VUeXBlPEU+IHwgdW5kZWZpbmVkLFxuICAgIGJvb2xlYW4sXG4gICAgZmFsc2UsXG4gIF0ge1xuICAgIHJldHVybiBbXSBhcyBhbnk7XG4gIH1cblxuICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICBfbm9ybWFsaXplTnVsbGFibGUoKTogc3RyaW5nIHwgdW5kZWZpbmVkIHtcbiAgICByZXR1cm4gW10gYXMgYW55O1xuICB9XG5cbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgbWVyZ2UoZXhpc3Rpbmc6IGFueSwgaW5jb21pbmc6IGFueSkge1xuICAgIHJldHVybiBpbmNvbWluZztcbiAgfVxuXG4gIHVzZUluY29taW5nKFxuICAgIGV4aXN0aW5nTWV0YTogeyBkYXRlOiBudW1iZXI7IGZldGNoZWRBdDogbnVtYmVyIH0sXG4gICAgaW5jb21pbmdNZXRhOiB7IGRhdGU6IG51bWJlcjsgZmV0Y2hlZEF0OiBudW1iZXIgfSxcbiAgICBleGlzdGluZzogYW55LFxuICAgIGluY29taW5nOiBhbnksXG4gICkge1xuICAgIHJldHVybiBleGlzdGluZ01ldGEuZGF0ZSA8PSBpbmNvbWluZ01ldGEuZGF0ZTtcbiAgfVxufVxuIl19 |
@@ -84,2 +84,3 @@ import type { default as schema, EntityInterface } from "./schema"; | ||
readonly expiresAt: number; | ||
readonly fetchedAt: number; | ||
}; | ||
@@ -86,0 +87,0 @@ }; |
{ | ||
"name": "@rest-hooks/normalizr", | ||
"version": "8.2.0", | ||
"version": "8.2.1", | ||
"description": "Normalizes and denormalizes JSON according to schema for Redux and Flux applications", | ||
@@ -104,3 +104,3 @@ "homepage": "https://github.com/coinbase/rest-hooks/tree/master/packages/normalizr#readme", | ||
}, | ||
"gitHead": "1300e60bb71b7f2687802fe13a52a04f88fc304b" | ||
"gitHead": "4472b9b571cb652f91fdeffc8af26c7c70b58163" | ||
} |
@@ -28,4 +28,4 @@ # normalizr | ||
* [Introduction](./docs/introduction.md) | ||
* [Build Files](./docs/introduction.md#build-files) | ||
* [Introduction](./docs/README.md) | ||
* [Build Files](./docs/README.md#build-files) | ||
* [Quick Start](https://resthooks.io/docs/api/schema) | ||
@@ -32,0 +32,0 @@ * [API](https://resthooks.io/docs/api/Entity) |
@@ -50,4 +50,6 @@ import * as schema from "../schema"; | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): boolean; | ||
@@ -71,2 +73,3 @@ /** Creates new instance copying over defined values of arguments */ | ||
date: number; | ||
fetchedAt: number; | ||
}, input: any): number; | ||
@@ -73,0 +76,0 @@ static denormalize<T extends typeof Entity>(this: T, input: Readonly<Partial<AbstractInstanceType<T>>>, unvisit: schema.UnvisitFunction): [ |
@@ -7,2 +7,3 @@ import { NormalizeNullable, NormalizedSchema, Schema, NormalizedIndex } from "./types"; | ||
readonly expiresAt: number; | ||
readonly fetchedAt: number; | ||
}; | ||
@@ -13,3 +14,4 @@ }; | ||
date: number; | ||
fetchedAt?: number; | ||
}) => NormalizedSchema<E, R>; | ||
//# sourceMappingURL=normalize.d.ts.map |
@@ -45,2 +45,5 @@ import { Schema, AbstractInstanceType, Normalize, NormalizeNullable, Denormalize, DenormalizeNullable, DenormalizeObject, DenormalizeNullableObject, NormalizeObject, NormalizedNullableObject, UnvisitFunction, EntityMap, NormalizedIndex, } from './types'; | ||
merge(existing: any, incoming: any): any; | ||
expiresAt?(meta: any, input: any): number; | ||
useIncoming?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): boolean; | ||
indexes?: any; | ||
schema: Record<string, Schema>; | ||
@@ -47,0 +50,0 @@ prototype: T; |
@@ -29,6 +29,8 @@ import { SchemaClass, UnvisitFunction, EntityInterface } from "../schema"; | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): boolean; | ||
} | ||
//# sourceMappingURL=Delete.d.ts.map |
@@ -92,2 +92,3 @@ import { default as schema, EntityInterface } from "./schema"; | ||
readonly expiresAt: number; | ||
readonly fetchedAt: number; | ||
}; | ||
@@ -94,0 +95,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
671643
7877