@data-client/normalizr
Advanced tools
Comparing version 0.2.2 to 0.8.0
@@ -150,9 +150,4 @@ define(['exports'], (function (exports) { 'use strict'; | ||
}); | ||
if (typeof entity === 'symbol') { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
return schema.denormalizeOnly(entity, args, unvisit); | ||
// TODO(breaking): Change to this as breaking change once we only support newer entities | ||
} else if (entity.toString().includes('DELETED')) { | ||
return INVALID; | ||
} | ||
if (typeof entity === 'symbol' && typeof schema.denormalize === 'function') { | ||
return schema.denormalize(entity, args, unvisit); | ||
} | ||
@@ -182,12 +177,3 @@ if (typeof entity !== 'object' || entity === null) { | ||
function unvisitEntityObject(entity, schema, unvisit, pk, localCacheKey, args) { | ||
let entityCopy, _, deleted; | ||
/* istanbul ignore else */ | ||
if (schema.createIfValid) { | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
} /* istanbul ignore next */else { | ||
entityCopy = entity; | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
const entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
if (entityCopy === undefined) { | ||
@@ -197,24 +183,8 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
localCacheKey[pk] = schema.denormalizeOnly(entityCopy, args, unvisit); | ||
} else { | ||
[localCacheKey[pk], _, deleted] = schema.denormalize(entityCopy, unvisit); | ||
if (deleted) localCacheKey[pk] = INVALID; | ||
if (typeof schema.denormalize === 'function') { | ||
localCacheKey[pk] = schema.denormalize(entityCopy, args, unvisit); | ||
} | ||
} | ||
} | ||
// TODO(breaking): remove once unused | ||
/* istanbul ignore next */ | ||
function withTrackedEntities(unvisit) { | ||
// every time we nest, we want to unwrap back to the top. | ||
// this is due to only needed the next level of nested entities for lookup | ||
const originalUnvisit = unvisit.og || unvisit; | ||
const wrappedUnvisit = (input, schema) => originalUnvisit(input, schema); | ||
wrappedUnvisit.og = unvisit; | ||
return wrappedUnvisit; | ||
} | ||
const getUnvisit = (getEntity, cache, args) => { | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
const unvisitAdapter = getUnvisitAdapter(unvisit); | ||
function unvisit(input, schema) { | ||
@@ -225,14 +195,11 @@ if (!schema) return input; | ||
} | ||
const hasDenormalize = typeof schema.denormalize === 'function' || typeof schema.denormalizeOnly === 'function'; | ||
const hasDenormalize = typeof schema.denormalize === 'function'; | ||
// deserialize fields (like Date) | ||
// deserialize fields (like Temporal.Instant) | ||
if (!hasDenormalize && typeof schema === 'function') { | ||
if (input instanceof schema) return input; | ||
if (input === undefined) return input; | ||
return new schema(input); | ||
return schema(input); | ||
} | ||
if (input === undefined) { | ||
var _schema$constructor; | ||
// TODO(breaking): Drop support for initial All version | ||
const isAll = ((_schema$constructor = schema.constructor) == null ? void 0 : _schema$constructor.name) === 'AllSchema'; | ||
const isAll = schema.constructor.name === 'AllSchema'; | ||
return isAll ? INVALID : undefined; | ||
@@ -245,10 +212,6 @@ } | ||
if (isEntity(schema)) { | ||
return unvisitEntity(input, schema, args, schema.denormalizeOnly ? unvisit : unvisitAdapter, getEntity, cache); | ||
return unvisitEntity(input, schema, args, unvisit, getEntity, cache); | ||
} | ||
if (hasDenormalize) { | ||
if (schema.denormalizeOnly) { | ||
return schema.denormalizeOnly(input, args, unvisit); | ||
} else { | ||
return denormalizeLegacySchema(schema, input, unvisitAdapter); | ||
} | ||
return schema.denormalize(input, args, unvisit); | ||
} | ||
@@ -265,27 +228,3 @@ return input; | ||
var getUnvisit$1 = getUnvisit; | ||
function denormalizeLegacySchema(schema, input, unvisitAdapter) { | ||
const [data, _, suspend] = schema.denormalize(input, unvisitAdapter); | ||
// TODO(breaking): Drop support for initial Query version | ||
// queryEndpoint schema only overrides 'denormalize' and 'infer' | ||
const isQuery = !Object.hasOwn(schema, 'normalize') && Object.hasOwn(schema, 'denormalize') && Object.hasOwn(schema, 'infer'); | ||
return suspend && !isQuery ? INVALID : data; | ||
} | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
function getUnvisitAdapter(unvisit) { | ||
return function (input, schema) { | ||
var _schema$constructor2; | ||
const isAll = (schema == null ? void 0 : (_schema$constructor2 = schema.constructor) == null ? void 0 : _schema$constructor2.name) === 'AllSchema'; | ||
const value = unvisit(input, schema); | ||
// TODO(breaking): Drop support for initial All version | ||
if (isAll) { | ||
// we swap 'found' and 'suspend' because the initial Query version used 'found' to determine whether | ||
// it should 'process' | ||
return [typeof value === 'symbol' ? undefined : value, typeof value !== 'symbol', false]; | ||
} | ||
return [typeof value === 'symbol' ? undefined : value, true, typeof value === 'symbol']; | ||
}; | ||
} | ||
/** Maps entity dependencies to a value (usually their denormalized form) | ||
@@ -544,5 +483,2 @@ * | ||
const DELETED = Symbol('ENTITY WAS DELETED'); | ||
var _s = $RefreshSig$(); | ||
const visit = (value, parent, key, schema, addEntity, visitedEntities, storeEntities, args) => { | ||
@@ -556,7 +492,2 @@ if (!value || !schema) { | ||
} | ||
// serializable | ||
if (typeof schema === 'function') { | ||
return new schema(value); | ||
} | ||
if (typeof value !== 'object' || typeof schema !== 'object') return value; | ||
@@ -581,9 +512,8 @@ const method = Array.isArray(schema) ? normalize$2 : normalize$1; | ||
if (inStoreEntity && (inStoreMeta = storeEntityMeta[schemaKey][id])) { | ||
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore ? schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeMetaWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
entities[schemaKey][id] = schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
} else { | ||
entities[schemaKey][id] = processedEntity; | ||
storeEntityMeta[schemaKey][id] = { | ||
// TODO(breaking): Remove schema.expiresat | ||
expiresAt: schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt, | ||
expiresAt: meta.expiresAt, | ||
date: meta.date, | ||
@@ -617,3 +547,3 @@ fetchedAt: meta.fetchedAt | ||
if (storeEntities && storeEntities[id] && storeEntities[id][index] !== entity[index]) { | ||
indexMap[storeEntities[id][index]] = DELETED; | ||
indexMap[storeEntities[id][index]] = INVALID; | ||
} | ||
@@ -631,33 +561,2 @@ if (index in entity) { | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeStore() instead */ | ||
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
_s(); | ||
const useIncoming = | ||
// useIncoming should not be used with legacy optimistic | ||
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date; | ||
if (useIncoming) { | ||
if (typeof incoming !== typeof existing) { | ||
return incoming; | ||
} else { | ||
return schema.merge(existing, incoming); | ||
} | ||
} else { | ||
return existing; | ||
} | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeMetaWithStore() instead */ | ||
_s(mergeWithStore, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () { | ||
return [schema.useIncoming]; | ||
}); | ||
function mergeMetaWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
return { | ||
expiresAt: Math.max(schema.expiresAt ? schema.expiresAt(incomingMeta, incoming) : incomingMeta.expiresAt, existingMeta.expiresAt), | ||
date: Math.max(incomingMeta.date, existingMeta.date), | ||
fetchedAt: Math.max(incomingMeta.fetchedAt, existingMeta.fetchedAt) | ||
}; | ||
} | ||
function expectedSchemaType(schema) { | ||
@@ -698,3 +597,3 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema; | ||
the JSON. By default, this only happens if "content-type" header includes "json". | ||
See https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information | ||
See https://dataclient.io/rest/api/RestEndpoint#parseResponse for more information | ||
@@ -736,9 +635,3 @@ Schema: ${JSON.stringify(schema, undefined, 2)} | ||
if (canInfer(schema)) { | ||
var _entities$schema$key; | ||
const ret = schema.infer(args, indexes, inferResults, entities); | ||
// TODO(breaking): back compatibility with endpoint@3.7 and less | ||
if (isEntity(schema) && ret !== undefined && !((_entities$schema$key = entities[schema.key]) != null && _entities$schema$key[ret])) { | ||
return undefined; | ||
} | ||
return ret; | ||
return schema.infer(args, indexes, inferResults, entities); | ||
} | ||
@@ -779,3 +672,2 @@ | ||
exports.DELETED = DELETED; | ||
exports.ExpiryStatus = ExpiryStatus; | ||
@@ -782,0 +674,0 @@ exports.INVALID = INVALID; |
@@ -151,9 +151,4 @@ var data_client_normalizr = (function (exports) { | ||
}); | ||
if (typeof entity === 'symbol') { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
return schema.denormalizeOnly(entity, args, unvisit); | ||
// TODO(breaking): Change to this as breaking change once we only support newer entities | ||
} else if (entity.toString().includes('DELETED')) { | ||
return INVALID; | ||
} | ||
if (typeof entity === 'symbol' && typeof schema.denormalize === 'function') { | ||
return schema.denormalize(entity, args, unvisit); | ||
} | ||
@@ -183,12 +178,3 @@ if (typeof entity !== 'object' || entity === null) { | ||
function unvisitEntityObject(entity, schema, unvisit, pk, localCacheKey, args) { | ||
let entityCopy, _, deleted; | ||
/* istanbul ignore else */ | ||
if (schema.createIfValid) { | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
} /* istanbul ignore next */else { | ||
entityCopy = entity; | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
const entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
if (entityCopy === undefined) { | ||
@@ -198,24 +184,8 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
localCacheKey[pk] = schema.denormalizeOnly(entityCopy, args, unvisit); | ||
} else { | ||
[localCacheKey[pk], _, deleted] = schema.denormalize(entityCopy, unvisit); | ||
if (deleted) localCacheKey[pk] = INVALID; | ||
if (typeof schema.denormalize === 'function') { | ||
localCacheKey[pk] = schema.denormalize(entityCopy, args, unvisit); | ||
} | ||
} | ||
} | ||
// TODO(breaking): remove once unused | ||
/* istanbul ignore next */ | ||
function withTrackedEntities(unvisit) { | ||
// every time we nest, we want to unwrap back to the top. | ||
// this is due to only needed the next level of nested entities for lookup | ||
const originalUnvisit = unvisit.og || unvisit; | ||
const wrappedUnvisit = (input, schema) => originalUnvisit(input, schema); | ||
wrappedUnvisit.og = unvisit; | ||
return wrappedUnvisit; | ||
} | ||
const getUnvisit = (getEntity, cache, args) => { | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
const unvisitAdapter = getUnvisitAdapter(unvisit); | ||
function unvisit(input, schema) { | ||
@@ -226,14 +196,11 @@ if (!schema) return input; | ||
} | ||
const hasDenormalize = typeof schema.denormalize === 'function' || typeof schema.denormalizeOnly === 'function'; | ||
const hasDenormalize = typeof schema.denormalize === 'function'; | ||
// deserialize fields (like Date) | ||
// deserialize fields (like Temporal.Instant) | ||
if (!hasDenormalize && typeof schema === 'function') { | ||
if (input instanceof schema) return input; | ||
if (input === undefined) return input; | ||
return new schema(input); | ||
return schema(input); | ||
} | ||
if (input === undefined) { | ||
var _schema$constructor; | ||
// TODO(breaking): Drop support for initial All version | ||
const isAll = ((_schema$constructor = schema.constructor) == null ? void 0 : _schema$constructor.name) === 'AllSchema'; | ||
const isAll = schema.constructor.name === 'AllSchema'; | ||
return isAll ? INVALID : undefined; | ||
@@ -246,10 +213,6 @@ } | ||
if (isEntity(schema)) { | ||
return unvisitEntity(input, schema, args, schema.denormalizeOnly ? unvisit : unvisitAdapter, getEntity, cache); | ||
return unvisitEntity(input, schema, args, unvisit, getEntity, cache); | ||
} | ||
if (hasDenormalize) { | ||
if (schema.denormalizeOnly) { | ||
return schema.denormalizeOnly(input, args, unvisit); | ||
} else { | ||
return denormalizeLegacySchema(schema, input, unvisitAdapter); | ||
} | ||
return schema.denormalize(input, args, unvisit); | ||
} | ||
@@ -266,27 +229,3 @@ return input; | ||
var getUnvisit$1 = getUnvisit; | ||
function denormalizeLegacySchema(schema, input, unvisitAdapter) { | ||
const [data, _, suspend] = schema.denormalize(input, unvisitAdapter); | ||
// TODO(breaking): Drop support for initial Query version | ||
// queryEndpoint schema only overrides 'denormalize' and 'infer' | ||
const isQuery = !Object.hasOwn(schema, 'normalize') && Object.hasOwn(schema, 'denormalize') && Object.hasOwn(schema, 'infer'); | ||
return suspend && !isQuery ? INVALID : data; | ||
} | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
function getUnvisitAdapter(unvisit) { | ||
return function (input, schema) { | ||
var _schema$constructor2; | ||
const isAll = (schema == null ? void 0 : (_schema$constructor2 = schema.constructor) == null ? void 0 : _schema$constructor2.name) === 'AllSchema'; | ||
const value = unvisit(input, schema); | ||
// TODO(breaking): Drop support for initial All version | ||
if (isAll) { | ||
// we swap 'found' and 'suspend' because the initial Query version used 'found' to determine whether | ||
// it should 'process' | ||
return [typeof value === 'symbol' ? undefined : value, typeof value !== 'symbol', false]; | ||
} | ||
return [typeof value === 'symbol' ? undefined : value, true, typeof value === 'symbol']; | ||
}; | ||
} | ||
/** Maps entity dependencies to a value (usually their denormalized form) | ||
@@ -545,5 +484,2 @@ * | ||
const DELETED = Symbol('ENTITY WAS DELETED'); | ||
var _s = $RefreshSig$(); | ||
const visit = (value, parent, key, schema, addEntity, visitedEntities, storeEntities, args) => { | ||
@@ -557,7 +493,2 @@ if (!value || !schema) { | ||
} | ||
// serializable | ||
if (typeof schema === 'function') { | ||
return new schema(value); | ||
} | ||
if (typeof value !== 'object' || typeof schema !== 'object') return value; | ||
@@ -582,9 +513,8 @@ const method = Array.isArray(schema) ? normalize$2 : normalize$1; | ||
if (inStoreEntity && (inStoreMeta = storeEntityMeta[schemaKey][id])) { | ||
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore ? schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeMetaWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
entities[schemaKey][id] = schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
} else { | ||
entities[schemaKey][id] = processedEntity; | ||
storeEntityMeta[schemaKey][id] = { | ||
// TODO(breaking): Remove schema.expiresat | ||
expiresAt: schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt, | ||
expiresAt: meta.expiresAt, | ||
date: meta.date, | ||
@@ -618,3 +548,3 @@ fetchedAt: meta.fetchedAt | ||
if (storeEntities && storeEntities[id] && storeEntities[id][index] !== entity[index]) { | ||
indexMap[storeEntities[id][index]] = DELETED; | ||
indexMap[storeEntities[id][index]] = INVALID; | ||
} | ||
@@ -632,33 +562,2 @@ if (index in entity) { | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeStore() instead */ | ||
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
_s(); | ||
const useIncoming = | ||
// useIncoming should not be used with legacy optimistic | ||
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date; | ||
if (useIncoming) { | ||
if (typeof incoming !== typeof existing) { | ||
return incoming; | ||
} else { | ||
return schema.merge(existing, incoming); | ||
} | ||
} else { | ||
return existing; | ||
} | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeMetaWithStore() instead */ | ||
_s(mergeWithStore, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () { | ||
return [schema.useIncoming]; | ||
}); | ||
function mergeMetaWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
return { | ||
expiresAt: Math.max(schema.expiresAt ? schema.expiresAt(incomingMeta, incoming) : incomingMeta.expiresAt, existingMeta.expiresAt), | ||
date: Math.max(incomingMeta.date, existingMeta.date), | ||
fetchedAt: Math.max(incomingMeta.fetchedAt, existingMeta.fetchedAt) | ||
}; | ||
} | ||
function expectedSchemaType(schema) { | ||
@@ -699,3 +598,3 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema; | ||
the JSON. By default, this only happens if "content-type" header includes "json". | ||
See https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information | ||
See https://dataclient.io/rest/api/RestEndpoint#parseResponse for more information | ||
@@ -737,9 +636,3 @@ Schema: ${JSON.stringify(schema, undefined, 2)} | ||
if (canInfer(schema)) { | ||
var _entities$schema$key; | ||
const ret = schema.infer(args, indexes, inferResults, entities); | ||
// TODO(breaking): back compatibility with endpoint@3.7 and less | ||
if (isEntity(schema) && ret !== undefined && !((_entities$schema$key = entities[schema.key]) != null && _entities$schema$key[ret])) { | ||
return undefined; | ||
} | ||
return ret; | ||
return schema.infer(args, indexes, inferResults, entities); | ||
} | ||
@@ -780,3 +673,2 @@ | ||
exports.DELETED = DELETED; | ||
exports.ExpiryStatus = ExpiryStatus; | ||
@@ -783,0 +675,0 @@ exports.INVALID = INVALID; |
@@ -1,1 +0,1 @@ | ||
class e{constructor(){this.localCache={}}getEntity(e,t,n,r){const i=t.key;i in this.localCache||(this.localCache[i]=Object.create(null));const o=this.localCache[i];return o[e]||r(o),o[e]}getResults(e,t,n){return{data:n(),paths:[]}}}const t=Symbol("INVALID");function n(e){return null!==e&&void 0!==e.pk}const r=e=>{if("production"!==process.env.NODE_ENV){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]},i=e=>void 0!==e&&"symbol"!=typeof e,o=(e,t,n,i,o,s,c,a,l)=>{e=r(e);const u=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(t);return u.map(((t,r)=>o(t,n,i,e,s,c,a,l)))},s=(e,t,n,o)=>(e=r(e),t.map?t.map((t=>o(t,e))).filter(i):t);function c(e,t,n,r){}function a(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}const l=(e,t,n,r,i,o,s,c,a)=>{const l=Object.assign({},t);return Object.keys(e).forEach((n=>{const r=e[n],u=i(t[n],t,n,r,o,s,c,a);null==u?delete l[n]:l[n]=u})),l},u=(e,n,r,i)=>{if(a(n))return function(e,n,r,i){let o=!1;const s=Object.keys(e).reduce(((t,n)=>{const r=`${n}`,s=i(t.get(r),e[r]);return"symbol"==typeof s&&(o=!0),t.has(r)?t.set(r,s):t}),n);return o?t:s}(e,n,0,i);const o=Object.assign({},n);let s=!1;return Object.keys(e).forEach((t=>{const n=i(o[t],e[t]);void 0!==o[t]&&(o[t]=n),"symbol"==typeof n&&(s=!0)})),s?t:o};function h(e,t,n,r,i){const o={};for(const s of Object.keys(e))o[s]=r(e[s],t,n,i);return o}function d(e,n,r,i,o,s){let c,l,u;n.createIfValid?c=o[i]=a(e)?n.createIfValid(e.toObject()):n.createIfValid(e):(c=e,r=function(e){const t=e.og||e,n=(e,n)=>t(e,n);return n.og=e,n}(r),r.setLocal=e=>o[i]=e),void 0===c?o[i]=t:"function"==typeof n.denormalizeOnly?o[i]=n.denormalizeOnly(c,s,r):([o[i],l,u]=n.denormalize(c,r),u&&(o[i]=t))}var f=(e,r,i)=>{const o=function(e){return function(t,n){var r;const i="AllSchema"===(null==n||null==(r=n.constructor)?void 0:r.name),o=e(t,n);return i?["symbol"==typeof o?void 0:o,"symbol"!=typeof o,!1]:["symbol"==typeof o?void 0:o,!0,"symbol"==typeof o]}}(c);function c(l,h){if(!h)return l;if(null===l)return l;const f="function"==typeof h.denormalize||"function"==typeof h.denormalizeOnly;if(!f&&"function"==typeof h)return l instanceof h||void 0===l?l:new h(l);if(void 0===l){var y;return"AllSchema"===(null==(y=h.constructor)?void 0:y.name)?t:void 0}if(!f&&"object"==typeof h){return(Array.isArray(h)?s:u)(h,l,i,c)}return n(h)?function(e,n,r,i,o,s){const c="object"==typeof e?e:o({key:n.key,pk:e});if("symbol"==typeof c){if("function"==typeof n.denormalizeOnly)return n.denormalizeOnly(c,r,i);if(c.toString().includes("DELETED"))return t}if("object"!=typeof c||null===c)return c;const l="string"==typeof e?e:n.pk(a(c)?c.toJS():c,void 0,void 0,r);return void 0===l||""===l||"undefined"===l?function(e){const t={};return e(t),t[""]}((e=>d(c,n,i,"",e,r))):s.getEntity(l,n,c,(e=>d(c,n,i,l,e,r)))}(l,h,i,h.denormalizeOnly?c:o,e,r):f?h.denormalizeOnly?h.denormalizeOnly(l,i,c):function(e,n,r){const[i,o,s]=e.denormalize(n,r),c=!Object.hasOwn(e,"normalize")&&Object.hasOwn(e,"denormalize")&&Object.hasOwn(e,"infer");return s&&!c?t:i}(h,l,o):l}return(e,t)=>{const n=Object(e)===e&&Object(t)===t;return r.getResults(e,n,(()=>c(e,t)))}};class y{constructor(){this.next=new WeakMap,this.nextPath=void 0}get(e,t){let n=this.next.get(e);if(!n)return p;for(;n.nextPath;){const e=t(n.nextPath);if(n=n.next.get(e),!n)return p}return[n.value,n.journey]}set(e,t){if(e.length<1)throw new b;let n=this;for(const{entity:t,path:r}of e){let e=n.next.get(t);e||(e=new v,n.next.set(t,e)),n.nextPath=r,n=e}n.nextPath=void 0,n.value=t,n.journey=g(e)}}const p=[void 0,void 0];function m(e){return a(e)?({key:t,pk:n})=>e.getIn([t,n]):({key:t,pk:n})=>{var r;return null==(r=e[t])?void 0:r[n]}}function g(e){var t;const n=e.map((e=>e.path));return""===(null==(t=n[0])?void 0:t.pk)&&n.shift(),n}class v{constructor(){this.next=new WeakMap,this.value=void 0,this.journey=[],this.nextPath=void 0}}class b extends Error{constructor(...e){super(...e),this.message="Keys must include at least one member"}}function O(t,n,r,i=[]){return void 0===n||void 0===t?t:f(m(r),new e,i)(t,n).data}class x{constructor(e,t,n){this.dependencies=[],this.cycleCache={},this.cycleIndex=-1,this.localCache={},this._getEntity=e,this.getCache=j(t),this.resultCache=n}getEntity(e,t,n,r){const i=t.key,{localCacheKey:o,cycleCacheKey:s}=this.getCacheKey(i);if(o[e])e in s?this.cycleIndex=s[e]:this.dependencies.push({entity:n,path:{key:i,pk:e}});else{const c=this.getCache(e,t),[a,l]=c.get(n,this._getEntity);if(l)return o[e]=a.value,this.dependencies.push(...a.dependencies),a.value;{const t=this.dependencies.length;s[e]=t,this.dependencies.push({entity:n,path:{key:i,pk:e}}),r(o),delete s[e];const a=this.dependencies.slice(-1===this.cycleIndex?t:this.cycleIndex),l={dependencies:a,value:o[e]};c.set(a,l),this.cycleIndex===t&&(this.cycleIndex=-1)}}return o[e]}getCacheKey(e){e in this.localCache||(this.localCache[e]=Object.create(null)),e in this.cycleCache||(this.cycleCache[e]=Object.create(null));return{localCacheKey:this.localCache[e],cycleCacheKey:this.cycleCache[e]}}getResults(e,t,n){if(!t)return{data:n(),paths:this.paths()};let[r,i]=this.resultCache.get(e,this._getEntity);return void 0===i&&(r=n(),i=this.paths(),this.dependencies.unshift({entity:e,path:{key:"",pk:""}}),this.resultCache.set(this.dependencies,r)),{data:r,paths:i}}paths(){return g(this.dependencies)}}const j=e=>(t,n)=>{var r;const i=n.key,o=null!=(r=n.cacheWith)?r:n;i in e||(e[i]=Object.create(null));const s=e[i];s[t]||(s[t]=new WeakMap);let c=s[t].get(o);return c||(c=new y,s[t].set(o,c)),c};function k(e,t,n,r={},i=new y,o=[]){if(void 0===t)return{data:e,paths:[]};if(void 0===e)return{data:void 0,paths:[]};const s=m(n);return f(s,new x(s,r,i),o)(e,t)}const w=Symbol("ENTITY WAS DELETED"),A=(e,t,n,r,i,s,c,a)=>{if(!e||!r)return e;if(r.normalize&&"function"==typeof r.normalize)return"object"!=typeof e?e:r.normalize(e,t,n,A,i,s,c,a);if("function"==typeof r)return new r(e);if("object"!=typeof e||"object"!=typeof r)return e;return(Array.isArray(r)?o:l)(r,e,t,n,A,i,s,c,a)},E=(e,t,n,r,i,o)=>(s,c,a)=>{const l=s.key;l in e||(e[l]={},n[l]=Object.assign({},n[l]),i[l]=Object.assign({},i[l]));const u=e[l][a];if(u)e[l][a]=s.merge(u,c);else{const t=n[l][a];let r;t&&(r=i[l][a])?(e[l][a]=s.mergeWithStore?s.mergeWithStore(r,o,t,c):function(e,t,n,r,i){const o=e.useIncoming&&n.fetchedAt?e.useIncoming(t,n,r,i):t.date<=n.date;return o?typeof i!=typeof r?i:e.merge(r,i):r}(s,r,o,t,c),i[l][a]=s.mergeMetaWithStore?s.mergeMetaWithStore(r,o,t,c):function(e,t,n,r,i){return{expiresAt:Math.max(e.expiresAt?e.expiresAt(n,i):n.expiresAt,t.expiresAt),date:Math.max(n.date,t.date),fetchedAt:Math.max(n.fetchedAt,t.fetchedAt)}}(s,r,o,0,c)):(e[l][a]=c,i[l][a]={expiresAt:s.expiresAt?s.expiresAt(o,c):o.expiresAt,date:o.date,fetchedAt:o.fetchedAt})}s.indexes&&(l in t||(t[l]={},r[l]=Object.assign({},r[l])),function(e,t,n,r,i,o){for(const s of t){s in n||(r[s]=n[s]={});const t=n[s];o[e]&&delete t[o[e][s]],o&&o[e]&&o[e][s]!==i[s]&&(t[o[e][s]]=w),s in i?t[i[s]]=e:"production"!==process.env.NODE_ENV&&console.warn(`Index not found in entity. Indexes must be top-level members of your entity.\nIndex: ${s}\nEntity: ${JSON.stringify(i,void 0,2)}`)}}(a,s.indexes,t[l],r[l],e[l][a],n[l])),n[l][a]=e[l][a]};const I=(e,t,n=[],r={},i={},o={},s={date:Date.now(),expiresAt:1/0,fetchedAt:0})=>{if(null==t)return{entities:r,indexes:i,result:e,entityMeta:o};const c=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==c&&(void 0===t.key||void 0!==t.pk||"string"!=typeof e)){if("production"!==process.env.NODE_ENV){const n=e=>{try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}};throw"string"==typeof e&&n(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/rest/api/RestEndpoint#parseResponse for more information\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`):new Error(`Unexpected input given to normalize. Expected type to be "${c}", found "${null===e?"null":typeof e}".\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`)}throw new Error(`Unexpected input given to normalize. Expected type to be "${c}", found "${null===e?"null":typeof e}".`)}const a=Object.assign({},r),l=Object.assign({},i),u=Object.assign({},o),h=E({},{},a,l,u,s);return{entities:a,indexes:l,result:A(e,e,void 0,t,h,{},r,n),entityMeta:u}};function C(e,t,r,i){if(function(e){return!!e&&"function"==typeof e.infer}(e)){var o;const s=e.infer(t,r,C,i);if(n(e)&&void 0!==s&&(null==(o=i[e.key])||!o[s]))return;return s}if("object"==typeof e&&e){return(Array.isArray(e)?c:h)(e,t,r,C,i)}return e}function z(e){return void 0!==e&&(!(e&&"object"==typeof e&&!Array.isArray(e))||Object.values(e).every(z))}var S={Invalid:1,InvalidIfStale:2,Valid:3};Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};export{w as DELETED,S as ExpiryStatus,t as INVALID,y as WeakEntityMap,O as denormalize,k as denormalizeCached,C as inferResults,n as isEntity,I as normalize,z as validateInference}; | ||
class e{constructor(){this.localCache={}}getEntity(e,t,n,i){const r=t.key;r in this.localCache||(this.localCache[r]=Object.create(null));const o=this.localCache[r];return o[e]||i(o),o[e]}getResults(e,t,n){return{data:n(),paths:[]}}}const t=Symbol("INVALID");function n(e){return null!==e&&void 0!==e.pk}const i=e=>{if("production"!==process.env.NODE_ENV){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]},r=e=>void 0!==e&&"symbol"!=typeof e,o=(e,t,n,r,o,s,c,a,u)=>{e=i(e);const l=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(t);return l.map(((t,i)=>o(t,n,r,e,s,c,a,u)))},s=(e,t,n,o)=>(e=i(e),t.map?t.map((t=>o(t,e))).filter(r):t);function c(e,t,n,i){}function a(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}const u=(e,t,n,i,r,o,s,c,a)=>{const u=Object.assign({},t);return Object.keys(e).forEach((n=>{const i=e[n],l=r(t[n],t,n,i,o,s,c,a);null==l?delete u[n]:u[n]=l})),u},l=(e,n,i,r)=>{if(a(n))return function(e,n,i,r){let o=!1;const s=Object.keys(e).reduce(((t,n)=>{const i=`${n}`,s=r(t.get(i),e[i]);return"symbol"==typeof s&&(o=!0),t.has(i)?t.set(i,s):t}),n);return o?t:s}(e,n,0,r);const o=Object.assign({},n);let s=!1;return Object.keys(e).forEach((t=>{const n=r(o[t],e[t]);void 0!==o[t]&&(o[t]=n),"symbol"==typeof n&&(s=!0)})),s?t:o};function h(e,t,n,i,r){const o={};for(const s of Object.keys(e))o[s]=i(e[s],t,n,r);return o}function d(e,n,i,r,o,s){const c=o[r]=a(e)?n.createIfValid(e.toObject()):n.createIfValid(e);void 0===c?o[r]=t:"function"==typeof n.denormalize&&(o[r]=n.denormalize(c,s,i))}var f=(e,i,r)=>{function o(c,u){if(!u)return c;if(null===c)return c;const h="function"==typeof u.denormalize;if(!h&&"function"==typeof u)return void 0===c?c:u(c);if(void 0===c){return"AllSchema"===u.constructor.name?t:void 0}if(!h&&"object"==typeof u){return(Array.isArray(u)?s:l)(u,c,r,o)}return n(u)?function(e,t,n,i,r,o){const s="object"==typeof e?e:r({key:t.key,pk:e});if("symbol"==typeof s&&"function"==typeof t.denormalize)return t.denormalize(s,n,i);if("object"!=typeof s||null===s)return s;const c="string"==typeof e?e:t.pk(a(s)?s.toJS():s,void 0,void 0,n);return void 0===c||""===c||"undefined"===c?function(e){const t={};return e(t),t[""]}((e=>d(s,t,i,"",e,n))):o.getEntity(c,t,s,(e=>d(s,t,i,c,e,n)))}(c,u,r,o,e,i):h?u.denormalize(c,r,o):c}return(e,t)=>{const n=Object(e)===e&&Object(t)===t;return i.getResults(e,n,(()=>o(e,t)))}};class y{constructor(){this.next=new WeakMap,this.nextPath=void 0}get(e,t){let n=this.next.get(e);if(!n)return p;for(;n.nextPath;){const e=t(n.nextPath);if(n=n.next.get(e),!n)return p}return[n.value,n.journey]}set(e,t){if(e.length<1)throw new m;let n=this;for(const{entity:t,path:i}of e){let e=n.next.get(t);e||(e=new b,n.next.set(t,e)),n.nextPath=i,n=e}n.nextPath=void 0,n.value=t,n.journey=v(e)}}const p=[void 0,void 0];function g(e){return a(e)?({key:t,pk:n})=>e.getIn([t,n]):({key:t,pk:n})=>{var i;return null==(i=e[t])?void 0:i[n]}}function v(e){var t;const n=e.map((e=>e.path));return""===(null==(t=n[0])?void 0:t.pk)&&n.shift(),n}class b{constructor(){this.next=new WeakMap,this.value=void 0,this.journey=[],this.nextPath=void 0}}class m extends Error{constructor(...e){super(...e),this.message="Keys must include at least one member"}}function O(t,n,i,r=[]){return void 0===n||void 0===t?t:f(g(i),new e,r)(t,n).data}class j{constructor(e,t,n){this.dependencies=[],this.cycleCache={},this.cycleIndex=-1,this.localCache={},this._getEntity=e,this.getCache=x(t),this.resultCache=n}getEntity(e,t,n,i){const r=t.key,{localCacheKey:o,cycleCacheKey:s}=this.getCacheKey(r);if(o[e])e in s?this.cycleIndex=s[e]:this.dependencies.push({entity:n,path:{key:r,pk:e}});else{const c=this.getCache(e,t),[a,u]=c.get(n,this._getEntity);if(u)return o[e]=a.value,this.dependencies.push(...a.dependencies),a.value;{const t=this.dependencies.length;s[e]=t,this.dependencies.push({entity:n,path:{key:r,pk:e}}),i(o),delete s[e];const a=this.dependencies.slice(-1===this.cycleIndex?t:this.cycleIndex),u={dependencies:a,value:o[e]};c.set(a,u),this.cycleIndex===t&&(this.cycleIndex=-1)}}return o[e]}getCacheKey(e){e in this.localCache||(this.localCache[e]=Object.create(null)),e in this.cycleCache||(this.cycleCache[e]=Object.create(null));return{localCacheKey:this.localCache[e],cycleCacheKey:this.cycleCache[e]}}getResults(e,t,n){if(!t)return{data:n(),paths:this.paths()};let[i,r]=this.resultCache.get(e,this._getEntity);return void 0===r&&(i=n(),r=this.paths(),this.dependencies.unshift({entity:e,path:{key:"",pk:""}}),this.resultCache.set(this.dependencies,i)),{data:i,paths:r}}paths(){return v(this.dependencies)}}const x=e=>(t,n)=>{var i;const r=n.key,o=null!=(i=n.cacheWith)?i:n;r in e||(e[r]=Object.create(null));const s=e[r];s[t]||(s[t]=new WeakMap);let c=s[t].get(o);return c||(c=new y,s[t].set(o,c)),c};function k(e,t,n,i={},r=new y,o=[]){if(void 0===t)return{data:e,paths:[]};if(void 0===e)return{data:void 0,paths:[]};const s=g(n);return f(s,new j(s,i,r),o)(e,t)}const w=(e,t,n,i,r,s,c,a)=>{if(!e||!i)return e;if(i.normalize&&"function"==typeof i.normalize)return"object"!=typeof e?e:i.normalize(e,t,n,w,r,s,c,a);if("object"!=typeof e||"object"!=typeof i)return e;return(Array.isArray(i)?o:u)(i,e,t,n,w,r,s,c,a)},C=(e,n,i,r,o,s)=>(c,a,u)=>{const l=c.key;l in e||(e[l]={},i[l]=Object.assign({},i[l]),o[l]=Object.assign({},o[l]));const h=e[l][u];if(h)e[l][u]=c.merge(h,a);else{const t=i[l][u];let n;t&&(n=o[l][u])?(e[l][u]=c.mergeWithStore(n,s,t,a),o[l][u]=c.mergeMetaWithStore(n,s,t,a)):(e[l][u]=a,o[l][u]={expiresAt:s.expiresAt,date:s.date,fetchedAt:s.fetchedAt})}c.indexes&&(l in n||(n[l]={},r[l]=Object.assign({},r[l])),function(e,n,i,r,o,s){for(const c of n){c in i||(r[c]=i[c]={});const n=i[c];s[e]&&delete n[s[e][c]],s&&s[e]&&s[e][c]!==o[c]&&(n[s[e][c]]=t),c in o?n[o[c]]=e:"production"!==process.env.NODE_ENV&&console.warn(`Index not found in entity. Indexes must be top-level members of your entity.\nIndex: ${c}\nEntity: ${JSON.stringify(o,void 0,2)}`)}}(u,c.indexes,n[l],r[l],e[l][u],i[l])),i[l][u]=e[l][u]};const E=(e,t,n=[],i={},r={},o={},s={date:Date.now(),expiresAt:1/0,fetchedAt:0})=>{if(null==t)return{entities:i,indexes:r,result:e,entityMeta:o};const c=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==c&&(void 0===t.key||void 0!==t.pk||"string"!=typeof e)){if("production"!==process.env.NODE_ENV){const n=e=>{try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}};throw"string"==typeof e&&n(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://dataclient.io/rest/api/RestEndpoint#parseResponse for more information\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`):new Error(`Unexpected input given to normalize. Expected type to be "${c}", found "${null===e?"null":typeof e}".\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`)}throw new Error(`Unexpected input given to normalize. Expected type to be "${c}", found "${null===e?"null":typeof e}".`)}const a=Object.assign({},i),u=Object.assign({},r),l=Object.assign({},o),h=C({},{},a,u,l,s);return{entities:a,indexes:u,result:w(e,e,void 0,t,h,{},i,n),entityMeta:l}};function I(e,t,n,i){if(function(e){return!!e&&"function"==typeof e.infer}(e))return e.infer(t,n,I,i);if("object"==typeof e&&e){return(Array.isArray(e)?c:h)(e,t,n,I,i)}return e}function A(e){return void 0!==e&&(!(e&&"object"==typeof e&&!Array.isArray(e))||Object.values(e).every(A))}var S={Invalid:1,InvalidIfStale:2,Valid:3};Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};export{S as ExpiryStatus,t as INVALID,y as WeakEntityMap,O as denormalize,k as denormalizeCached,I as inferResults,n as isEntity,E as normalize,A as validateInference}; |
@@ -156,9 +156,4 @@ 'use strict'; | ||
}); | ||
if (typeof entity === 'symbol') { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
return schema.denormalizeOnly(entity, args, unvisit); | ||
// TODO(breaking): Change to this as breaking change once we only support newer entities | ||
} else if (entity.toString().includes('DELETED')) { | ||
return INVALID; | ||
} | ||
if (typeof entity === 'symbol' && typeof schema.denormalize === 'function') { | ||
return schema.denormalize(entity, args, unvisit); | ||
} | ||
@@ -188,12 +183,3 @@ if (typeof entity !== 'object' || entity === null) { | ||
function unvisitEntityObject(entity, schema, unvisit, pk, localCacheKey, args) { | ||
let entityCopy, _, deleted; | ||
/* istanbul ignore else */ | ||
if (schema.createIfValid) { | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
} /* istanbul ignore next */else { | ||
entityCopy = entity; | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
const entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
if (entityCopy === undefined) { | ||
@@ -203,24 +189,8 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
localCacheKey[pk] = schema.denormalizeOnly(entityCopy, args, unvisit); | ||
} else { | ||
[localCacheKey[pk], _, deleted] = schema.denormalize(entityCopy, unvisit); | ||
if (deleted) localCacheKey[pk] = INVALID; | ||
if (typeof schema.denormalize === 'function') { | ||
localCacheKey[pk] = schema.denormalize(entityCopy, args, unvisit); | ||
} | ||
} | ||
} | ||
// TODO(breaking): remove once unused | ||
/* istanbul ignore next */ | ||
function withTrackedEntities(unvisit) { | ||
// every time we nest, we want to unwrap back to the top. | ||
// this is due to only needed the next level of nested entities for lookup | ||
const originalUnvisit = unvisit.og || unvisit; | ||
const wrappedUnvisit = (input, schema) => originalUnvisit(input, schema); | ||
wrappedUnvisit.og = unvisit; | ||
return wrappedUnvisit; | ||
} | ||
const getUnvisit = (getEntity, cache, args) => { | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
const unvisitAdapter = getUnvisitAdapter(unvisit); | ||
function unvisit(input, schema) { | ||
@@ -231,14 +201,11 @@ if (!schema) return input; | ||
} | ||
const hasDenormalize = typeof schema.denormalize === 'function' || typeof schema.denormalizeOnly === 'function'; | ||
const hasDenormalize = typeof schema.denormalize === 'function'; | ||
// deserialize fields (like Date) | ||
// deserialize fields (like Temporal.Instant) | ||
if (!hasDenormalize && typeof schema === 'function') { | ||
if (input instanceof schema) return input; | ||
if (input === undefined) return input; | ||
return new schema(input); | ||
return schema(input); | ||
} | ||
if (input === undefined) { | ||
var _schema$constructor; | ||
// TODO(breaking): Drop support for initial All version | ||
const isAll = ((_schema$constructor = schema.constructor) == null ? void 0 : _schema$constructor.name) === 'AllSchema'; | ||
const isAll = schema.constructor.name === 'AllSchema'; | ||
return isAll ? INVALID : undefined; | ||
@@ -251,10 +218,6 @@ } | ||
if (isEntity(schema)) { | ||
return unvisitEntity(input, schema, args, schema.denormalizeOnly ? unvisit : unvisitAdapter, getEntity, cache); | ||
return unvisitEntity(input, schema, args, unvisit, getEntity, cache); | ||
} | ||
if (hasDenormalize) { | ||
if (schema.denormalizeOnly) { | ||
return schema.denormalizeOnly(input, args, unvisit); | ||
} else { | ||
return denormalizeLegacySchema(schema, input, unvisitAdapter); | ||
} | ||
return schema.denormalize(input, args, unvisit); | ||
} | ||
@@ -271,27 +234,3 @@ return input; | ||
var getUnvisit$1 = getUnvisit; | ||
function denormalizeLegacySchema(schema, input, unvisitAdapter) { | ||
const [data, _, suspend] = schema.denormalize(input, unvisitAdapter); | ||
// TODO(breaking): Drop support for initial Query version | ||
// queryEndpoint schema only overrides 'denormalize' and 'infer' | ||
const isQuery = !Object.hasOwn(schema, 'normalize') && Object.hasOwn(schema, 'denormalize') && Object.hasOwn(schema, 'infer'); | ||
return suspend && !isQuery ? INVALID : data; | ||
} | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
function getUnvisitAdapter(unvisit) { | ||
return function (input, schema) { | ||
var _schema$constructor2; | ||
const isAll = (schema == null ? void 0 : (_schema$constructor2 = schema.constructor) == null ? void 0 : _schema$constructor2.name) === 'AllSchema'; | ||
const value = unvisit(input, schema); | ||
// TODO(breaking): Drop support for initial All version | ||
if (isAll) { | ||
// we swap 'found' and 'suspend' because the initial Query version used 'found' to determine whether | ||
// it should 'process' | ||
return [typeof value === 'symbol' ? undefined : value, typeof value !== 'symbol', false]; | ||
} | ||
return [typeof value === 'symbol' ? undefined : value, true, typeof value === 'symbol']; | ||
}; | ||
} | ||
/** Maps entity dependencies to a value (usually their denormalized form) | ||
@@ -550,4 +489,2 @@ * | ||
const DELETED = Symbol('ENTITY WAS DELETED'); | ||
const visit = (value, parent, key, schema, addEntity, visitedEntities, storeEntities, args) => { | ||
@@ -561,7 +498,2 @@ if (!value || !schema) { | ||
} | ||
// serializable | ||
if (typeof schema === 'function') { | ||
return new schema(value); | ||
} | ||
if (typeof value !== 'object' || typeof schema !== 'object') return value; | ||
@@ -590,9 +522,8 @@ const method = Array.isArray(schema) ? normalize$2 : normalize$1; | ||
if (inStoreEntity && (inStoreMeta = storeEntityMeta[schemaKey][id])) { | ||
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore ? schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeMetaWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
entities[schemaKey][id] = schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
} else { | ||
entities[schemaKey][id] = processedEntity; | ||
storeEntityMeta[schemaKey][id] = { | ||
// TODO(breaking): Remove schema.expiresat | ||
expiresAt: schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt, | ||
expiresAt: meta.expiresAt, | ||
date: meta.date, | ||
@@ -628,3 +559,3 @@ fetchedAt: meta.fetchedAt | ||
if (storeEntities && storeEntities[id] && storeEntities[id][index] !== entity[index]) { | ||
indexMap[storeEntities[id][index]] = DELETED; | ||
indexMap[storeEntities[id][index]] = INVALID; | ||
} | ||
@@ -642,29 +573,2 @@ if (index in entity) { | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeStore() instead */ | ||
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
const useIncoming = | ||
// useIncoming should not be used with legacy optimistic | ||
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date; | ||
if (useIncoming) { | ||
if (typeof incoming !== typeof existing) { | ||
return incoming; | ||
} else { | ||
return schema.merge(existing, incoming); | ||
} | ||
} else { | ||
return existing; | ||
} | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeMetaWithStore() instead */ | ||
function mergeMetaWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
return { | ||
expiresAt: Math.max(schema.expiresAt ? schema.expiresAt(incomingMeta, incoming) : incomingMeta.expiresAt, existingMeta.expiresAt), | ||
date: Math.max(incomingMeta.date, existingMeta.date), | ||
fetchedAt: Math.max(incomingMeta.fetchedAt, existingMeta.fetchedAt) | ||
}; | ||
} | ||
function expectedSchemaType(schema) { | ||
@@ -705,3 +609,3 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema; | ||
the JSON. By default, this only happens if "content-type" header includes "json". | ||
See https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information | ||
See https://dataclient.io/rest/api/RestEndpoint#parseResponse for more information | ||
@@ -749,9 +653,3 @@ Schema: ${JSON.stringify(schema, undefined, 2)} | ||
if (canInfer(schema)) { | ||
var _entities$schema$key; | ||
const ret = schema.infer(args, indexes, inferResults, entities); | ||
// TODO(breaking): back compatibility with endpoint@3.7 and less | ||
if (isEntity(schema) && ret !== undefined && !((_entities$schema$key = entities[schema.key]) != null && _entities$schema$key[ret])) { | ||
return undefined; | ||
} | ||
return ret; | ||
return schema.infer(args, indexes, inferResults, entities); | ||
} | ||
@@ -792,3 +690,2 @@ | ||
exports.DELETED = DELETED; | ||
exports.ExpiryStatus = ExpiryStatus; | ||
@@ -795,0 +692,0 @@ exports.INVALID = INVALID; |
@@ -154,9 +154,4 @@ (function (global, factory) { | ||
}); | ||
if (typeof entity === 'symbol') { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
return schema.denormalizeOnly(entity, args, unvisit); | ||
// TODO(breaking): Change to this as breaking change once we only support newer entities | ||
} else if (entity.toString().includes('DELETED')) { | ||
return INVALID; | ||
} | ||
if (typeof entity === 'symbol' && typeof schema.denormalize === 'function') { | ||
return schema.denormalize(entity, args, unvisit); | ||
} | ||
@@ -186,12 +181,3 @@ if (typeof entity !== 'object' || entity === null) { | ||
function unvisitEntityObject(entity, schema, unvisit, pk, localCacheKey, args) { | ||
let entityCopy, _, deleted; | ||
/* istanbul ignore else */ | ||
if (schema.createIfValid) { | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
} /* istanbul ignore next */else { | ||
entityCopy = entity; | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
const entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
if (entityCopy === undefined) { | ||
@@ -201,24 +187,8 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
localCacheKey[pk] = schema.denormalizeOnly(entityCopy, args, unvisit); | ||
} else { | ||
[localCacheKey[pk], _, deleted] = schema.denormalize(entityCopy, unvisit); | ||
if (deleted) localCacheKey[pk] = INVALID; | ||
if (typeof schema.denormalize === 'function') { | ||
localCacheKey[pk] = schema.denormalize(entityCopy, args, unvisit); | ||
} | ||
} | ||
} | ||
// TODO(breaking): remove once unused | ||
/* istanbul ignore next */ | ||
function withTrackedEntities(unvisit) { | ||
// every time we nest, we want to unwrap back to the top. | ||
// this is due to only needed the next level of nested entities for lookup | ||
const originalUnvisit = unvisit.og || unvisit; | ||
const wrappedUnvisit = (input, schema) => originalUnvisit(input, schema); | ||
wrappedUnvisit.og = unvisit; | ||
return wrappedUnvisit; | ||
} | ||
const getUnvisit = (getEntity, cache, args) => { | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
const unvisitAdapter = getUnvisitAdapter(unvisit); | ||
function unvisit(input, schema) { | ||
@@ -229,14 +199,11 @@ if (!schema) return input; | ||
} | ||
const hasDenormalize = typeof schema.denormalize === 'function' || typeof schema.denormalizeOnly === 'function'; | ||
const hasDenormalize = typeof schema.denormalize === 'function'; | ||
// deserialize fields (like Date) | ||
// deserialize fields (like Temporal.Instant) | ||
if (!hasDenormalize && typeof schema === 'function') { | ||
if (input instanceof schema) return input; | ||
if (input === undefined) return input; | ||
return new schema(input); | ||
return schema(input); | ||
} | ||
if (input === undefined) { | ||
var _schema$constructor; | ||
// TODO(breaking): Drop support for initial All version | ||
const isAll = ((_schema$constructor = schema.constructor) == null ? void 0 : _schema$constructor.name) === 'AllSchema'; | ||
const isAll = schema.constructor.name === 'AllSchema'; | ||
return isAll ? INVALID : undefined; | ||
@@ -249,10 +216,6 @@ } | ||
if (isEntity(schema)) { | ||
return unvisitEntity(input, schema, args, schema.denormalizeOnly ? unvisit : unvisitAdapter, getEntity, cache); | ||
return unvisitEntity(input, schema, args, unvisit, getEntity, cache); | ||
} | ||
if (hasDenormalize) { | ||
if (schema.denormalizeOnly) { | ||
return schema.denormalizeOnly(input, args, unvisit); | ||
} else { | ||
return denormalizeLegacySchema(schema, input, unvisitAdapter); | ||
} | ||
return schema.denormalize(input, args, unvisit); | ||
} | ||
@@ -269,27 +232,3 @@ return input; | ||
var getUnvisit$1 = getUnvisit; | ||
function denormalizeLegacySchema(schema, input, unvisitAdapter) { | ||
const [data, _, suspend] = schema.denormalize(input, unvisitAdapter); | ||
// TODO(breaking): Drop support for initial Query version | ||
// queryEndpoint schema only overrides 'denormalize' and 'infer' | ||
const isQuery = !Object.hasOwn(schema, 'normalize') && Object.hasOwn(schema, 'denormalize') && Object.hasOwn(schema, 'infer'); | ||
return suspend && !isQuery ? INVALID : data; | ||
} | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
function getUnvisitAdapter(unvisit) { | ||
return function (input, schema) { | ||
var _schema$constructor2; | ||
const isAll = (schema == null ? void 0 : (_schema$constructor2 = schema.constructor) == null ? void 0 : _schema$constructor2.name) === 'AllSchema'; | ||
const value = unvisit(input, schema); | ||
// TODO(breaking): Drop support for initial All version | ||
if (isAll) { | ||
// we swap 'found' and 'suspend' because the initial Query version used 'found' to determine whether | ||
// it should 'process' | ||
return [typeof value === 'symbol' ? undefined : value, typeof value !== 'symbol', false]; | ||
} | ||
return [typeof value === 'symbol' ? undefined : value, true, typeof value === 'symbol']; | ||
}; | ||
} | ||
/** Maps entity dependencies to a value (usually their denormalized form) | ||
@@ -548,5 +487,2 @@ * | ||
const DELETED = Symbol('ENTITY WAS DELETED'); | ||
var _s = $RefreshSig$(); | ||
const visit = (value, parent, key, schema, addEntity, visitedEntities, storeEntities, args) => { | ||
@@ -560,7 +496,2 @@ if (!value || !schema) { | ||
} | ||
// serializable | ||
if (typeof schema === 'function') { | ||
return new schema(value); | ||
} | ||
if (typeof value !== 'object' || typeof schema !== 'object') return value; | ||
@@ -585,9 +516,8 @@ const method = Array.isArray(schema) ? normalize$2 : normalize$1; | ||
if (inStoreEntity && (inStoreMeta = storeEntityMeta[schemaKey][id])) { | ||
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore ? schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeMetaWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
entities[schemaKey][id] = schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
} else { | ||
entities[schemaKey][id] = processedEntity; | ||
storeEntityMeta[schemaKey][id] = { | ||
// TODO(breaking): Remove schema.expiresat | ||
expiresAt: schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt, | ||
expiresAt: meta.expiresAt, | ||
date: meta.date, | ||
@@ -621,3 +551,3 @@ fetchedAt: meta.fetchedAt | ||
if (storeEntities && storeEntities[id] && storeEntities[id][index] !== entity[index]) { | ||
indexMap[storeEntities[id][index]] = DELETED; | ||
indexMap[storeEntities[id][index]] = INVALID; | ||
} | ||
@@ -635,33 +565,2 @@ if (index in entity) { | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeStore() instead */ | ||
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
_s(); | ||
const useIncoming = | ||
// useIncoming should not be used with legacy optimistic | ||
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date; | ||
if (useIncoming) { | ||
if (typeof incoming !== typeof existing) { | ||
return incoming; | ||
} else { | ||
return schema.merge(existing, incoming); | ||
} | ||
} else { | ||
return existing; | ||
} | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeMetaWithStore() instead */ | ||
_s(mergeWithStore, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () { | ||
return [schema.useIncoming]; | ||
}); | ||
function mergeMetaWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
return { | ||
expiresAt: Math.max(schema.expiresAt ? schema.expiresAt(incomingMeta, incoming) : incomingMeta.expiresAt, existingMeta.expiresAt), | ||
date: Math.max(incomingMeta.date, existingMeta.date), | ||
fetchedAt: Math.max(incomingMeta.fetchedAt, existingMeta.fetchedAt) | ||
}; | ||
} | ||
function expectedSchemaType(schema) { | ||
@@ -702,3 +601,3 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema; | ||
the JSON. By default, this only happens if "content-type" header includes "json". | ||
See https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information | ||
See https://dataclient.io/rest/api/RestEndpoint#parseResponse for more information | ||
@@ -740,9 +639,3 @@ Schema: ${JSON.stringify(schema, undefined, 2)} | ||
if (canInfer(schema)) { | ||
var _entities$schema$key; | ||
const ret = schema.infer(args, indexes, inferResults, entities); | ||
// TODO(breaking): back compatibility with endpoint@3.7 and less | ||
if (isEntity(schema) && ret !== undefined && !((_entities$schema$key = entities[schema.key]) != null && _entities$schema$key[ret])) { | ||
return undefined; | ||
} | ||
return ret; | ||
return schema.infer(args, indexes, inferResults, entities); | ||
} | ||
@@ -783,3 +676,2 @@ | ||
exports.DELETED = DELETED; | ||
exports.ExpiryStatus = ExpiryStatus; | ||
@@ -786,0 +678,0 @@ exports.INVALID = INVALID; |
@@ -11,9 +11,4 @@ import { INVALID } from './symbol.js'; | ||
}); | ||
if (typeof entity === 'symbol') { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
return schema.denormalizeOnly(entity, args, unvisit); | ||
// TODO(breaking): Change to this as breaking change once we only support newer entities | ||
} else if (entity.toString().includes('DELETED')) { | ||
return INVALID; | ||
} | ||
if (typeof entity === 'symbol' && typeof schema.denormalize === 'function') { | ||
return schema.denormalize(entity, args, unvisit); | ||
} | ||
@@ -43,12 +38,4 @@ if (typeof entity !== 'object' || entity === null) { | ||
function unvisitEntityObject(entity, schema, unvisit, pk, localCacheKey, args) { | ||
let entityCopy, _, deleted; | ||
/* istanbul ignore else */ | ||
if (schema.createIfValid) { | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
} /* istanbul ignore next */else { | ||
entityCopy = entity; | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
let _, deleted; | ||
const entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
if (entityCopy === undefined) { | ||
@@ -58,24 +45,8 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
localCacheKey[pk] = schema.denormalizeOnly(entityCopy, args, unvisit); | ||
} else { | ||
[localCacheKey[pk], _, deleted] = schema.denormalize(entityCopy, unvisit); | ||
if (deleted) localCacheKey[pk] = INVALID; | ||
if (typeof schema.denormalize === 'function') { | ||
localCacheKey[pk] = schema.denormalize(entityCopy, args, unvisit); | ||
} | ||
} | ||
} | ||
// TODO(breaking): remove once unused | ||
/* istanbul ignore next */ | ||
function withTrackedEntities(unvisit) { | ||
// every time we nest, we want to unwrap back to the top. | ||
// this is due to only needed the next level of nested entities for lookup | ||
const originalUnvisit = unvisit.og || unvisit; | ||
const wrappedUnvisit = (input, schema) => originalUnvisit(input, schema); | ||
wrappedUnvisit.og = unvisit; | ||
return wrappedUnvisit; | ||
} | ||
const getUnvisit = (getEntity, cache, args) => { | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
const unvisitAdapter = getUnvisitAdapter(unvisit); | ||
function unvisit(input, schema) { | ||
@@ -86,14 +57,11 @@ if (!schema) return input; | ||
} | ||
const hasDenormalize = typeof schema.denormalize === 'function' || typeof schema.denormalizeOnly === 'function'; | ||
const hasDenormalize = typeof schema.denormalize === 'function'; | ||
// deserialize fields (like Date) | ||
// deserialize fields (like Temporal.Instant) | ||
if (!hasDenormalize && typeof schema === 'function') { | ||
if (input instanceof schema) return input; | ||
if (input === undefined) return input; | ||
return new schema(input); | ||
return schema(input); | ||
} | ||
if (input === undefined) { | ||
var _schema$constructor; | ||
// TODO(breaking): Drop support for initial All version | ||
const isAll = ((_schema$constructor = schema.constructor) == null ? void 0 : _schema$constructor.name) === 'AllSchema'; | ||
const isAll = schema.constructor.name === 'AllSchema'; | ||
return isAll ? INVALID : undefined; | ||
@@ -106,10 +74,6 @@ } | ||
if (isEntity(schema)) { | ||
return unvisitEntity(input, schema, args, schema.denormalizeOnly ? unvisit : unvisitAdapter, getEntity, cache); | ||
return unvisitEntity(input, schema, args, unvisit, getEntity, cache); | ||
} | ||
if (hasDenormalize) { | ||
if (schema.denormalizeOnly) { | ||
return schema.denormalizeOnly(input, args, unvisit); | ||
} else { | ||
return denormalizeLegacySchema(schema, input, unvisitAdapter); | ||
} | ||
return schema.denormalize(input, args, unvisit); | ||
} | ||
@@ -126,26 +90,2 @@ return input; | ||
export default getUnvisit; | ||
function denormalizeLegacySchema(schema, input, unvisitAdapter) { | ||
const [data, _, suspend] = schema.denormalize(input, unvisitAdapter); | ||
// TODO(breaking): Drop support for initial Query version | ||
// queryEndpoint schema only overrides 'denormalize' and 'infer' | ||
const isQuery = !Object.hasOwn(schema, 'normalize') && Object.hasOwn(schema, 'denormalize') && Object.hasOwn(schema, 'infer'); | ||
return suspend && !isQuery ? INVALID : data; | ||
} | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
function getUnvisitAdapter(unvisit) { | ||
return function (input, schema) { | ||
var _schema$constructor2; | ||
const isAll = (schema == null ? void 0 : (_schema$constructor2 = schema.constructor) == null ? void 0 : _schema$constructor2.name) === 'AllSchema'; | ||
const value = unvisit(input, schema); | ||
// TODO(breaking): Drop support for initial All version | ||
if (isAll) { | ||
// we swap 'found' and 'suspend' because the initial Query version used 'found' to determine whether | ||
// it should 'process' | ||
return [typeof value === 'symbol' ? undefined : value, typeof value !== 'symbol', false]; | ||
} | ||
return [typeof value === 'symbol' ? undefined : value, true, typeof value === 'symbol']; | ||
}; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJJTlZBTElEIiwiaXNFbnRpdHkiLCJkZW5vcm1hbGl6ZSIsImFycmF5RGVub3JtYWxpemUiLCJpc0ltbXV0YWJsZSIsIm9iamVjdERlbm9ybWFsaXplIiwidW52aXNpdEVudGl0eSIsImVudGl0eU9ySWQiLCJzY2hlbWEiLCJhcmdzIiwidW52aXNpdCIsImdldEVudGl0eSIsImNhY2hlIiwiZW50aXR5Iiwia2V5IiwicGsiLCJkZW5vcm1hbGl6ZU9ubHkiLCJ0b1N0cmluZyIsImluY2x1ZGVzIiwidG9KUyIsInVuZGVmaW5lZCIsIm5vQ2FjaGVHZXRFbnRpdHkiLCJsb2NhbENhY2hlS2V5IiwidW52aXNpdEVudGl0eU9iamVjdCIsImNvbXB1dGVWYWx1ZSIsImVudGl0eUNvcHkiLCJfIiw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hQUFhLENBQUNzQixLQUFLLEVBQUVwQixNQUFNLEVBQUVDLElBQUksRUFBRUMsT0FBTyxFQUFFQyxTQUFTLEVBQUVDLEtBQUssQ0FBQztJQUN0RTtJQUVBLElBQUlpQixjQUFjLEVBQUU7TUFDbEIsT0FBT3JCLE1BQU0sQ0FBQ04sV0FBVyxDQUFDMEIsS0FBSyxFQUFFbkIsSUFBSSxFQUFFQyxPQUFPLENBQUM7SUFDakQ7SUFFQSxPQUFPa0IsS0FBSztFQUNkO0VBRUEsT0FBTyxDQUFDQSxLQUFVLEVBQUVwQixNQUFXLEtBQW1DO0lBQ2hFO0lBQ0E7SUFDQSxNQUFNNEIsUUFBUSxHQUFHQyxNQUFNLENBQUNULEtBQUssQ0FBQyxLQUFLQSxLQUFLLElBQUlTLE1BQU0sQ0FBQzdCLE1BQU0sQ0FBQyxLQUFLQSxNQUFNO0lBQ3JFLE9BQU9JLEtBQUssQ0FBQzBCLFVBQVUsQ0FBQ1YsS0FBSyxFQUFFUSxRQUFRLEVBQUUsTUFBTTFCLE9BQU8sQ0FBQ2tCLEtBQUssRUFBRXBCLE1BQU0sQ0FBQyxDQUFDO0VBQ3hFLENBQUM7QUFDSCxDQUFDO0FBQ0QsZUFBZW1CLFVBQVUifQ== |
@@ -10,9 +10,7 @@ Object.hasOwn = Object.hasOwn || /* istanbul ignore next */function hasOwn(it, key) { | ||
export { default as inferResults, validateInference } from './inferResults.js'; | ||
export { DELETED } from './special.js'; | ||
export * from './endpoint/types.js'; | ||
export * from './interface.js'; | ||
export * from './Expiry.js'; | ||
export * from './normal.js'; | ||
export { INVALID } from './denormalize/symbol.js'; | ||
export { denormalize, denormalizeCached, normalize, isEntity, WeakEntityMap }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJPYmplY3QiLCJoYXNPd24iLCJpdCIsImtleSIsInByb3RvdHlwZSIsImhhc093blByb3BlcnR5IiwiY2FsbCIsImRlbm9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ElBQUksQ0FBQ0osRUFBRSxFQUFFQyxHQUFHLENBQUM7QUFDdEQsQ0FBQztBQUNILFNBQVNJLFdBQVcsUUFBUSw4QkFBOEI7QUFDMUQsU0FBU0EsV0FBVyxJQUFJQyxpQkFBaUIsUUFBUSxvQ0FBb0M7QUFDckYsU0FBU0MsUUFBUSxRQUFRLGVBQWU7QUFDeEMsU0FBU0MsU0FBUyxRQUFRLGdCQUFnQjtBQUMxQyxPQUFPQyxhQUFhLE1BQU0sb0JBQW9CO0FBQzlDLFNBQVNDLE9BQU8sSUFBSUMsWUFBWSxFQUFFQyxpQkFBaUIsUUFBUSxtQkFBbUI7QUFhOUUsY0FBYyxxQkFBcUI7QUFDbkMsY0FBYyxnQkFBZ0I7QUFDOUIsY0FBYyxhQUFhO0FBQzNCLFNBQVNDLE9BQU8sUUFBUSx5QkFBeUI7QUFFakQsU0FBU1IsV0FBVyxFQUFFQyxpQkFBaUIsRUFBRUUsU0FBUyxFQUFFRCxRQUFRLEVBQUVFLGFBQWEifQ== |
@@ -1,2 +0,1 @@ | ||
import { isEntity } from './isEntity.js'; | ||
import { infer as arrayInfer } from './schemas/Array.js'; | ||
@@ -11,9 +10,3 @@ import { infer as objectInfer } from './schemas/Object.js'; | ||
if (canInfer(schema)) { | ||
var _entities$schema$key; | ||
const ret = schema.infer(args, indexes, inferResults, entities); | ||
// TODO(breaking): back compatibility with endpoint@3.7 and less | ||
if (isEntity(schema) && ret !== undefined && !((_entities$schema$key = entities[schema.key]) != null && _entities$schema$key[ret])) { | ||
return undefined; | ||
} | ||
return ret; | ||
return schema.infer(args, indexes, inferResults, entities); | ||
} | ||
@@ -42,2 +35,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc0VudGl0eSIsImluZmVyIiwiYXJyYXlJbmZlciIsIm9iamVjdEluZmVyIiwiaW5mZXJSZXN1bHRzIiwic2NoZW1hIiwiYXJncyIsImluZGV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bmNvbWluZz8oXG4gICAgZXhpc3RpbmdNZXRhOiBhbnksXG4gICAgaW5jb21pbmdNZXRhOiBhbnksXG4gICAgZXhpc3Rpbmc6IGFueSxcbiAgICBpbmNvbWluZzogYW55LFxuICApOiBib29sZWFuO1xuICBpbmRleGVzPzogYW55O1xuICBzY2hlbWE6IFJlY29yZDxzdHJpbmcsIFNjaGVtYT47XG4gIGNhY2hlV2l0aD86IG9iamVjdDtcbiAgcHJvdG90eXBlOiBUO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFVudmlzaXRGdW5jdGlvbiB7XG4gIChpbnB1dDogYW55LCBzY2hlbWE6IGFueSk6IFthbnksIGJvb2xlYW4sIGJvb2xlYW5dIHwgYW55O1xuICBvZz86IFVudmlzaXRGdW5jdGlvbjtcbiAgc2V0TG9jYWw/OiAoZW50aXR5OiBhbnkpID0+IHZvaWQ7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgTm9ybWFsaXplZEluZGV4IHtcbiAgcmVhZG9ubHkgW2VudGl0eUtleTogc3RyaW5nXToge1xuICAgIHJlYWRvbmx5IFtpbmRleE5hbWU6IHN0cmluZ106IHsgcmVhZG9ubHkgW2xvb2t1cDogc3RyaW5nXTogc3RyaW5nIH07XG4gIH07XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRW50aXR5VGFibGUge1xuICBbZW50aXR5S2V5OiBzdHJpbmddOlxuICAgIHwge1xuICAgICAgICBbcGs6IHN0cmluZ106IHVua25vd247XG4gICAgICB9XG4gICAgfCB1bmRlZmluZWQ7XG59XG4iXSwibWFwcGluZ3MiOiIifQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2ludGVyZmFjZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBTY2hlbWEgPVxuICB8IG51bGxcbiAgfCBzdHJpbmdcbiAgfCB7IFtLOiB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9iamVjdDtcbiAgcHJvdG90eXBlOiBUO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIE5vcm1hbGl6ZWRJbmRleCB7XG4gIHJlYWRvbmx5IFtlbnRpdHlLZXk6IHN0cmluZ106IHtcbiAgICByZWFkb25seSBbaW5kZXhOYW1lOiBzdHJpbmddOiB7IHJlYWRvbmx5IFtsb29rdXA6IHN0cmluZ106IHN0cmluZyB9O1xuICB9O1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEVudGl0eVRhYmxlIHtcbiAgW2VudGl0eUtleTogc3RyaW5nXTpcbiAgICB8IHtcbiAgICAgICAgW3BrOiBzdHJpbmddOiB1bmtub3duO1xuICAgICAgfVxuICAgIHwgdW5kZWZpbmVkO1xufVxuIl0sIm1hcHBpbmdzIjoiIn0= |
@@ -0,4 +1,4 @@ | ||
import { INVALID } from './denormalize/symbol.js'; | ||
import { normalize as arrayNormalize } from './schemas/Array.js'; | ||
import { normalize as objectNormalize } from './schemas/Object.js'; | ||
import { DELETED } from './special.js'; | ||
const visit = (value, parent, key, schema, addEntity, visitedEntities, storeEntities, args) => { | ||
@@ -12,7 +12,2 @@ if (!value || !schema) { | ||
} | ||
// serializable | ||
if (typeof schema === 'function') { | ||
return new schema(value); | ||
} | ||
if (typeof value !== 'object' || typeof schema !== 'object') return value; | ||
@@ -37,9 +32,8 @@ const method = Array.isArray(schema) ? arrayNormalize : objectNormalize; | ||
if (inStoreEntity && (inStoreMeta = storeEntityMeta[schemaKey][id])) { | ||
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore ? schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeMetaWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
entities[schemaKey][id] = schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
} else { | ||
entities[schemaKey][id] = processedEntity; | ||
storeEntityMeta[schemaKey][id] = { | ||
// TODO(breaking): Remove schema.expiresat | ||
expiresAt: schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt, | ||
expiresAt: meta.expiresAt, | ||
date: meta.date, | ||
@@ -73,3 +67,3 @@ fetchedAt: meta.fetchedAt | ||
if (storeEntities && storeEntities[id] && storeEntities[id][index] !== entity[index]) { | ||
indexMap[storeEntities[id][index]] = DELETED; | ||
indexMap[storeEntities[id][index]] = INVALID; | ||
} | ||
@@ -87,29 +81,2 @@ if (index in entity) { | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeStore() instead */ | ||
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
const useIncoming = | ||
// useIncoming should not be used with legacy optimistic | ||
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date; | ||
if (useIncoming) { | ||
if (typeof incoming !== typeof existing) { | ||
return incoming; | ||
} else { | ||
return schema.merge(existing, incoming); | ||
} | ||
} else { | ||
return existing; | ||
} | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeMetaWithStore() instead */ | ||
function mergeMetaWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
return { | ||
expiresAt: Math.max(schema.expiresAt ? schema.expiresAt(incomingMeta, incoming) : incomingMeta.expiresAt, existingMeta.expiresAt), | ||
date: Math.max(incomingMeta.date, existingMeta.date), | ||
fetchedAt: Math.max(incomingMeta.fetchedAt, existingMeta.fetchedAt) | ||
}; | ||
} | ||
function expectedSchemaType(schema) { | ||
@@ -150,3 +117,3 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema; | ||
the JSON. By default, this only happens if "content-type" header includes "json". | ||
See https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information | ||
See https://dataclient.io/rest/api/RestEndpoint#parseResponse for more information | ||
@@ -180,2 +147,2 @@ Schema: ${JSON.stringify(schema, undefined, 2)} | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJub3JtYWxpemUiLCJhcnJheU5vcm1hbGl6ZSIsIm9iamVjdE5vcm1hbGl6ZSIsIkRFTEVURUQiLCJ2aXNpdCIsInZhbHVlIiwicGFyZW50Iiwia2V5Iiwic2NoZW1hIiwiYWRkRW50aXR5IiwidmlzaXRlZEVudGl0aWVzIiwic3RvcmVFbnRpdGllcyIsImFyZ3MiLCJtZXRob2QiLCJBcnJheSIsImlzQXJyYXkiLCJhZGRFbnRpdGllcyIsImVudGl0aWVzIiwiaW5kZXhlcyIsInN0b3JlSW5kZXhlcyIsInN0b3JlRW50aXR5TWV0YSIsIm1ldGEiLCJwcm9jZXNzZWRFbnRpdHkiLCJpZCIsInNjaGVtYUtleSIsIk9iamVjdCIsImFzc2lnbiIsImV4aXN0aW5nRW50aXR5IiwibWVyZ2UiLCJpblN0b3JlRW50aXR5IiwiaW5TdG9yZU1ldGEiLCJtZXJnZVdpdGhTdG9yZSIsIm1lcmdlTWV0YVdpdGhTdG9yZSIsImV4cGlyZXNBdCIsImRhdGUiLCJmZXRjaGVkQXQiLCJoYW5kbGVJbmRleGVzIiwic2NoZW1hSW5kZXhlcyIsImVudGl0eSIsImluZGV4IiwiaW5kZXhNYXAiLCJwcm9jZXNzIiwiZW52IiwiTk9ERV9FTlYiLCJjb25zb2xlIiwid2FybiIsIkpTT04iLCJzdHJpbmdpZnkiLCJ1bmRlZmluZWQiLCJleGlzdGluZ01ldGEiLCJpbmNvbWluZ01ldGEiLCJleGlzdGluZyIsImluY29taW5nIiwidXNlSW5jb21pbmciLCJNYXRoIiwibWF4IiwiZXhwZWN0ZWRTY2h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ZWRFbnRpdHkpO1xuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCBpblN0b3JlRW50aXR5ID0gc3RvcmVFbnRpdGllc1tzY2hlbWFLZXldW2lkXTtcbiAgICAgIGxldCBpblN0b3JlTWV0YToge1xuICAgICAgICBkYXRlOiBudW1iZXI7XG4gICAgICAgIGV4cGlyZXNBdDogbnVtYmVyO1xuICAgICAgICBmZXRjaGVkQXQ6IG51bWJlcjtcbiAgICAgIH07XG4gICAgICAvLyB0aGlzIGNhc2Ugd2UgYWxyZWFkeSBoYXZlIHRoaXMgZW50aXR5IGluIHN0b3JlXG4gICAgICBpZiAoaW5TdG9yZUVudGl0eSAmJiAoaW5TdG9yZU1ldGEgPSBzdG9yZUVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0pKSB7XG4gICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gc2NoZW1hLm1lcmdlV2l0aFN0b3JlXG4gICAgICAgICAgPyBzY2hlbWEubWVyZ2VXaXRoU3RvcmUoXG4gICAgICAgICAgICAgIGluU3RvcmVNZXRhLFxuICAgICAgICAgICAgICBtZXRhLFxuICAgICAgICAgICAgICBpblN0b3JlRW50aXR5LFxuICAgICAgICAgICAgICBwcm9jZXNzZWRFbnRpdHksXG4gICAgICAgICAgICApXG4gICAgICAgICAgOiBtZXJnZVdpdGhTdG9yZShcbiAgICAgICAgICAgICAgc2NoZW1hLFxuICAgICAgICAgICAgICBpblN0b3JlTWV0YSxcbiAgICAgICAgICAgICAgbWV0YSxcbiAgICAgICAgICAgICAgaW5TdG9yZUVudGl0eSxcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkRW50aXR5LFxuICAgICAgICAgICAgKTtcbiAgICAgICAgc3RvcmVFbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdID0gc2NoZW1hLm1lcmdlTWV0YVdpdGhTdG9yZVxuICAgICAgICAgID8gc2NoZW1hLm1lcmdlTWV0YVdpdGhTdG9yZShcbiAgICAgICAgICAgICAgaW5TdG9yZU1ldGEsXG4gICAgICAgICAgICAgIG1ldGEsXG4gICAgICAgICAgICAgIGluU3RvcmVFbnRpdHksXG4gICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgIClcbiAgICAgICAgICA6IG1lcmdlTWV0YVdpdGhTdG9yZShcbiAgICAgICAgICAgICAgc2NoZW1hLFxuICAgICAgICAgICAgICBpblN0b3JlTWV0YSxcbiAgICAgICAgICAgICAgbWV0YSxcbiAgICAgICAgICAgICAgaW5TdG9yZUVudGl0eSxcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkRW50aXR5LFxuICAgICAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gcHJvY2Vzc2VkRW50aXR5O1xuICAgICAgICBzdG9yZUVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0gPSB7XG4gICAgICAgICAgLy8gVE9ETyhicmVha2luZyk6IFJlbW92ZSBzY2hlbWEuZXhwaXJlc2F0XG4gICAgICAgICAgZXhwaXJlc0F0OiBzY2hlbWEuZXhwaXJlc0F0XG4gICAgICAgICAgICA/IHNjaGVtYS5leHBpcmVzQXQobWV0YSwgcHJvY2Vzc2VkRW50aXR5KVxuICAgICAgICAgICAgOiBtZXRhLmV4cGlyZXNBdCxcbiAgICAgICAgICBkYXRlOiBtZXRhLmRhdGUsXG4gICAgICAgICAgZmV0Y2hlZEF0OiBtZXRhLmZldGNoZWRBdCxcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyB1cGRhdGUgaW5kZXhcbiAgICBpZiAoc2NoZW1hLmluZGV4ZXMpIHtcbiAgICAgIGlmICghKHNjaGVtYUtleSBpbiBpbmRleGVzKSkge1xuICAgICAgICBpbmRleGVzW3NjaGVtYUtleV0gPSB7fTtcbiAgICAgICAgc3RvcmVJbmRleGVzW3NjaGVtYUtleV0gPSB7IC4uLnN0b3JlS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pdGllc1tzY2hlbWFLZXldW2lkXSA9IHNjaGVtYS5tZXJnZVdpdGhTdG9yZShcbiAgICAgICAgICBpblN0b3JlTWV0YSxcbiAgICAgICAgICBtZXRhLFxuICAgICAgICAgIGluU3RvcmVFbnRpdHksXG4gICAgICAgICAgcHJvY2Vzc2VkRW50aXR5LFxuICAgICAgICApO1xuICAgICAgICBzdG9yZUVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0gPSBzY2hlbWEubWVyZ2VNZXRhV2l0aFN0b3JlKFxuICAgICAgICAgIGluU3RvcmVNZXRhLFxuICAgICAgICAgIG1ldGEsXG4gICAgICAgICAgaW5TdG9yZUVudGl0eSxcbiAgICAgICAgICBwcm9jZXNzZWRFbnRpdHksXG4gICAgICAgICk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBlbnRpdGllc1tzY2hlbWFLZXldW2lkXSA9IHByb2Nlc3NlZEVudGl0eTtcbiAgICAgICAgc3RvcmVFbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdID0ge1xuICAgICAgICAgIGV4cGlyZXNBdDogbWV0YS5leHBpcmVzQXQsXG4gICAgICAgICAgZGF0ZTogbWV0YS5kYXRlLFxuICAgICAgICAgIGZldGNoZWRBdDogbWV0YS5mZXRjaGVkQXQsXG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gdXBkYXRlIGluZGV4XG4gICAgaWYgKHNjaGVtYS5pbmRleGVzKSB7XG4gICAgICBpZiAoIShzY2hlbWFLZXkgaW4gaW5kZXhlcykpIHtcbiAgICAgICAgaW5kZXhlc1tzY2hlbWFLZXldID0ge307XG4gICAgICAgIHN0b3JlSW5kZXhlc1tzY2hlbWFLZXldID0geyAuLi5zdG9yZUluZGV4ZXNbc2NoZW1hS2V5XSB9O1xuICAgICAgfVxuICAgICAgaGFuZGxlSW5kZXhlcyhcbiAgICAgICAgaWQsXG4gICAgICAgIHNjaGVtYS5pbmRleGVzLFxuICAgICAgICBpbmRleGVzW3N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1xuICAgICAgcmVhZG9ubHkgW3BrOiBzdHJpbmddOiB7XG4gICAgICAgIHJlYWRvbmx5IGRhdGU6IG51bWJlcjtcbiAgICAgICAgcmVhZG9ubHkgZXhwaXJlc0F0OiBudW1iZXI7XG4gICAgICAgIHJlYWRvbmx5IGZldGNoZWRBdDogbnVtYmVyO1xuICAgICAgfTtcbiAgICB9O1xuICB9O1xufTtcblxuZXhwb3J0IHR5cGUgRW50aXR5TWFwPFQgPSBhbnk+ID0gUmVjb3JkPHN0cmluZywgRW50aXR5SW50ZXJmYWNlPFQ+PjtcbiJdLCJtYXBwaW5ncyI6IiJ9 |
@@ -11,9 +11,4 @@ import { INVALID } from './symbol.js'; | ||
}); | ||
if (typeof entity === 'symbol') { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
return schema.denormalizeOnly(entity, args, unvisit); | ||
// TODO(breaking): Change to this as breaking change once we only support newer entities | ||
} else if (entity.toString().includes('DELETED')) { | ||
return INVALID; | ||
} | ||
if (typeof entity === 'symbol' && typeof schema.denormalize === 'function') { | ||
return schema.denormalize(entity, args, unvisit); | ||
} | ||
@@ -43,12 +38,4 @@ if (typeof entity !== 'object' || entity === null) { | ||
function unvisitEntityObject(entity, schema, unvisit, pk, localCacheKey, args) { | ||
let entityCopy, _, deleted; | ||
/* istanbul ignore else */ | ||
if (schema.createIfValid) { | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
} /* istanbul ignore next */else { | ||
entityCopy = entity; | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
let _, deleted; | ||
const entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
if (entityCopy === undefined) { | ||
@@ -58,24 +45,8 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
if (typeof schema.denormalizeOnly === 'function') { | ||
localCacheKey[pk] = schema.denormalizeOnly(entityCopy, args, unvisit); | ||
} else { | ||
[localCacheKey[pk], _, deleted] = schema.denormalize(entityCopy, unvisit); | ||
if (deleted) localCacheKey[pk] = INVALID; | ||
if (typeof schema.denormalize === 'function') { | ||
localCacheKey[pk] = schema.denormalize(entityCopy, args, unvisit); | ||
} | ||
} | ||
} | ||
// TODO(breaking): remove once unused | ||
/* istanbul ignore next */ | ||
function withTrackedEntities(unvisit) { | ||
// every time we nest, we want to unwrap back to the top. | ||
// this is due to only needed the next level of nested entities for lookup | ||
const originalUnvisit = unvisit.og || unvisit; | ||
const wrappedUnvisit = (input, schema) => originalUnvisit(input, schema); | ||
wrappedUnvisit.og = unvisit; | ||
return wrappedUnvisit; | ||
} | ||
const getUnvisit = (getEntity, cache, args) => { | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
const unvisitAdapter = getUnvisitAdapter(unvisit); | ||
function unvisit(input, schema) { | ||
@@ -86,14 +57,11 @@ if (!schema) return input; | ||
} | ||
const hasDenormalize = typeof schema.denormalize === 'function' || typeof schema.denormalizeOnly === 'function'; | ||
const hasDenormalize = typeof schema.denormalize === 'function'; | ||
// deserialize fields (like Date) | ||
// deserialize fields (like Temporal.Instant) | ||
if (!hasDenormalize && typeof schema === 'function') { | ||
if (input instanceof schema) return input; | ||
if (input === undefined) return input; | ||
return new schema(input); | ||
return schema(input); | ||
} | ||
if (input === undefined) { | ||
var _schema$constructor; | ||
// TODO(breaking): Drop support for initial All version | ||
const isAll = ((_schema$constructor = schema.constructor) == null ? void 0 : _schema$constructor.name) === 'AllSchema'; | ||
const isAll = schema.constructor.name === 'AllSchema'; | ||
return isAll ? INVALID : undefined; | ||
@@ -106,10 +74,6 @@ } | ||
if (isEntity(schema)) { | ||
return unvisitEntity(input, schema, args, schema.denormalizeOnly ? unvisit : unvisitAdapter, getEntity, cache); | ||
return unvisitEntity(input, schema, args, unvisit, getEntity, cache); | ||
} | ||
if (hasDenormalize) { | ||
if (schema.denormalizeOnly) { | ||
return schema.denormalizeOnly(input, args, unvisit); | ||
} else { | ||
return denormalizeLegacySchema(schema, input, unvisitAdapter); | ||
} | ||
return schema.denormalize(input, args, unvisit); | ||
} | ||
@@ -126,26 +90,2 @@ return input; | ||
export default getUnvisit; | ||
function denormalizeLegacySchema(schema, input, unvisitAdapter) { | ||
const [data, _, suspend] = schema.denormalize(input, unvisitAdapter); | ||
// TODO(breaking): Drop support for initial Query version | ||
// queryEndpoint schema only overrides 'denormalize' and 'infer' | ||
const isQuery = !Object.hasOwn(schema, 'normalize') && Object.hasOwn(schema, 'denormalize') && Object.hasOwn(schema, 'infer'); | ||
return suspend && !isQuery ? INVALID : data; | ||
} | ||
// TODO(breaking): This handles legacy schemas from 3.7 and below | ||
function getUnvisitAdapter(unvisit) { | ||
return function (input, schema) { | ||
var _schema$constructor2; | ||
const isAll = (schema == null ? void 0 : (_schema$constructor2 = schema.constructor) == null ? void 0 : _schema$constructor2.name) === 'AllSchema'; | ||
const value = unvisit(input, schema); | ||
// TODO(breaking): Drop support for initial All version | ||
if (isAll) { | ||
// we swap 'found' and 'suspend' because the initial Query version used 'found' to determine whether | ||
// it should 'process' | ||
return [typeof value === 'symbol' ? undefined : value, typeof value !== 'symbol', false]; | ||
} | ||
return [typeof value === 'symbol' ? undefined : value, true, typeof value === 'symbol']; | ||
}; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJJTlZBTElEIiwiaXNFbnRpdHkiLCJkZW5vcm1hbGl6ZSIsImFycmF5RGVub3JtYWxpemUiLCJpc0ltbXV0YWJsZSIsIm9iamVjdERlbm9ybWFsaXplIiwidW52aXNpdEVudGl0eSIsImVudGl0eU9ySWQiLCJzY2hlbWEiLCJhcmdzIiwidW52aXNpdCIsImdldEVudGl0eSIsImNhY2hlIiwiZW50aXR5Iiwia2V5IiwicGsiLCJkZW5vcm1hbGl6ZU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xpQkFBaUI7TUFDckIsT0FBTzRCLE1BQU0sQ0FBQ3pCLE1BQU0sRUFBRW9CLEtBQUssRUFBRW5CLElBQUksRUFBRUMsT0FBTyxDQUFDO0lBQzdDO0lBRUEsSUFBSVQsUUFBUSxDQUFDTyxNQUFNLENBQUMsRUFBRTtNQUNwQixPQUFPRixhQUFhLENBQUNzQixLQUFLLEVBQUVwQixNQUFNLEVBQUVDLElBQUksRUFBRUMsT0FBTyxFQUFFQyxTQUFTLEVBQUVDLEtBQUssQ0FBQztJQUN0RTtJQUVBLElBQUlpQixjQUFjLEVBQUU7TUFDbEIsT0FBT3JCLE1BQU0sQ0FBQ04sV0FBVyxDQUFDMEIsS0FBSyxFQUFFbkIsSUFBSSxFQUFFQyxPQUFPLENBQUM7SUFDakQ7SUFFQSxPQUFPa0IsS0FBSztFQUNkO0VBRUEsT0FBTyxDQUFDQSxLQUFVLEVBQUVwQixNQUFXLEtBQW1DO0lBQ2hFO0lBQ0E7SUFDQSxNQUFNNEIsUUFBUSxHQUFHQyxNQUFNLENBQUNULEtBQUssQ0FBQyxLQUFLQSxLQUFLLElBQUlTLE1BQU0sQ0FBQzdCLE1BQU0sQ0FBQyxLQUFLQSxNQUFNO0lBQ3JFLE9BQU9JLEtBQUssQ0FBQzBCLFVBQVUsQ0FBQ1YsS0FBSyxFQUFFUSxRQUFRLEVBQUUsTUFBTTFCLE9BQU8sQ0FBQ2tCLEtBQUssRUFBRXBCLE1BQU0sQ0FBQyxDQUFDO0VBQ3hFLENBQUM7QUFDSCxDQUFDO0FBQ0QsZUFBZW1CLFVBQVUifQ== |
@@ -7,10 +7,8 @@ import { denormalize } from './denormalize/denormalize.js'; | ||
export { default as inferResults, validateInference } from './inferResults.js'; | ||
export { DELETED } from './special.js'; | ||
export type { AbstractInstanceType, NormalizeReturnType, NormalizedSchema, DenormalizeReturnType, DenormalizeCache, Path, } from './types.js'; | ||
export type { AbstractInstanceType, NormalizeReturnType, NormalizedSchema, DenormalizeCache, Path, Denormalize, DenormalizeNullable, Normalize, NormalizeNullable, } from './types.js'; | ||
export * from './endpoint/types.js'; | ||
export * from './interface.js'; | ||
export * from './Expiry.js'; | ||
export * from './normal.js'; | ||
export { INVALID } from './denormalize/symbol.js'; | ||
export { denormalize, denormalizeCached, normalize, isEntity, WeakEntityMap }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -10,9 +10,7 @@ Object.hasOwn = Object.hasOwn || /* istanbul ignore next */function hasOwn(it, key) { | ||
export { default as inferResults, validateInference } from './inferResults.js'; | ||
export { DELETED } from './special.js'; | ||
export * from './endpoint/types.js'; | ||
export * from './interface.js'; | ||
export * from './Expiry.js'; | ||
export * from './normal.js'; | ||
export { INVALID } from './denormalize/symbol.js'; | ||
export { denormalize, denormalizeCached, normalize, isEntity, WeakEntityMap }; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJPYmplY3QiLCJoYXNPd24iLCJpdCIsImtleSIsInByb3RvdHlwZSIsImhhc093blByb3BlcnR5IiwiY2FsbCIsImRlbm9ybWFsaXplIiwiZGVub3JtYWxpemVDYWNoZWQiLCJpc0VudGl0eSIsIm5vcm1hbGl6ZSIsIldlYWtFbnRpdHlNYXAiLCJkZWZhdWx0IiwiaW5mZXJSZXN1bHRzIiwidmFsaWRhdGVJbmZlcmVuY2UiLCJERUxFVEVEIiwiSU5WQUxJRCJdLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJPYmplY3QuaGFzT3duID1cbiAgT2JqZWN0Lmhhc093biB8fFxuICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqLyBmdW5jdGlvbiBoYXNPd24oaXQsIGtleSkge1xuICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoaXQsIGtleSk7XG4gIH07XG5pbXBvcnQgeyBkZW5vcm1hbGl6ZSB9IGZyb20gJy4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UFFQyxpQkFBaUIsRUFBRUUsU0FBUyxFQUFFRCxRQUFRLEVBQUVFLGFBQWEifQ== |
@@ -1,2 +0,1 @@ | ||
import { isEntity } from './isEntity.js'; | ||
import { infer as arrayInfer } from './schemas/Array.js'; | ||
@@ -11,9 +10,3 @@ import { infer as objectInfer } from './schemas/Object.js'; | ||
if (canInfer(schema)) { | ||
var _entities$schema$key; | ||
const ret = schema.infer(args, indexes, inferResults, entities); | ||
// TODO(breaking): back compatibility with endpoint@3.7 and less | ||
if (isEntity(schema) && ret !== undefined && !((_entities$schema$key = entities[schema.key]) != null && _entities$schema$key[ret])) { | ||
return undefined; | ||
} | ||
return ret; | ||
return schema.infer(args, indexes, inferResults, entities); | ||
} | ||
@@ -42,2 +35,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc0VudGl0eSIsImluZmVyIiwiYXJyYXlJbmZlciIsIm9iamVjdEluZmVyIiwiaW5mZXJSZXN1bHRzIiwic2NoZW1hIiwiYXJncyIsImluZGV4ZXMiLCJlbnRpdGllcyIsImNhbkluZmVyIiwiX2VudGl0aWVzJHNjaGVtYSRrZXkiLCJyZXQiLCJ1bmRlZmluZWQiLCJrZXkiLCJtZXRob2QiLCJBcnJheSIsImlzQXJyYXkiLCJ2YWxpZGF0ZUluZmVyZW5jZSIsInJlc3VsdHMiLCJPYmplY3QiLCJ2YWx1ZXMiLCJldmVyeSJdLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmZlclJlc3VsdHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUge1xuICBTY2hlbWEsXG4gIFNjaGVtYVNpbXBsZSxcbiAgTm9ybWFsaXplZEluZGV4LFxuICBFbnRpdHlUYWJsZSxcbn0gZnJvbSAnLi9pbnRlcmZhY2UuanMnO1xuaW1wb3J0IHsgaXNFbnRpdHkgfSBmcm9tICcuL2lzRW50aXR5LmpzJztcbmltc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Simple<T = any> { | ||
normalize(input: any, parent: any, key: any, visit: (...args: any) => any, addEntity: (...args: any) => any, visitedEntities: Record<string, any>, storeEntities?: any, args?: any[]): any; | ||
denormalize?(input: {}, unvisit: UnvisitFunction): [denormalized: T, found: boolean, suspend: boolean]; | ||
denormalizeOnly?(input: {}, args: any, unvisit: (input: any, schema: any) => any): T; | ||
denormalize(input: {}, args: any, unvisit: (input: any, schema: any) => any): T; | ||
infer(args: readonly any[], indexes: NormalizedIndex, recurse: (...args: any) => any, entities: EntityTable): any; | ||
@@ -20,15 +17,11 @@ } | ||
_normalizeNullable(): any; | ||
_denormalizeNullable(): [N, boolean, boolean]; | ||
_denormalizeNullable(): N; | ||
} | ||
export interface EntityInterface<T = any> extends SchemaSimple { | ||
createIfValid?(props: any): any; | ||
createIfValid(props: any): any; | ||
pk(params: any, parent?: any, key?: string, args?: readonly any[]): string | undefined; | ||
readonly key: string; | ||
merge(existing: any, incoming: any): any; | ||
/** @deprecated use mergeWithStore instead (which can call this) */ | ||
expiresAt?(meta: any, input: any): number; | ||
mergeWithStore?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
mergeMetaWithStore?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
/** @deprecated use mergeWithStore instead (which can call this) */ | ||
useIncoming?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): boolean; | ||
mergeWithStore(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
mergeMetaWithStore(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
indexes?: any; | ||
@@ -39,7 +32,2 @@ schema: Record<string, Schema>; | ||
} | ||
export interface UnvisitFunction { | ||
(input: any, schema: any): [any, boolean, boolean] | any; | ||
og?: UnvisitFunction; | ||
setLocal?: (entity: any) => void; | ||
} | ||
export interface NormalizedIndex { | ||
@@ -46,0 +34,0 @@ readonly [entityKey: string]: { |
export {}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uI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W50aXR5OiBhbnkpID0+IHZvaWQ7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgTm9ybWFsaXplZEluZGV4IHtcbiAgcmVhZG9ubHkgW2VudGl0eUtleTogc3RyaW5nXToge1xuICAgIHJlYWRvbmx5IFtpbmRleE5hbWU6IHN0cmluZ106IHsgcmVhZG9ubHkgW2xvb2t1cDogc3RyaW5nXTogc3RyaW5nIH07XG4gIH07XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRW50aXR5VGFibGUge1xuICBbZW50aXR5S2V5OiBzdHJpbmddOlxuICAgIHwge1xuICAgICAgICBbcGs6IHN0cmluZ106IHVua25vd247XG4gICAgICB9XG4gICAgfCB1bmRlZmluZWQ7XG59XG4iXSwibWFwcGluZ3MiOiIifQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2ludGVyZmFjZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBTY2hlbWEgPVxuICB8IG51bGxcbiAgfCBzdHJpbmdcbiAgfCB7IFtLOiBzdHJpbmddOiBhbnkgfVxuICB8IFNjaGVtYVtdXG4gIHwgU2NoZW1hU2ltcGxlXG4gIHwgU2VyaWFsaXphYmxlO1xuXG5leHBvcnQgdHlwZSBTZXJpYWxpemFibGU8XG4gIFQgZXh0ZW5kcyB7IHRvSlNPTigpOiBzdHJpbmcgfSA9IHsgdG9KU09OKCk6IHN0cmluZyB9LFxuPiA9ICh2YWx1ZTogYW55KSA9PiBUO1xuXG5leHBvcnQgaW50ZXJmYWNlIFNjaGVtYVNpbXBsZTxUID0gYW55PiB7XG4gIG5vcm1hbGl6ZShcbiAgICBpbnB1dDogYW55LFxuICAgIHBhcmVudDogYW55LFxuICAgIGtleTogYW55LFxuICAgIHZpc2l0OiAoLi4uYXJnczogYW55KSA9PiBhbnksXG4gICAgYWRkRW50aXR5OiAoLi4uYXJn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iBhbnk7XG4gIHBrKFxuICAgIHBhcmFtczogYW55LFxuICAgIHBhcmVudD86IGFueSxcbiAgICBrZXk/OiBzdHJpbmcsXG4gICAgYXJncz86IHJlYWRvbmx5IGFueVtdLFxuICApOiBzdHJpbmcgfCB1bmRlZmluZWQ7XG4gIHJlYWRvbmx5IGtleTogc3RyaW5nO1xuICBtZXJnZShleGlzdGluZzogYW55LCBpbmNvbWluZzogYW55KTogYW55O1xuICBtZXJnZVdpdGhTdG9yZShcbiAgICBleGlzdGluZ01ldGE6IGFueSxcbiAgICBpbmNvbWluZ01ldGE6IGFueSxcbiAgICBleGlzdGluZzogYW55LFxuICAgIGluY29taW5nOiBhbnksXG4gICk6IGFueTtcbiAgbWVyZ2VNZXRhV2l0aFN0b3JlKFxuICAgIGV4aXN0aW5nTWV0YTogYW55LFxuICAgIGluY29taW5nTWV0YTogYW55LFxuICAgIGV4aXN0aW5nOiBhbnksXG4gICAgaW5jb21pbmc6IGFueSxcbiAgKTogYW55O1xuICBpbmRleGVzPzogYW55O1xuICBzY2hlbWE6IFJlY29yZDxzdHJpbmcsIFNjaGVtYT47XG4gIGNhY2hlV2l0aD86IG9iamVjdDtcbiAgcHJvdG90eXBlOiBUO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIE5vcm1hbGl6ZWRJbmRleCB7XG4gIHJlYWRvbmx5IFtlbnRpdHlLZXk6IHN0cmluZ106IHtcbiAgICByZWFkb25seSBbaW5kZXhOYW1lOiBzdHJpbmddOiB7IHJlYWRvbmx5IFtsb29rdXA6IHN0cmluZ106IHN0cmluZyB9O1xuICB9O1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEVudGl0eVRhYmxlIHtcbiAgW2VudGl0eUtleTogc3RyaW5nXTpcbiAgICB8IHtcbiAgICAgICAgW3BrOiBzdHJpbmddOiB1bmtub3duO1xuICAgICAgfVxuICAgIHwgdW5kZWZpbmVkO1xufVxuIl0sIm1hcHBpbmdzIjoiIn0= |
@@ -0,4 +1,4 @@ | ||
import { INVALID } from './denormalize/symbol.js'; | ||
import { normalize as arrayNormalize } from './schemas/Array.js'; | ||
import { normalize as objectNormalize } from './schemas/Object.js'; | ||
import { DELETED } from './special.js'; | ||
const visit = (value, parent, key, schema, addEntity, visitedEntities, storeEntities, args) => { | ||
@@ -12,7 +12,2 @@ if (!value || !schema) { | ||
} | ||
// serializable | ||
if (typeof schema === 'function') { | ||
return new schema(value); | ||
} | ||
if (typeof value !== 'object' || typeof schema !== 'object') return value; | ||
@@ -41,9 +36,8 @@ const method = Array.isArray(schema) ? arrayNormalize : objectNormalize; | ||
if (inStoreEntity && (inStoreMeta = storeEntityMeta[schemaKey][id])) { | ||
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore ? schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeMetaWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity); | ||
entities[schemaKey][id] = schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
storeEntityMeta[schemaKey][id] = schema.mergeMetaWithStore(inStoreMeta, meta, inStoreEntity, processedEntity); | ||
} else { | ||
entities[schemaKey][id] = processedEntity; | ||
storeEntityMeta[schemaKey][id] = { | ||
// TODO(breaking): Remove schema.expiresat | ||
expiresAt: schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt, | ||
expiresAt: meta.expiresAt, | ||
date: meta.date, | ||
@@ -79,3 +73,3 @@ fetchedAt: meta.fetchedAt | ||
if (storeEntities && storeEntities[id] && storeEntities[id][index] !== entity[index]) { | ||
indexMap[storeEntities[id][index]] = DELETED; | ||
indexMap[storeEntities[id][index]] = INVALID; | ||
} | ||
@@ -93,29 +87,2 @@ if (index in entity) { | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeStore() instead */ | ||
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
const useIncoming = | ||
// useIncoming should not be used with legacy optimistic | ||
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date; | ||
if (useIncoming) { | ||
if (typeof incoming !== typeof existing) { | ||
return incoming; | ||
} else { | ||
return schema.merge(existing, incoming); | ||
} | ||
} else { | ||
return existing; | ||
} | ||
} | ||
// TODO(breaking): remove this in 1 breaking releases | ||
/** @deprecated use Entity.mergeMetaWithStore() instead */ | ||
function mergeMetaWithStore(schema, existingMeta, incomingMeta, existing, incoming) { | ||
return { | ||
expiresAt: Math.max(schema.expiresAt ? schema.expiresAt(incomingMeta, incoming) : incomingMeta.expiresAt, existingMeta.expiresAt), | ||
date: Math.max(incomingMeta.date, existingMeta.date), | ||
fetchedAt: Math.max(incomingMeta.fetchedAt, existingMeta.fetchedAt) | ||
}; | ||
} | ||
function expectedSchemaType(schema) { | ||
@@ -156,3 +123,3 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema; | ||
the JSON. By default, this only happens if "content-type" header includes "json". | ||
See https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information | ||
See https://dataclient.io/rest/api/RestEndpoint#parseResponse for more information | ||
@@ -192,2 +159,2 @@ Schema: ${JSON.stringify(schema, undefined, 2)} | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJub3JtYWxpemUiLCJhcnJheU5vcm1hbGl6ZSIsIm9iamVjdE5vcm1hbGl6ZSIsIkRFTEVURUQiLCJ2aXNpdCIsInZhbHVlIiwicGFyZW50Iiwia2V5Iiwic2NoZW1hIiwiYWRkRW50aXR5IiwidmlzaXRlZEVudGl0aWVzIiwic3RvcmVFbnRpdGllcyIsImFyZ3MiLCJtZXRob2QiLCJBcnJheSIsImlzQXJyYXkiLCJ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RdID0gc2NoZW1hLm1lcmdlV2l0aFN0b3JlXG4gICAgICAgICAgPyBzY2hlbWEubWVyZ2VXaXRoU3RvcmUoXG4gICAgICAgICAgICAgIGluU3RvcmVNZXRhLFxuICAgICAgICAgICAgICBtZXRhLFxuICAgICAgICAgICAgICBpblN0b3JlRW50aXR5LFxuICAgICAgICAgICAgICBwcm9jZXNzZWRFbnRpdHksXG4gICAgICAgICAgICApXG4gICAgICAgICAgOiBtZXJnZVdpdGhTdG9yZShcbiAgICAgICAgICAgICAgc2NoZW1hLFxuICAgICAgICAgICAgICBpblN0b3JlTWV0YSxcbiAgICAgICAgICAgICAgbWV0YSxcbiAgICAgICAgICAgICAgaW5TdG9yZUVudGl0eSxcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkRW50aXR5LFxuICAgICAgICAgICAgKTtcbiAgICAgICAgc3RvcmVFbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdID0gc2NoZW1hLm1lcmdlTWV0YVdpdGhTdG9yZVxuICAgICAgICAgID8gc2NoZW1hLm1lcmdlTWV0YVdpdGhTdG9yZShcbiAgICAgICAgICAgICAgaW5TdG9yZU1ldGEsXG4gICAgICAgICAgICAgIG1ldGEsXG4gICAgICAgICAgICAgIGluU3RvcmVFbnRpdHksXG4gICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgIClcbiAgICAgICAgICA6IG1lcmdlTWV0YVdpdGhTdG9yZShcbiAgICAgICAgICAgICAgc2NoZW1hLFxuICAgICAgICAgICAgICBpblN0b3JlTWV0YSxcbiAgICAgICAgICAgICAgbWV0YSxcbiAgICAgICAgICAgICAgaW5TdG9yZUVudGl0eSxcbiAgICAgICAgICAgICAgcHJvY2Vzc2VkRW50aXR5LFxuICAgICAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gcHJvY2Vzc2VkRW50aXR5O1xuICAgICAgICBzdG9yZUVudGl0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sQ0FBQztFQUNwRCxNQUFNbUMsVUFBZSxHQUFHO0lBQUUsR0FBR2xDO0VBQWdCLENBQUM7RUFDOUMsTUFBTVgsU0FBUyxHQUFHTyxXQUFXLENBQzNCNkMsV0FBVyxFQUNYQyxVQUFVLEVBQ1Y3QyxRQUFRLEVBQ1JDLE9BQU8sRUFDUG9DLFVBQVUsRUFDVmpDLElBQ0YsQ0FBQztFQUNELE1BQU1YLGVBQWUsR0FBRyxDQUFDLENBQUM7RUFFMUIsTUFBTTJDLE1BQU0sR0FBR2pELEtBQUssQ0FDbEI2QyxLQUFLLEVBQ0xBLEtBQUssRUFDTEgsU0FBUyxFQUNUdEMsTUFBTSxFQUNOQyxTQUFTLEVBQ1RDLGVBQWUsRUFDZkMsYUFBYSxFQUNiQyxJQUNGLENBQUM7RUFDRCxPQUFPO0lBQUVLLFFBQVE7SUFBRUMsT0FBTztJQUFFbUMsTUFBTTtJQUFFQztFQUFXLENBQUM7QUFDbEQsQ0FBQyJ9 |
@@ -48,9 +48,6 @@ import type { Schema, Serializable, EntityInterface, NormalizedIndex } from './interface.js'; | ||
export type DenormalizeNullableNestedSchema<S extends NestedSchemaClass> = keyof S['schema'] extends never ? S['prototype'] : string extends keyof S['schema'] ? S['prototype'] : S['prototype']; | ||
export type DenormalizeReturnType<T> = T extends (input: any, unvisit: any) => [infer R, any, any] ? R : never; | ||
export type NormalizeReturnType<T> = T extends (...args: any) => infer R ? R : never; | ||
export type Denormalize<S> = S extends EntityInterface<infer U> ? U : S extends RecordClass ? AbstractInstanceType<S> : S extends { | ||
denormalizeOnly: (...args: any) => any; | ||
} ? ReturnType<S['denormalizeOnly']> : S extends { | ||
denormalize: (...args: any) => any; | ||
} ? DenormalizeReturnType<S['denormalize']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] : S extends { | ||
} ? ReturnType<S['denormalize']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] : S extends { | ||
[K: string]: any; | ||
@@ -60,3 +57,3 @@ } ? DenormalizeObject<S> : S; | ||
_denormalizeNullable: (...args: any) => any; | ||
} ? DenormalizeReturnType<S['_denormalizeNullable']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] | undefined : S extends { | ||
} ? ReturnType<S['_denormalizeNullable']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] | undefined : S extends { | ||
[K: string]: any; | ||
@@ -63,0 +60,0 @@ } ? DenormalizeNullableObject<S> : S; |
export {}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL3R5cGVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHtcbiAgU2NoZW1hLFxuICBTZXJpYWxpemFibGUsXG4gIEVudGl0eUludGVyZmFjZSxcbiAgTm9ybWFsaXplZEluZGV4LFxuICBTY2hlbWFDbGFzcyxcbn0gZnJvbSAnLi9pbnRlcmZhY2UuanMnO1xuaW1wb3J0IHR5cGUgV2Vha0VudGl0eU1hcCBmcm9tICcuL1dlYWtFbnRpdHlNYXAuanMnO1xuXG5leHBvcnQgaW50ZXJmYWNlIFBhdGgge1xuICBrZXk6IHN0cmluZztcbiAgcGs6IHN0cmluZztcbn1cblxuLy8gVHlwZVNjcmlwdCA8NC4yIEluc3RhbmNlVHlwZTw+IGRvZXMgbm90IHdvcmsgb24gYWJzdHJhY3QgY2xhc3Nlc1xuZXhwb3J0IHR5cGUgQWJzdHJhY3RJbnN0YW5jZVR5cGU8VD4gPSBUIGV4dGVuZHMgbmV3ICguLi5hcmdzOiBhbnkpID0+IGluZmVyIFVcbiAgPyBVXG4gIDogVCBleHRlbmRzIHsgcHJvdG90eXBlOiBpbmZlciBVIH1cbiAgPyBVXG4gIDogbmV2ZXI7XG5cbmV4cG9ydCB0eXBlIE5vcm1hbGl6ZWRFbnRpdHk8VD4gPSBUIGV4dGVuZH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GV4O1xuICBlbnRpdHlNZXRhOiB7XG4gICAgcmVhZG9ubHkgW2VudGl0eUtleTogc3RyaW5nXToge1xuICAgICAgcmVhZG9ubHkgW3BrOiBzdHJpbmddOiB7XG4gICAgICAgIHJlYWRvbmx5IGRhdGU6IG51bWJlcjtcbiAgICAgICAgcmVhZG9ubHkgZXhwaXJlc0F0OiBudW1iZXI7XG4gICAgICAgIHJlYWRvbmx5IGZldGNoZWRBdDogbnVtYmVyO1xuICAgICAgfTtcbiAgICB9O1xuICB9O1xufTtcblxuZXhwb3J0IHR5cGUgRW50aXR5TWFwPFQgPSBhbnk+ID0gUmVjb3JkPHN0cmluZywgRW50aXR5SW50ZXJmYWNlPFQ+PjtcbiJdLCJtYXBwaW5ncyI6IiJ9 |
{ | ||
"name": "@data-client/normalizr", | ||
"version": "0.2.2", | ||
"version": "0.8.0", | ||
"description": "Normalizes and denormalizes JSON according to schema for Redux and Flux applications", | ||
"homepage": "https://resthooks.io/docs/concepts/normalization", | ||
"homepage": "https://dataclient.io/docs/concepts/normalization", | ||
"bugs": { | ||
@@ -7,0 +7,0 @@ "url": "https://github.com/data-client/data-client/issues" |
@@ -29,8 +29,8 @@ # normalizr | ||
- [Introduction](https://resthooks.io/docs/concepts/normalization) | ||
- [Quick Start](https://resthooks.io/rest/api/schema) | ||
- [API](https://resthooks.io/rest/api/Entity) | ||
- [Introduction](https://dataclient.io/docs/concepts/normalization) | ||
- [Quick Start](https://dataclient.io/rest/api/schema) | ||
- [API](https://dataclient.io/rest/api/Entity) | ||
- [normalize](./docs/api.md#normalizedata-schema) | ||
- [denormalize](./docs/api.md#denormalizeinput-schema-entities) | ||
- [schema](https://resthooks.io/rest/api/schema) | ||
- [schema](https://dataclient.io/rest/api/schema) | ||
@@ -37,0 +37,0 @@ ## Examples |
@@ -7,10 +7,8 @@ import { denormalize } from './denormalize/denormalize.js'; | ||
export { default as inferResults, validateInference } from './inferResults.js'; | ||
export { DELETED } from './special.js'; | ||
export { AbstractInstanceType, NormalizeReturnType, NormalizedSchema, DenormalizeReturnType, DenormalizeCache, Path, } from './types.js'; | ||
export { AbstractInstanceType, NormalizeReturnType, NormalizedSchema, DenormalizeCache, Path, Denormalize, DenormalizeNullable, Normalize, NormalizeNullable, } from './types.js'; | ||
export * from './endpoint/types.js'; | ||
export * from './interface.js'; | ||
export * from './Expiry.js'; | ||
export * from './normal.js'; | ||
export { INVALID } from './denormalize/symbol.js'; | ||
export { denormalize, denormalizeCached, normalize, isEntity, WeakEntityMap }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,13 +8,6 @@ export type Schema = null | string | { | ||
toJSON(): string; | ||
}> = { | ||
prototype: T; | ||
}; | ||
}> = (value: any) => T; | ||
export interface SchemaSimple<T = any> { | ||
normalize(input: any, parent: any, key: any, visit: (...args: any) => any, addEntity: (...args: any) => any, visitedEntities: Record<string, any>, storeEntities?: any, args?: any[]): any; | ||
denormalize?(input: {}, unvisit: UnvisitFunction): [ | ||
/*denormalized*/ T, | ||
/*found*/ boolean, | ||
/*suspend*/ boolean | ||
]; | ||
denormalizeOnly?(input: {}, args: any, unvisit: (input: any, schema: any) => any): T; | ||
denormalize(input: {}, args: any, unvisit: (input: any, schema: any) => any): T; | ||
infer(args: readonly any[], indexes: NormalizedIndex, recurse: (...args: any) => any, entities: EntityTable): any; | ||
@@ -24,19 +17,11 @@ } | ||
_normalizeNullable(): any; | ||
_denormalizeNullable(): [ | ||
N, | ||
boolean, | ||
boolean | ||
]; | ||
_denormalizeNullable(): N; | ||
} | ||
export interface EntityInterface<T = any> extends SchemaSimple { | ||
createIfValid?(props: any): any; | ||
createIfValid(props: any): any; | ||
pk(params: any, parent?: any, key?: string, args?: readonly any[]): string | undefined; | ||
readonly key: string; | ||
merge(existing: any, incoming: any): any; | ||
/** @deprecated use mergeWithStore instead (which can call this) */ | ||
expiresAt?(meta: any, input: any): number; | ||
mergeWithStore?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
mergeMetaWithStore?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
/** @deprecated use mergeWithStore instead (which can call this) */ | ||
useIncoming?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): boolean; | ||
mergeWithStore(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
mergeMetaWithStore(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any; | ||
indexes?: any; | ||
@@ -47,11 +32,2 @@ schema: Record<string, Schema>; | ||
} | ||
export interface UnvisitFunction { | ||
(input: any, schema: any): [ | ||
any, | ||
boolean, | ||
boolean | ||
] | any; | ||
og?: UnvisitFunction; | ||
setLocal?: (entity: any) => void; | ||
} | ||
export interface NormalizedIndex { | ||
@@ -58,0 +34,0 @@ readonly [entityKey: string]: { |
@@ -48,13 +48,6 @@ import { Schema, Serializable, EntityInterface, NormalizedIndex } from './interface.js'; | ||
export type DenormalizeNullableNestedSchema<S extends NestedSchemaClass> = keyof S['schema'] extends never ? S['prototype'] : string extends keyof S['schema'] ? S['prototype'] : S['prototype']; | ||
export type DenormalizeReturnType<T> = T extends (input: any, unvisit: any) => [ | ||
infer R, | ||
any, | ||
any | ||
] ? R : never; | ||
export type NormalizeReturnType<T> = T extends (...args: any) => infer R ? R : never; | ||
export type Denormalize<S> = S extends EntityInterface<infer U> ? U : S extends RecordClass ? AbstractInstanceType<S> : S extends { | ||
denormalizeOnly: (...args: any) => any; | ||
} ? ReturnType<S['denormalizeOnly']> : S extends { | ||
denormalize: (...args: any) => any; | ||
} ? DenormalizeReturnType<S['denormalize']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] : S extends { | ||
} ? ReturnType<S['denormalize']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] : S extends { | ||
[K: string]: any; | ||
@@ -64,3 +57,3 @@ } ? DenormalizeObject<S> : S; | ||
_denormalizeNullable: (...args: any) => any; | ||
} ? DenormalizeReturnType<S['_denormalizeNullable']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] | undefined : S extends { | ||
} ? ReturnType<S['_denormalizeNullable']> : S extends Serializable<infer T> ? T : S extends Array<infer F> ? Denormalize<F>[] | undefined : S extends { | ||
[K: string]: any; | ||
@@ -67,0 +60,0 @@ } ? DenormalizeNullableObject<S> : S; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
411435
130
4734