@rest-hooks/endpoint
Advanced tools
Comparing version 3.5.2 to 3.6.0
@@ -233,3 +233,3 @@ 'use strict'; | ||
const list = Object.values(this.schema).flatMap(schema => { | ||
if (!Object.hasOwn(entities, schema.key) || !entities[schema.key]) return []; | ||
if (!entities[schema.key]) return []; | ||
found = true; | ||
@@ -708,3 +708,7 @@ return Object.values(entities[schema.key]).map(entity => ({ | ||
// we use hasOwn because we don't want to use a parents' defaults | ||
if (!Object.hasOwn(this, '__defaults')) this.__defaults = new this(); | ||
if (!Object.hasOwn(this, '__defaults')) Object.defineProperty(this, '__defaults', { | ||
value: new this(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
return this.__defaults; | ||
@@ -861,2 +865,5 @@ } | ||
} | ||
testKey(key) { | ||
return key.startsWith(this.name); | ||
} | ||
bind(thisArg, ...args) { | ||
@@ -863,0 +870,0 @@ const fetchFunc = this.fetch; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).restHookEndpoint={})}(this,(function(e){"use strict";function t(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function s(e,t,s){let i=!0,r=!1;return[Object.keys(e).reduce(((t,n)=>{const o=`${n}`,[c,a,h]=s(t.get(o),e[o]);return a||(i=!1),h&&(r=!0),t.has(o)?t.set(o,c):t}),t),i,r]}class i{constructor(e,t){this.schema=void 0,t&&(this._schemaAttribute="string"==typeof t?e=>e[t]:t),this.define(e)}get isSingleSchema(){return!this._schemaAttribute}define(e){this.schema=e}getSchemaAttribute(e,t,s){return!this.isSingleSchema&&this._schemaAttribute(e,t,s)}inferSchema(e,t,s){if(this.isSingleSchema)return this.schema;const i=this.getSchemaAttribute(e,t,s);return this.schema[i]}normalizeValue(e,t,s,i,r,n){const o=this.inferSchema(e,t,s);if(!o)return e;const c=i(e,t,s,o,r,n);return this.isSingleSchema||null==c?c:{id:c,schema:this.getSchemaAttribute(e,t,s)}}denormalizeValue(e,s){const i=!this.isSingleSchema&&(t(e)?e.get("schema"):e.schema);if(!this.isSingleSchema&&!i)return[e,!0,!1];return s((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[i])}}const r=([e,,t])=>void 0!==e&&!t;class n extends i{normalize(e,t,s,i,r,n){const o=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(e);return o.map(((e,o)=>this.normalizeValue(e,t,s,i,r,n))).filter((e=>null!=e))}denormalize(e,t){return[e.map?e.map((e=>this.denormalizeValue(e,t))).filter(r).map((([e])=>e)):e,!0,!1]}infer(e,t,s,i){}toJSON(){return[this.schema]}}const o=Symbol("ENTITY WAS DELETED");var c=Object.freeze({__proto__:null,Union:class extends i{constructor(e,t){if(!t)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');super(e,t)}normalize(e,t,s,i,r,n){return this.normalizeValue(e,t,s,i,r,n)}denormalize(e,t){return this.denormalizeValue(e,t)}infer(e,t,s,i){if(!e[0])return;const r=this.getSchemaAttribute(e[0],void 0,""),n=this.schema[r];return void 0!==n?{id:s(n,e,t,i),schema:r}:void 0}},Values:class extends i{normalize(e,t,s,i,r,n){return Object.keys(e).reduce(((t,s,o)=>{const c=e[s];return null!=c?Object.assign({},t,{[s]:this.normalizeValue(c,e,s,i,r,n)}):t}),{})}denormalize(e,t){let s=!0,i=!1;return[Object.keys(e).reduce(((r,n)=>{const o=e[n],[c,a,h]=this.denormalizeValue(o,t);return a||(s=!1),h&&(i=!0),!a||h?r:Object.assign({},r,{[n]:c})}),{}),s,i]}infer(e,t,s){}},Array:n,All:class extends n{constructor(e,t){super(e,t)}normalize(e,t,s,i,r,n){super.normalize(e,t,s,i,r,n)}infer(e,t,s,i){if(this.isSingleSchema){const e=i[this.schema.key];if(void 0===e)return;return Object.values(e).map((e=>e&&this.schema.pk(e)))}let r=!1;const n=Object.values(this.schema).flatMap((e=>Object.hasOwn(i,e.key)&&i[e.key]?(r=!0,Object.values(i[e.key]).map((t=>({id:t&&e.pk(t),schema:this.getSchemaAttribute(t,void 0,void 0)})))):[]));if(r)return n}},Object:class{constructor(e){this.schema=void 0,this.define(e)}define(e){this.schema=Object.keys(e).reduce(((t,s)=>{const i=e[s];return Object.assign({},t,{[s]:i})}),this.schema||{})}normalize(...e){return((e,t,s,i,r,n,o)=>{const c=Object.assign({},t);return Object.keys(e).forEach((s=>{const i=e[s],a=r(t[s],t,s,i,n,o);null==a?delete c[s]:c[s]=a})),c})(this.schema,...e)}denormalize(...e){return((e,i,r)=>{if(t(i))return s(e,i,r);const n=Object.assign({},i);let o=!0,c=!1;return Object.keys(e).forEach((t=>{const[s,i,a]=r(n[t],e[t]);void 0!==n[t]&&(n[t]=s),a&&(c=!0),i||(o=!1)})),[n,o,c]})(this.schema,...e)}infer(e,t,s,i){return function(e,t,s,i,r){const n={};return Object.keys(e).forEach((o=>{n[o]=i(e[o],t,s,r)})),n}(this.schema,e,t,s,i)}},Delete:class{constructor(e){this._entity=e}get key(){return this._entity.key}normalize(e,t,s,i,r,n){const c=this._entity.process(e,t,s),a=this._entity.pk(c,t,s);return r(this,o,a),a}infer(e,t,s){}denormalize(e,t){return t(e,this._entity)}_denormalizeNullable(){return[]}_normalizeNullable(){return[]}merge(e,t){return t}useIncoming(e,t,s,i){return e.date<=t.date}}});class a{static toJSON(){return{name:this.name,schema:this.schema,key:this.key}}static pk(e,t,s){return this.prototype.pk.call(e,t,s)}static useIncoming(e,t,s,i){return e.fetchedAt<=t.fetchedAt}static merge(e,t){return Object.assign({},e,t)}static mergeWithStore(e,t,s,i){return!e||this.useIncoming(e,t,s,i)?typeof i!=typeof s?i:this.merge(s,i):s}static fromJS(e={}){const t=new this(e);return Object.assign(t,e),t}static createIfValid(e){if(!this.validate(e))return this.fromJS(e)}static process(e,t,s){return Object.assign({},e)}static normalize(e,t,s,i,r,n){const o=this.process(e,t,s),c=this.pk(o,t,s);if(void 0===c||""===c)return;const a=this.key;if(a in n||(n[a]={}),c in n[a]||(n[a][c]=[]),n[a][c].some((t=>t===e)))return c;const h=this.validate(o);if(h){const e=new Error(h);throw e.status=400,e}return n[a][c].push(e),Object.keys(this.schema).forEach((e=>{if(Object.hasOwn(o,e)){const t=this.schema[e];o[e]=i(o[e],o,e,t,r,n)}})),r(this,o,c),c}static validate(e){}static infer(e,t,s){if(!e[0])return;if(["string","number"].includes(typeof e[0]))return`${e[0]}`;const i=this.pk(e[0],void 0,"");if(void 0!==i&&""!==i)return i;const r=function(e,t){return t?t.find((t=>Object.hasOwn(e,t))):void 0}(e[0],this.indexes);if(r&&t[this.key]){return t[this.key][r][e[0][r]]}}static expiresAt(e,t){return e.expiresAt}static denormalize(e,i){if("symbol"==typeof e)return[void 0,!0,!0];if(t(e)){if(this.validate(e.toJS()))return[void 0,!1,!0];null==i.setLocal||i.setLocal(e);const[t,r,n]=s(this.schema,e,i);return[this.fromJS(t.toObject()),!0,n]}let r;if(e instanceof this)r=e;else{if(this.validate(e))return[void 0,!1,!0];r=this.fromJS(e),null==i.setLocal||i.setLocal(r)}let n=!1;return Object.keys(this.schema).forEach((t=>{const s=this.schema[t],o=e[t],[c,,a]=i(o,s);a&&this.defaults[t]&&(n=!0),e[t]!==c&&this.set(r,t,c)})),[r,!0,n]}static get defaults(){return Object.hasOwn(this,"__defaults")||(this.__defaults=new this),this.__defaults}static set(e,t,s){e[t]=s}}a.schema={},(()=>{function e(e){Object.defineProperty(this,"key",{value:e,writable:!0,enumerable:!0})}const t="Entity"!==a.name?function(){return console.error("Rest Hooks Error: https://resthooks.io/errors/dklj"),Object.defineProperty(this,"key",{get(){return this.name},set:e}),this.key}:function(){return this.name};Object.defineProperty(a,"key",{get:t,set:e})})();let h=!1;try{Function()}catch(e){h=!0,console.error("Content Security Policy: The previous CSP log can be safely ignored - @rest-hooks/endpoint will use setPrototypeOf instead")}function u(e,t){e.type=e.sideEffect?"mutate":"read",e.options=Object.assign({},t),delete e.options.key,delete e.options.schema,delete e.options.sideEffect,delete e.options.fetch,delete e.options.getFetchKey,delete e.options.options,0===Object.keys(e.options).length&&delete e.options,void 0===e.schema&&(e.schema=null)}class l extends Function{constructor(e,t){let s,i;return h?(s=(...e)=>s.fetch(...e),Object.setPrototypeOf(s,new.target.prototype)):(super("return arguments.callee.fetch.apply(arguments.callee, arguments)"),s=this),s.getFetchKey=e=>s.key(e),e&&(s.fetch=e),t&&"name"in t||!e||!e.name||"anonymous"===e.name||(i=e.name),Object.defineProperty(s,"name",{get(){return i||this.__name},set(e){this.__name=e}}),Object.assign(s,t),u(s,t),s}key(...e){return`${this.name} ${JSON.stringify(e)}`}bind(e,...t){const s=this.fetch,i=this.key;return this.extend({fetch(){return s.apply(null!=e?e:this,t)},key(){return i.apply(this,t)}})}extend(e){class t extends this.constructor{}Object.assign(t.prototype,this);const s=new t(e.fetch,e);return u(s,Object.assign({},this.options,e)),s}}"runCompat"!==u.name&&(l.prototype.key=function(...e){return console.error("Rest Hooks Error: https://resthooks.io/errors/osid"),`${this.name} ${JSON.stringify(e)}`});const m=l;class f extends Error{}Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.AbortOptimistic=f,e.DELETED=o,e.Endpoint=l,e.Entity=a,e.ExtendableEndpoint=m,e.Index=class{constructor(e,t){this.getFetchKey=e=>this.key(e),this.schema=e,t&&(this.key=t)}key(e){return JSON.stringify(e)}},e.Query=class{constructor(e,t){this.sideEffect=void 0,this.schema=this.createQuerySchema(e),t?this.process=t:this.process||(this.process=e=>e)}key(...e){return`QUERY ${JSON.stringify(e)}`}createQuerySchema(e){const t=Object.create(e);return t.denormalize=({args:t,input:s},i)=>{if(void 0===s)return[void 0,!1,!0];const[r,n,o]=e.denormalize(s,i);return[n?this.process(r,...t):void 0,n,o]},t.infer=(t,s,i,r)=>({args:t,input:i(e,t,s,r)}),t}},e.schema=c,e.validateRequired=function(e,t){let s="";if(Object.keys(t).some((t=>!Object.hasOwn(e,t)&&(s=t,!0))))return`Missing key ${s}`},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).restHookEndpoint={})}(this,(function(e){"use strict";function t(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function s(e,t,s){let i=!0,r=!1;return[Object.keys(e).reduce(((t,n)=>{const o=`${n}`,[c,a,h]=s(t.get(o),e[o]);return a||(i=!1),h&&(r=!0),t.has(o)?t.set(o,c):t}),t),i,r]}class i{constructor(e,t){this.schema=void 0,t&&(this._schemaAttribute="string"==typeof t?e=>e[t]:t),this.define(e)}get isSingleSchema(){return!this._schemaAttribute}define(e){this.schema=e}getSchemaAttribute(e,t,s){return!this.isSingleSchema&&this._schemaAttribute(e,t,s)}inferSchema(e,t,s){if(this.isSingleSchema)return this.schema;const i=this.getSchemaAttribute(e,t,s);return this.schema[i]}normalizeValue(e,t,s,i,r,n){const o=this.inferSchema(e,t,s);if(!o)return e;const c=i(e,t,s,o,r,n);return this.isSingleSchema||null==c?c:{id:c,schema:this.getSchemaAttribute(e,t,s)}}denormalizeValue(e,s){const i=!this.isSingleSchema&&(t(e)?e.get("schema"):e.schema);if(!this.isSingleSchema&&!i)return[e,!0,!1];return s((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[i])}}const r=([e,,t])=>void 0!==e&&!t;class n extends i{normalize(e,t,s,i,r,n){const o=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(e);return o.map(((e,o)=>this.normalizeValue(e,t,s,i,r,n))).filter((e=>null!=e))}denormalize(e,t){return[e.map?e.map((e=>this.denormalizeValue(e,t))).filter(r).map((([e])=>e)):e,!0,!1]}infer(e,t,s,i){}toJSON(){return[this.schema]}}const o=Symbol("ENTITY WAS DELETED");var c=Object.freeze({__proto__:null,Union:class extends i{constructor(e,t){if(!t)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');super(e,t)}normalize(e,t,s,i,r,n){return this.normalizeValue(e,t,s,i,r,n)}denormalize(e,t){return this.denormalizeValue(e,t)}infer(e,t,s,i){if(!e[0])return;const r=this.getSchemaAttribute(e[0],void 0,""),n=this.schema[r];return void 0!==n?{id:s(n,e,t,i),schema:r}:void 0}},Values:class extends i{normalize(e,t,s,i,r,n){return Object.keys(e).reduce(((t,s,o)=>{const c=e[s];return null!=c?Object.assign({},t,{[s]:this.normalizeValue(c,e,s,i,r,n)}):t}),{})}denormalize(e,t){let s=!0,i=!1;return[Object.keys(e).reduce(((r,n)=>{const o=e[n],[c,a,h]=this.denormalizeValue(o,t);return a||(s=!1),h&&(i=!0),!a||h?r:Object.assign({},r,{[n]:c})}),{}),s,i]}infer(e,t,s){}},Array:n,All:class extends n{constructor(e,t){super(e,t)}normalize(e,t,s,i,r,n){super.normalize(e,t,s,i,r,n)}infer(e,t,s,i){if(this.isSingleSchema){const e=i[this.schema.key];if(void 0===e)return;return Object.values(e).map((e=>e&&this.schema.pk(e)))}let r=!1;const n=Object.values(this.schema).flatMap((e=>i[e.key]?(r=!0,Object.values(i[e.key]).map((t=>({id:t&&e.pk(t),schema:this.getSchemaAttribute(t,void 0,void 0)})))):[]));if(r)return n}},Object:class{constructor(e){this.schema=void 0,this.define(e)}define(e){this.schema=Object.keys(e).reduce(((t,s)=>{const i=e[s];return Object.assign({},t,{[s]:i})}),this.schema||{})}normalize(...e){return((e,t,s,i,r,n,o)=>{const c=Object.assign({},t);return Object.keys(e).forEach((s=>{const i=e[s],a=r(t[s],t,s,i,n,o);null==a?delete c[s]:c[s]=a})),c})(this.schema,...e)}denormalize(...e){return((e,i,r)=>{if(t(i))return s(e,i,r);const n=Object.assign({},i);let o=!0,c=!1;return Object.keys(e).forEach((t=>{const[s,i,a]=r(n[t],e[t]);void 0!==n[t]&&(n[t]=s),a&&(c=!0),i||(o=!1)})),[n,o,c]})(this.schema,...e)}infer(e,t,s,i){return function(e,t,s,i,r){const n={};return Object.keys(e).forEach((o=>{n[o]=i(e[o],t,s,r)})),n}(this.schema,e,t,s,i)}},Delete:class{constructor(e){this._entity=e}get key(){return this._entity.key}normalize(e,t,s,i,r,n){const c=this._entity.process(e,t,s),a=this._entity.pk(c,t,s);return r(this,o,a),a}infer(e,t,s){}denormalize(e,t){return t(e,this._entity)}_denormalizeNullable(){return[]}_normalizeNullable(){return[]}merge(e,t){return t}useIncoming(e,t,s,i){return e.date<=t.date}}});class a{static toJSON(){return{name:this.name,schema:this.schema,key:this.key}}static pk(e,t,s){return this.prototype.pk.call(e,t,s)}static useIncoming(e,t,s,i){return e.fetchedAt<=t.fetchedAt}static merge(e,t){return Object.assign({},e,t)}static mergeWithStore(e,t,s,i){return!e||this.useIncoming(e,t,s,i)?typeof i!=typeof s?i:this.merge(s,i):s}static fromJS(e={}){const t=new this(e);return Object.assign(t,e),t}static createIfValid(e){if(!this.validate(e))return this.fromJS(e)}static process(e,t,s){return Object.assign({},e)}static normalize(e,t,s,i,r,n){const o=this.process(e,t,s),c=this.pk(o,t,s);if(void 0===c||""===c)return;const a=this.key;if(a in n||(n[a]={}),c in n[a]||(n[a][c]=[]),n[a][c].some((t=>t===e)))return c;const h=this.validate(o);if(h){const e=new Error(h);throw e.status=400,e}return n[a][c].push(e),Object.keys(this.schema).forEach((e=>{if(Object.hasOwn(o,e)){const t=this.schema[e];o[e]=i(o[e],o,e,t,r,n)}})),r(this,o,c),c}static validate(e){}static infer(e,t,s){if(!e[0])return;if(["string","number"].includes(typeof e[0]))return`${e[0]}`;const i=this.pk(e[0],void 0,"");if(void 0!==i&&""!==i)return i;const r=function(e,t){return t?t.find((t=>Object.hasOwn(e,t))):void 0}(e[0],this.indexes);if(r&&t[this.key]){return t[this.key][r][e[0][r]]}}static expiresAt(e,t){return e.expiresAt}static denormalize(e,i){if("symbol"==typeof e)return[void 0,!0,!0];if(t(e)){if(this.validate(e.toJS()))return[void 0,!1,!0];null==i.setLocal||i.setLocal(e);const[t,r,n]=s(this.schema,e,i);return[this.fromJS(t.toObject()),!0,n]}let r;if(e instanceof this)r=e;else{if(this.validate(e))return[void 0,!1,!0];r=this.fromJS(e),null==i.setLocal||i.setLocal(r)}let n=!1;return Object.keys(this.schema).forEach((t=>{const s=this.schema[t],o=e[t],[c,,a]=i(o,s);a&&this.defaults[t]&&(n=!0),e[t]!==c&&this.set(r,t,c)})),[r,!0,n]}static get defaults(){return Object.hasOwn(this,"__defaults")||Object.defineProperty(this,"__defaults",{value:new this,writable:!0,configurable:!0}),this.__defaults}static set(e,t,s){e[t]=s}}a.schema={},(()=>{function e(e){Object.defineProperty(this,"key",{value:e,writable:!0,enumerable:!0})}const t="Entity"!==a.name?function(){return console.error("Rest Hooks Error: https://resthooks.io/errors/dklj"),Object.defineProperty(this,"key",{get(){return this.name},set:e}),this.key}:function(){return this.name};Object.defineProperty(a,"key",{get:t,set:e})})();let h=!1;try{Function()}catch(e){h=!0,console.error("Content Security Policy: The previous CSP log can be safely ignored - @rest-hooks/endpoint will use setPrototypeOf instead")}function u(e,t){e.type=e.sideEffect?"mutate":"read",e.options=Object.assign({},t),delete e.options.key,delete e.options.schema,delete e.options.sideEffect,delete e.options.fetch,delete e.options.getFetchKey,delete e.options.options,0===Object.keys(e.options).length&&delete e.options,void 0===e.schema&&(e.schema=null)}class l extends Function{constructor(e,t){let s,i;return h?(s=(...e)=>s.fetch(...e),Object.setPrototypeOf(s,new.target.prototype)):(super("return arguments.callee.fetch.apply(arguments.callee, arguments)"),s=this),s.getFetchKey=e=>s.key(e),e&&(s.fetch=e),t&&"name"in t||!e||!e.name||"anonymous"===e.name||(i=e.name),Object.defineProperty(s,"name",{get(){return i||this.__name},set(e){this.__name=e}}),Object.assign(s,t),u(s,t),s}key(...e){return`${this.name} ${JSON.stringify(e)}`}testKey(e){return e.startsWith(this.name)}bind(e,...t){const s=this.fetch,i=this.key;return this.extend({fetch(){return s.apply(null!=e?e:this,t)},key(){return i.apply(this,t)}})}extend(e){class t extends this.constructor{}Object.assign(t.prototype,this);const s=new t(e.fetch,e);return u(s,Object.assign({},this.options,e)),s}}"runCompat"!==u.name&&(l.prototype.key=function(...e){return console.error("Rest Hooks Error: https://resthooks.io/errors/osid"),`${this.name} ${JSON.stringify(e)}`});const m=l;class f extends Error{}Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.AbortOptimistic=f,e.DELETED=o,e.Endpoint=l,e.Entity=a,e.ExtendableEndpoint=m,e.Index=class{constructor(e,t){this.getFetchKey=e=>this.key(e),this.schema=e,t&&(this.key=t)}key(e){return JSON.stringify(e)}},e.Query=class{constructor(e,t){this.sideEffect=void 0,this.schema=this.createQuerySchema(e),t?this.process=t:this.process||(this.process=e=>e)}key(...e){return`QUERY ${JSON.stringify(e)}`}createQuerySchema(e){const t=Object.create(e);return t.denormalize=({args:t,input:s},i)=>{if(void 0===s)return[void 0,!1,!0];const[r,n,o]=e.denormalize(s,i);return[n?this.process(r,...t):void 0,n,o]},t.infer=(t,s,i,r)=>({args:t,input:i(e,t,s,r)}),t}},e.schema=c,e.validateRequired=function(e,t){let s="";if(Object.keys(t).some((t=>!Object.hasOwn(e,t)&&(s=t,!0))))return`Missing key ${s}`},Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -72,2 +72,5 @@ import { CSP } from './CSP.js'; | ||
} | ||
testKey(key) { | ||
return key.startsWith(this.name); | ||
} | ||
bind(thisArg, ...args) { | ||
@@ -109,2 +112,2 @@ const fetchFunc = this.fetch; | ||
export const ExtendableEndpoint = Endpoint; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJDU1AiLCJydW5Db21wYXQiLCJlbmRwb2ludCIsIm9wdGlvbnMiLCJ0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FBQztJQUNoQyxNQUFNMEIsUUFBUSxHQUFHLElBQUlELENBQUMsQ0FBQzdDLE9BQU8sQ0FBQ0ssS0FBSyxFQUFFTCxPQUFPLENBQUM7O0lBRTlDO0lBQ0FGLFNBQVMsQ0FBQ2dELFFBQVEsb0JBQU8sSUFBSSxDQUFDOUMsT0FBTyxFQUFLQSxPQUFPLEVBQUc7SUFFcEQsT0FBTzhDLFFBQVE7RUFDakI7O0VBRUE7QUFVRjtBQUFDO0VBUkc7RUFDQSxJQUFJaEQsU0FBUyxDQUFDeUIsSUFBSSxLQUFLLFdBQVcsRUFBRTtJQW5HbkJaLFFBQVEsQ0FvR2xCUyxTQUFTLENBQUNqQixHQUFHLEdBQUcsVUFBVSxHQUFHYSxJQUFJLEVBQUU7TUFDdENjLE9BQU8sQ0FBQ0MsS0FBSyxDQUFDLG9EQUFvRCxDQUFDO01BQ25FLE9BQVEsR0FBRSxJQUFJLENBQUNSLElBQUssSUFBR1ksSUFBSSxDQUFDQyxTQUFTLENBQUNwQixJQUFJLENBQUUsRUFBQztJQUMvQyxDQUFDO0VBQ0g7QUFBQztBQUdMLE9BQU8sTUFBTStCLGtCQUFrQixHQUFHcEMsUUFBUSJ9 |
@@ -23,3 +23,3 @@ import ArraySchema from './Array.js'; | ||
const list = Object.values(this.schema).flatMap(schema => { | ||
if (!Object.hasOwn(entities, schema.key) || !entities[schema.key]) return []; | ||
if (!entities[schema.key]) return []; | ||
found = true; | ||
@@ -36,2 +36,2 @@ return Object.values(entities[schema.key]).map(entity => ({ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJBcnJheVNjaGVtYSIsIkFsbFNjaGVtYSIsImNvbnN0cnVjdG9yIiwiZGVmaW5pdGlvbiIsInNjaGVtYUF0dHJpYnV0ZSIsIm5vcm1hbGl6ZSIsImlucHV0IiwicGFyZW50Iiwia2V5IiwidmlzaXQiLCJhZGRFbnRpdHkiLCJ2aXN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FBd0IsQ0FBQ1MsT0FBTyxDQUNuRVQsTUFBdUIsSUFBSztNQUMzQixJQUFJLENBQUNILFFBQVEsQ0FBQ0csTUFBTSxDQUFDWCxHQUFHLENBQUMsRUFBRSxPQUFPLEVBQUU7TUFDcENrQixLQUFLLEdBQUcsSUFBSTtNQUNaLE9BQU9MLE1BQU0sQ0FBQ0MsTUFBTSxDQUFDTixRQUFRLENBQUNHLE1BQU0sQ0FBQ1gsR0FBRyxDQUFDLENBQXdCLENBQUNlLEdBQUcsQ0FDbkVDLE1BQU0sS0FBSztRQUNUSyxFQUFFLEVBQUVMLE1BQU0sSUFBSUwsTUFBTSxDQUFDTSxFQUFFLENBQUNELE1BQU0sQ0FBQztRQUMvQkwsTUFBTSxFQUFFLElBQUksQ0FBQ1csa0JBQWtCLENBQUNOLE1BQU0sRUFBRUosU0FBUyxFQUFFQSxTQUFTO01BQzlELENBQUMsQ0FBQyxDQUNIO0lBQ0gsQ0FBQyxDQUNGO0lBQ0Q7SUFDQSxJQUFJLENBQUNNLEtBQUssRUFBRTtJQUNaLE9BQU9DLElBQUk7RUFDYjtBQUNGIn0= |
@@ -304,3 +304,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
// we use hasOwn because we don't want to use a parents' defaults | ||
if (!Object.hasOwn(this, '__defaults')) this.__defaults = new this(); | ||
if (!Object.hasOwn(this, '__defaults')) Object.defineProperty(this, '__defaults', { | ||
value: new this(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
return this.__defaults; | ||
@@ -361,2 +365,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc0ltbXV0YWJsZSIsImRlbm9ybWFsaXplSW1tdXRhYmxlIiwiRW50aXR5IiwidG9KU09OIiwibmFtZSIsInNjaGVtYSIsImtleSIsInBrIiwidmFsdWUiLCJwYXJlbnQiLCJwcm90b3R5cGUiLCJjYWxsIiwidXNlSW5jb21p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0cztcbiAgfVxuXG4gIC8qKiBVc2VkIGJ5IGRlbm9ybWFsaXplIHRvIHNldCBuZXN0ZWQgbWVtYmVycyAqL1xuICBwcm90ZWN0ZWQgc3RhdGljIHNldChlbnRpdHk6IGFueSwga2V5OiBzdHJpbmcsIHZhbHVlOiBhbnkpIHtcbiAgICBlbnRpdHlba2V5XSA9IHZhbHVlO1xuICB9XG5cbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgc3RhdGljIHtcbiAgICAvLyB0aGlzIGFsbG93cyBhc3NpZ25tZW50IGluIHN0cmljdC1tb2RlXG4gICAgZnVuY3Rpb24gc2V0KHRoaXM6IGFueSwgdmFsdWU6IHN0cmluZykge1xuICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdrZXknLCB7XG4gICAgICAgIHZhbHVlLFxuICAgICAgICB3cml0YWJsZTogdHJ1ZSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgIH0pO1xuICAgIH1cbiAgICBjb25zdCBnZXQgPVxuICAgICAgLyogaXN0YW5idWwgaWdub3JlIGlmICovXG4gICAgICB0aGlzLm5hbWUgIT09ICdFbnRpdHknXG4gICAgICAgID8gLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi8gZnVuY3Rpb24gKHRoaXM6IHtcbiAgICAgICAgICAgIG5hbWU6IHN0cmluZztcbiAgICAgICAgICAgIGtleTogc3RyaW5nO1xuICAgICAgICAgIH0pOiBzdHJpbmcge1xuICAgICAgICAgICAgY29uc29sZS5lcnJvcignUmVzdCBIb29rcyBFcnJvcjogaHR0cHM6Ly9yZXN0aG9va3MuaW8vZXJyb3JzL2RrbGonKTtcbiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0aGlzLCAna2V5Jywge1xuICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubmFtZTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgc2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5rZXk7XG4gICAgICAgICAgfVxuICAgICAgICA6IGZ1bmN0aW9uICh0aGlzOiB7IG5hbWU6IHN0cmluZyB9KTogc3RyaW5nIHtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgIHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicgJiZcbiAgICAgICAgICAgICAgKHRoaXMubmFtZSA9PT0gJycgfHxcbiAgICAgICAgICAgICAgICB0aGlzLm5hbWUgPT09ICdFbnRpdHknIHx8XG4gICAgICAgICAgICAgICAgdGhpcy5uYW1lID09PSAnX3RlbXAnKVxuICAgICAgICAgICAgKVxuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgJ0VudGl0eSBjbGFzc2VzIHdpdGhvdXQgYSBuYW1lIG11c3QgZGVmaW5lIGBzdGF0aWMga2V5YFxcblNlZTogaHR0cHM6Ly9yZXN0aG9va3MuaW8vcmVzdC9hcGkvRW50aXR5I2tleScsXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5uYW1lO1xuICAgICAgICAgIH07XG5cbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ2tleScsIHtcbiAgICAgIGdldCxcbiAgICAgIHNldCxcbiAgICB9KTtcbiAgfVxufVxuXG4vKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHtcbiAgY29uc3Qgc3VwZXJGcm9tID0gRW50aXR5LmZyb21KUztcbiAgLy8gZm9yIHRob3NlIG5vdCB1c2luZyBUeXBlU2NyaXB0IHRoaXMgaXMgYSBnb29kIGNhdGNoIH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zIGNvcnJlY3RcbiAgICAgICAgICBmb3VuZC5sZW5ndGggKiogMS41IC8gMiA8PSB1bmV4cGVjdGVkLmxlbmd0aDtcbiAgICAgICAgY29uc3QgZm91bmROb3RoaW5nID0gZm91bmQubGVuZ3RoIDwgTWF0aC5taW4oMSwga2V5c09mUmVjb3JkLnNpemUgLyAyKTtcbiAgICAgICAgLy8gaWYgd2UgZmluZCBub3RoaW5nICh3ZSBleHBlY3QgYXQgbGVhc3Qgb25lIG1lbWJlciBmb3IgYSBwaylcbiAgICAgICAgLy8gb3Igd2UgZmluZCB0b28gbWFueSB1bmV4cGVjdGVkIG1lbWJlcnNcbiAgICAgICAgaWYgKHRvb01hbnlVbmV4cGVjdGVkIHx8IGZvdW5kTm90aGluZykge1xuICAgICAgICAgIGxldCBleHRyYSA9ICcnO1xuICAgICAgICAgIGxldCByZWFzb24gPSAnc3Vic3RhbnRpYWxseSBkaWZmZXJlbnQgdGhhbiBleHBlY3RlZCBrZXlzJztcbiAgICAgICAgICBpZiAoZm91bmROb3RoaW5nKSB7XG4gICAgICAgICAgICBleHRyYSArPSBgXFxuICAgIE1pc3Npbmc6ICR7bWlzc2luZ31gO1xuICAgICAgICAgICAgcmVhc29uID0gJ25vIG1hdGNoaW5nIGtleXMgZm91bmQnO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodG9vTWFueVVuZXhwZWN0ZWQpIHtcbiAgICAgICAgICAgIGV4dHJhICs9IGBcXG4gICAgVW5leHBlY3RlZCBrZXlzOiAke3VuZXhwZWN0ZWR9YDtcbiAgICAgICAgICAgIHJlYXNvbiA9ICdhIGxhcmdlIG51bWJlciBvZiB1bmV4cGVjdGVkIGtleXMgZm91bmQnO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCBlcnJvck1lc3NhZ2UgPSBgQXR0ZW1wdGVkIHRvIGluaXRpYWxpemUgJHtcbiAgICAgICAgICAgIHRoaXMubmFtZVxuICAgICAgICAgIH0gd2l0aCAke3JlYXNvbn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trZXldID0gdmFsdWU7XG4gIH1cblxuICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICBzdGF0aWMge1xuICAgIC8vIHRoaXMgYWxsb3dzIGFzc2lnbm1lbnQgaW4gc3RyaWN0LW1vZGVcbiAgICBmdW5jdGlvbiBzZXQodGhpczogYW55LCB2YWx1ZTogc3RyaW5nKSB7XG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ2tleScsIHtcbiAgICAgICAgdmFsdWUsXG4gICAgICAgIHdyaXRhYmxlOiB0cnVlLFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgfSk7XG4gICAgfVxuICAgIGNvbnN0IGdldCA9XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgaWYgKi9cbiAgICAgIHRoaXMubmFtZSAhPT0gJ0VudGl0eSdcbiAgICAgICAgPyAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqLyBmdW5jdGlvbiAodGhpczoge1xuICAgICAgICAgICAgbmFtZTogc3RyaW5nO1xuICAgICAgICAgICAga2V5OiBzdHJpbmc7XG4gICAgICAgICAgfSk6IHN0cmluZyB7XG4gICAgICAgICAgICBjb25zb2xlLmVycm9yKCdSZXN0IEhvb2tzIEVycm9yOiBodHRwczovL3Jlc3Rob29rcy5pby9lcnJvcnMvZGtsaicpO1xuICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdrZXknLCB7XG4gICAgICAgICAgICAgIGdldCgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5uYW1lO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBzZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmtleTtcbiAgICAgICAgICB9XG4gICAgICAgIDogZnVuY3Rpb24gKHRoaXM6IHsgbmFtZTogc3RyaW5nIH0pOiBzdHJpbmcge1xuICAgICAgICAgICAg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xJQUFJLENBQVNYLFNBQVMsQ0FBQ0gsRUFBRSxLQUFLb0IsU0FBUyxFQUMxQyxNQUFNLElBQUlhLEtBQUssQ0FBQyxvQ0FBb0MsQ0FBQztJQUN2RCxPQUFPOEQsU0FBUyxDQUFDM0YsSUFBSSxDQUFDLElBQUksRUFBRVUsS0FBSyxDQUFDO0VBQ3BDLENBQUM7QUFDSDtBQUVBLFNBQVM2RCxlQUFlLENBQ3RCcUIsTUFBd0IsRUFDeEJ4QixPQUF1QixFQUN2QjtFQUNBLElBQUksQ0FBQ0EsT0FBTyxFQUFFLE9BQU9wRCxTQUFTO0VBQzlCLE9BQU9vRCxPQUFPLENBQUN5QixJQUFJLENBQUNDLEtBQUssSUFBSWxGLE1BQU0sQ0FBQ2lDLE1BQU0sQ0FBQytDLE1BQU0sRUFBRUUsS0FBSyxDQUFDLENBQUM7QUFDNUQifQ== |
@@ -149,2 +149,6 @@ /* eslint-disable @typescript-eslint/ban-types */ | ||
/* utilities */ | ||
/** @see https://resthooks.io/rest/api/Endpoint#testKey */ | ||
testKey(key: string): boolean; | ||
/** The following is for compatibility with FetchShape */ | ||
@@ -151,0 +155,0 @@ /** @deprecated */ |
@@ -74,2 +74,5 @@ import { CSP } from './CSP.js'; | ||
} | ||
testKey(key) { | ||
return key.startsWith(this.name); | ||
} | ||
bind(thisArg, ...args) { | ||
@@ -114,2 +117,2 @@ const fetchFunc = this.fetch; | ||
export const ExtendableEndpoint = Endpoint; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJDU1AiLCJydW5Db21wYXQiLCJlbmRwb2ludCIsIm9wdGlvbnMiLCJ0eXBlIiwic2lkZUVmZmVjdCIsImtleSIsInNjaGVtYSIsImZldGNoIiwiZ2V0RmV0Y2hLZXkiLCJPYmplY3QiLCJrZXlzIiwibGVuZ3RoIiwidW5kZWZpbmVkIiwiRW5kcG9pbnQiLCJGdW5jdGlvbiIsImNvbnN0cnVj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DO0lBQ0FGLFNBQVMsQ0FBQ2dELFFBQVEsRUFBRTtNQUFFLEdBQUcsSUFBSSxDQUFDOUMsT0FBTztNQUFFLEdBQUdBO0lBQVEsQ0FBQyxDQUFDO0lBRXBELE9BQU84QyxRQUFRO0VBQ2pCOztFQUVBO0FBVUY7QUFBQztFQVJHO0VBQ0EsSUFBSWhELFNBQVMsQ0FBQ3lCLElBQUksS0FBSyxXQUFXLEVBQUU7SUFuR25CWixRQUFRLENBb0dsQlMsU0FBUyxDQUFDakIsR0FBRyxHQUFHLFVBQVUsR0FBR2EsSUFBSSxFQUFFO01BQ3RDYyxPQUFPLENBQUNDLEtBQUssQ0FBQyxvREFBb0QsQ0FBQztNQUNuRSxPQUFRLEdBQUUsSUFBSSxDQUFDUixJQUFLLElBQUdZLElBQUksQ0FBQ0MsU0FBUyxDQUFDcEIsSUFBSSxDQUFFLEVBQUM7SUFDL0MsQ0FBQztFQUNIO0FBQUM7QUFHTCxPQUFPLE1BQU0rQixrQkFBa0IsR0FBR3BDLFFBQVEifQ== |
@@ -23,3 +23,3 @@ import ArraySchema from './Array.js'; | ||
const list = Object.values(this.schema).flatMap(schema => { | ||
if (!Object.hasOwn(entities, schema.key) || !entities[schema.key]) return []; | ||
if (!entities[schema.key]) return []; | ||
found = true; | ||
@@ -36,2 +36,2 @@ return Object.values(entities[schema.key]).map(entity => ({ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJBcnJheVNjaGVtYSIsIkFsbFNjaGVtYSIsImNvbnN0cnVjdG9yIiwiZGVmaW5pdGlvbiIsInNjaGVtYUF0dHJpYnV0ZSIsIm5vcm1hbGl6ZSIsImlucHV0IiwicGFyZW50Iiwia2V5IiwidmlzaXQiLCJhZGRFbnRpdHkiLCJ2aXNpdGVkRW50aXRpZXMiLCJpbmZlciIsImFyZ3MiLCJpbmRleGVzIiwicmVjdXJzZSIsImVudGl0aWVzIiwiaXNTaW5n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FBTSxDQUFDWCxHQUFHLENBQUMsRUFBRSxPQUFPLEVBQUU7TUFDcENrQixLQUFLLEdBQUcsSUFBSTtNQUNaLE9BQU9MLE1BQU0sQ0FBQ0MsTUFBTSxDQUFDTixRQUFRLENBQUNHLE1BQU0sQ0FBQ1gsR0FBRyxDQUFDLENBQXdCLENBQUNlLEdBQUcsQ0FDbkVDLE1BQU0sS0FBSztRQUNUSyxFQUFFLEVBQUVMLE1BQU0sSUFBSUwsTUFBTSxDQUFDTSxFQUFFLENBQUNELE1BQU0sQ0FBQztRQUMvQkwsTUFBTSxFQUFFLElBQUksQ0FBQ1csa0JBQWtCLENBQUNOLE1BQU0sRUFBRUosU0FBUyxFQUFFQSxTQUFTO01BQzlELENBQUMsQ0FBQyxDQUNIO0lBQ0gsQ0FBQyxDQUNGO0lBQ0Q7SUFDQSxJQUFJLENBQUNNLEtBQUssRUFBRTtJQUNaLE9BQU9DLElBQUk7RUFDYjtBQUNGIn0= |
@@ -309,3 +309,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
// we use hasOwn because we don't want to use a parents' defaults | ||
if (!Object.hasOwn(this, '__defaults')) this.__defaults = new this(); | ||
if (!Object.hasOwn(this, '__defaults')) Object.defineProperty(this, '__defaults', { | ||
value: new this(), | ||
writable: true, | ||
configurable: true | ||
}); | ||
return this.__defaults; | ||
@@ -366,2 +370,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc0ltbXV0YWJsZSIsImRlbm9ybWFsaXplSW1tdXRhYmxlIiwiRW50aXR5IiwidG9KU09OIiwibmFtZSIsInNjaGVtYSIsImtleSIsInBrIiwidmFsdWUiLCJwYXJlbnQiLCJwcm90b3R5cGUiLCJjYWxsIiwidXNlSW5jb21pbmciLCJleGlzdGluZ01ldGEiLCJpbmNvbWluZ01ldGEiLCJleGlzdGluZyIsImluY29taW5nIiwiZmV0Y2hlZEF0Iiwib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ICBwcm90ZWN0ZWQgc3RhdGljIHNldChlbnRpdHk6IGFueSwga2V5OiBzdHJpbmcsIHZhbHVlOiBhbnkpIHtcbiAgICBlbnRpdHlba2V5XSA9IHZhbHVlO1xuICB9XG5cbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgc3RhdGljIHtcbiAgICAvLyB0aGlzIGFsbG93cyBhc3NpZ25tZW50IGluIHN0cmljdC1tb2RlXG4gICAgZnVuY3Rpb24gc2V0KHRoaXM6IGFueSwgdmFsdWU6IHN0cmluZykge1xuICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdrZXknLCB7XG4gICAgICAgIHZhbHVlLFxuICAgICAgICB3cml0YWJsZTogdHJ1ZSxcbiAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgIH0pO1xuICAgIH1cbiAgICBjb25zdCBnZXQgPVxuICAgICAgLyogaXN0YW5idWwgaWdub3JlIGlmICovXG4gICAgICB0aGlzLm5hbWUgIT09ICdFbnRpdHknXG4gICAgICAgID8gLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi8gZnVuY3Rpb24gKHRoaXM6IHtcbiAgICAgICAgICAgIG5hbWU6IHN0cmluZztcbiAgICAgICAgICAgIGtleTogc3RyaW5nO1xuICAgICAgICAgIH0pOiBzdHJpbmcge1xuICAgICAgICAgICAgY29uc29sZS5lcnJvcignUmVzdCBIb29rcyBFcnJvcjogaHR0cHM6Ly9yZXN0aG9va3MuaW8vZXJyb3JzL2RrbGonKTtcbiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0aGlzLCAna2V5Jywge1xuICAgICAgICAgICAgICBnZXQoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubmFtZTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgc2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5rZXk7XG4gICAgICAgICA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IC8gMiA8PSB1bmV4cGVjdGVkLmxlbmd0aDtcbiAgICAgICAgY29uc3QgZm91bmROb3RoaW5nID0gZm91bmQubGVuZ3RoIDwgTWF0aC5taW4oMSwga2V5c09mUmVjb3JkLnNpemUgLyAyKTtcbiAgICAgICAgLy8gaWYgd2UgZmluZCBub3RoaW5nICh3ZSBleHBlY3QgYXQgbGVhc3Qgb25lIG1lbWJlciBmb3IgYSBwaylcbiAgICAgICAgLy8gb3Igd2UgZmluZCB0b28gbWFueSB1bmV4cGVjdGVkIG1lbWJlcnNcbiAgICAgICAgaWYgKHRvb01hbnlVbmV4cGVjdGVkIHx8IGZvdW5kTm90aGluZykge1xuICAgICAgICAgIGxldCBleHRyYSA9ICcnO1xuICAgICAgICAgIGxldCByZWFzb24gPSAnc3Vic3RhbnRpYWxseSBkaWZmZXJlbnQgdGhhbiBleHBlY3RlZCBrZXlzJztcbiAgICAgICAgICBpZiAoZm91bmROb3RoaW5nKSB7XG4gICAgICAgICAgICBleHRyYSArPSBgXFxuICAgIE1pc3Npbmc6ICR7bWlzc2luZ31gO1xuICAgICAgICAgICAgcmVhc29uID0gJ25vIG1hdGNoaW5nIGtleXMgZm91bmQnO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodG9vTWFueVVuZXhwZWN0ZWQpIHtcbiAgICAgICAgICAgIGV4dHJhICs9IGBcXG4gICAgVW5leHBlY3RlZCBrZXlzOiAke3VuZXhwZWN0ZWR9YDtcbiAgICAgICAgICAgIHJlYXNvbiA9ICdhIGxhcmdlIG51bWJlciBvZiB1bmV4cGVjdGVkIGtleXMgZm91bmQnO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCBlcnJvck1lc3NhZ2UgPSBgQXR0ZW1wdGVkIHRvIGluaXRpYWxpemUgJHtcbiAgICAgICAgICAgIHRoaXMubmFtZVxuICAgICAgICAgIH0gd2l0aCAke3JlYXNvbn1cblxuICBUaGlzIGlzIGxpa2VseSBkdWUgdG8gYSBtYWxmb3Jt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Z25vcmUgbmV4dCAqL1xuICBzdGF0aWMge1xuICAgIC8vIHRoaXMgYWxsb3dzIGFzc2lnbm1lbnQgaW4gc3RyaWN0LW1vZGVcbiAgICBmdW5jdGlvbiBzZXQodGhpczogYW55LCB2YWx1ZTogc3RyaW5nKSB7XG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ2tleScsIHtcbiAgICAgICAgdmFsdWUsXG4gICAgICAgIHdyaXRhYmxlOiB0cnVlLFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgfSk7XG4gICAgfVxuICAgIGNvbnN0IGdldCA9XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgaWYgKi9cbiAgICAgIHRoaXMubmFtZSAhPT0gJ0VudGl0eSdcbiAgICAgICAgPyAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqLyBmdW5jdGlvbiAodGhpczoge1xuICAgICAgICAgICAgbmFtZTogc3RyaW5nO1xuICAgICAgICAgICAga2V5OiBzdHJpbmc7XG4gICAgICAgICAgfSk6IHN0cmluZyB7XG4gICAgICAgICAgICBjb25zb2xlLmVycm9yKCdSZXN0IEhvb2tzIEVycm9yOiBodHRwczovL3Jlc3Rob29rcy5pby9lcnJvcnMvZGtsaicpO1xuICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdrZXknLCB7XG4gICAgICAgICAgICAgIGdldCgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5uYW1lO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBzZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmtleTtcbiAgICAgICAgICB9XG4gICAgICAgIDogZnVuY3Rpb24gKHRoaXM6IHsgbmFtZTogc3RyaW5nIH0pOiBzdHJpbmcge1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIG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FNBQVMsQ0FBQ0gsRUFBRSxLQUFLb0IsU0FBUyxFQUMxQyxNQUFNLElBQUlhLEtBQUssQ0FBQyxvQ0FBb0MsQ0FBQztJQUN2RCxPQUFPOEQsU0FBUyxDQUFDM0YsSUFBSSxDQUFDLElBQUksRUFBRVUsS0FBSyxDQUFDO0VBQ3BDLENBQUM7QUFDSDtBQUVBLFNBQVM2RCxlQUFlLENBQ3RCcUIsTUFBd0IsRUFDeEJ4QixPQUF1QixFQUN2QjtFQUNBLElBQUksQ0FBQ0EsT0FBTyxFQUFFLE9BQU9wRCxTQUFTO0VBQzlCLE9BQU9vRCxPQUFPLENBQUN5QixJQUFJLENBQUNDLEtBQUssSUFBSWxGLE1BQU0sQ0FBQ2lDLE1BQU0sQ0FBQytDLE1BQU0sRUFBRUUsS0FBSyxDQUFDLENBQUM7QUFDNUQifQ== |
{ | ||
"name": "@rest-hooks/endpoint", | ||
"version": "3.5.2", | ||
"version": "3.6.0", | ||
"description": "Declarative Network Interface Definitions", | ||
@@ -119,3 +119,4 @@ "sideEffects": false, | ||
"typescript": "4.9.5" | ||
} | ||
}, | ||
"gitHead": "8b0eda4d5e129ba0a02d704a65cdfeb402bafc4f" | ||
} |
@@ -588,2 +588,11 @@ import nock from 'nock'; | ||
}); | ||
it('testKey should match keys', () => { | ||
const getUsers = new Endpoint(fetchUsers); | ||
const nomatch = getUsers.extend({ name: 'not matching' }); | ||
expect(getUsers.testKey(getUsers.key({ id: '5' }))).toBeTruthy(); | ||
expect(getUsers.testKey(getUsers.key({ id: '100' }))).toBeTruthy(); | ||
expect(getUsers.testKey(getUsers.key({ id: 'xxx?*' }))).toBeTruthy(); | ||
expect(getUsers.testKey(nomatch.key({ id: '5' }))).toBeFalsy(); | ||
}); | ||
}); | ||
@@ -590,0 +599,0 @@ |
@@ -149,2 +149,6 @@ /* eslint-disable @typescript-eslint/ban-types */ | ||
/* utilities */ | ||
/** @see https://resthooks.io/rest/api/Endpoint#testKey */ | ||
testKey(key: string): boolean; | ||
/** The following is for compatibility with FetchShape */ | ||
@@ -151,0 +155,0 @@ /** @deprecated */ |
@@ -87,2 +87,6 @@ import { CSP } from './CSP.js'; | ||
testKey(key) { | ||
return key.startsWith(this.name); | ||
} | ||
bind(thisArg, ...args) { | ||
@@ -89,0 +93,0 @@ const fetchFunc = this.fetch; |
// eslint-env jest | ||
import { inferResults, normalize } from '@rest-hooks/normalizr'; | ||
import { inferResults, normalize, WeakEntityMap } from '@rest-hooks/normalizr'; | ||
import { IDEntity } from '__tests__/new'; | ||
@@ -8,2 +8,3 @@ import { fromJS } from 'immutable'; | ||
import { schema, AbstractInstanceType } from '../..'; | ||
import { EntityTable } from '../../interface'; | ||
import { DELETED } from '../../special'; | ||
@@ -149,3 +150,3 @@ | ||
test('denormalizes nested in object with primitive', () => { | ||
test.only('denormalizes nested in object with primitive', () => { | ||
class Cat extends IDEntity {} | ||
@@ -185,2 +186,3 @@ const catSchema = { results: new schema.All(Cat), nextPage: '' }; | ||
let [value, found] = denormalize(input, catSchema, createInput(entities)); | ||
expect(createOutput(value.results).length).toBe(2); | ||
expect(createOutput(value.results)).toMatchSnapshot(); | ||
@@ -197,2 +199,65 @@ expect(found).toBe(true); | ||
test('denormalize maintains referential equality until entities are added', () => { | ||
class Cat extends IDEntity {} | ||
(Cat as any).defaults; | ||
const catSchema = { results: new schema.All(Cat), nextPage: '' }; | ||
let entities: EntityTable = { | ||
Cat: { | ||
1: { id: '1', name: 'Milo' }, | ||
2: { id: '2', name: 'Jake' }, | ||
}, | ||
}; | ||
const input = createInput(inferResults(catSchema, [], {}, entities)); | ||
const entityCache = {}; | ||
const resultCache = new WeakEntityMap(); | ||
const [value, found] = denormalize( | ||
input, | ||
catSchema, | ||
entities, | ||
entityCache, | ||
resultCache, | ||
); | ||
expect(createOutput(value).results?.length).toBe(2); | ||
expect(createOutput(value).results).toMatchSnapshot(); | ||
expect(found).toBe(true); | ||
const [value2, found2] = denormalize( | ||
input, | ||
catSchema, | ||
entities, | ||
entityCache, | ||
resultCache, | ||
); | ||
expect(createOutput(value).results[0]).toBe( | ||
createOutput(value2).results[0], | ||
); | ||
expect(value).toBe(value2); | ||
expect(found).toBe(found2); | ||
entities = { | ||
...entities, | ||
Cat: { | ||
...entities.Cat, | ||
3: { id: '3', name: 'Jelico' }, | ||
}, | ||
}; | ||
const input3 = createInput(inferResults(catSchema, [], {}, entities)); | ||
const [value3, found3] = denormalize( | ||
input3, | ||
catSchema, | ||
entities, | ||
entityCache, | ||
resultCache, | ||
); | ||
expect(createOutput(value3).results?.length).toBe(3); | ||
expect(createOutput(value3).results).toMatchSnapshot(); | ||
expect(createOutput(value).results[0]).toBe( | ||
createOutput(value3).results[0], | ||
); | ||
expect(createOutput(value).results[2]).not.toBe( | ||
createOutput(value3).results[2], | ||
); | ||
expect(value).not.toBe(value3); | ||
}); | ||
test('denormalizes should not be found when no entities are present', () => { | ||
@@ -199,0 +264,0 @@ class Cat extends IDEntity {} |
@@ -5,3 +5,3 @@ import { | ||
DenormalizeCache, | ||
WeakListMap, | ||
WeakEntityMap, | ||
Denormalize, | ||
@@ -16,3 +16,3 @@ DenormalizeNullable, | ||
entityCache: DenormalizeCache['entities'] = {}, | ||
resultCache: WeakListMap<object, any> = new WeakListMap(), | ||
resultCache: DenormalizeCache['results'][string] = new WeakEntityMap(), | ||
): | ||
@@ -19,0 +19,0 @@ | [denormalized: Denormalize<S>, found: true, deleted: false] |
// eslint-env jest | ||
import { normalize } from '@rest-hooks/normalizr'; | ||
import { normalize, WeakEntityMap } from '@rest-hooks/normalizr'; | ||
import { DELETED } from '@rest-hooks/normalizr'; | ||
import { WeakListMap } from '@rest-hooks/normalizr'; | ||
import { IDEntity } from '__tests__/new'; | ||
@@ -750,3 +749,3 @@ import { fromJS, Record } from 'immutable'; | ||
const entityCache = {}; | ||
const resultCache = new WeakListMap(); | ||
const resultCache = new WeakEntityMap(); | ||
@@ -1004,3 +1003,3 @@ const [first] = denormalize('1', Menu, entities, entityCache, resultCache); | ||
const entityCache: any = {}; | ||
const resultCache = new WeakListMap(); | ||
const resultCache = new WeakEntityMap(); | ||
@@ -1069,3 +1068,3 @@ const [denormalizedReport] = denormalize( | ||
const entityCache: any = {}; | ||
const resultCache = new WeakListMap(); | ||
const resultCache = new WeakEntityMap(); | ||
@@ -1072,0 +1071,0 @@ const input = { report: '123', comment: '999' }; |
/** | ||
* Snapshot of denormalize from @rest-hooks/normalizr@9.4.1 | ||
*/ | ||
import { WeakListMap, isEntity, DenormalizeCache } from '@rest-hooks/normalizr'; | ||
import { isEntity } from '@rest-hooks/normalizr'; | ||
import WeakListMap from './WeakListMap.js'; | ||
import type { | ||
@@ -14,2 +15,13 @@ Schema, | ||
interface DenormalizeCache { | ||
entities: { | ||
[key: string]: { | ||
[pk: string]: WeakListMap<object, EntityInterface>; | ||
}; | ||
}; | ||
results: { | ||
[key: string]: WeakListMap<object, any>; | ||
}; | ||
} | ||
const DRAFT = Symbol('draft'); | ||
@@ -16,0 +28,0 @@ |
@@ -8,3 +8,3 @@ /** | ||
import { DELETED } from '@rest-hooks/normalizr'; | ||
import { WeakListMap, AbstractInstanceType } from '@rest-hooks/normalizr'; | ||
import { AbstractInstanceType } from '@rest-hooks/normalizr'; | ||
import { IDEntity } from '__tests__/new'; | ||
@@ -14,2 +14,3 @@ import { fromJS, Record } from 'immutable'; | ||
import { denormalizeSimple as denormalize } from './denormalize'; | ||
import WeakListMap from './WeakListMap'; | ||
import { schema } from '../../..'; | ||
@@ -16,0 +17,0 @@ import Entity from '../../Entity'; |
@@ -45,4 +45,3 @@ import ArraySchema from './Array.js'; | ||
(schema: EntityInterface) => { | ||
if (!Object.hasOwn(entities, schema.key) || !entities[schema.key]) | ||
return []; | ||
if (!entities[schema.key]) return []; | ||
found = true; | ||
@@ -49,0 +48,0 @@ return Object.values(entities[schema.key] as Record<string, any>).map( |
@@ -433,3 +433,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
if (!Object.hasOwn(this, '__defaults')) | ||
this.__defaults = new (this as any)(); | ||
Object.defineProperty(this, '__defaults', { | ||
value: new (this as any)(), | ||
writable: true, | ||
configurable: true, | ||
}); | ||
return this.__defaults; | ||
@@ -436,0 +440,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
813802
182
12430