@donotdev/testing 0.1.44 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"debugC4all.d.ts","sourceRoot":"","sources":["../../src/client/debugC4all.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,wBAAsB,UAAU,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAoC9D"}
1
+ {"version":3,"file":"debugC4all.d.ts","sourceRoot":"","sources":["../../src/client/debugC4all.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,wBAAsB,UAAU,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAoC9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"debugIsousou.d.ts","sourceRoot":"","sources":["../../src/client/debugIsousou.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAUzE,MAAM,WAAW,mBAAmB;IAClC,qGAAqG;IACrG,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,wDAAwD;IACxD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD;;;GAGG;AACH,wBAAsB,YAAY,CAChC,eAAe,EAAE,GAAG,EACpB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CA0Hf"}
1
+ {"version":3,"file":"debugIsousou.d.ts","sourceRoot":"","sources":["../../src/client/debugIsousou.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMzE,MAAM,WAAW,mBAAmB;IAClC,qGAAqG;IACrG,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,wDAAwD;IACxD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD;;;GAGG;AACH,wBAAsB,YAAY,CAEhC,eAAe,EAAE,GAAG,EACpB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CA0Hf"}
@@ -1 +1 @@
1
- import{getProvider as p}from"@donotdev/core";import{testStorage as d}from"./testStorage";import{testEntity as h}from"./testEntity";import{testImagePipeline as S}from"./testImagePipeline";import{testImageUpload as f}from"./testImageUpload";async function b(a,c={}){const{pipeline:i,crudFns:l,pictures:t,files:r,skipStorage:g=!1,skipPipeline:u=!1,skipCrud:m=!1}=c,o=p("storage"),w=p("crud"),P=p("callable"),n={reference:`TEST-${Date.now().toString(36).toUpperCase()}`,address:{formatted_address:"1 rue de Rivoli, 75001 Paris, France",latitude:48.8606,longitude:2.3376},district_code:1};if(!g){const e=await d({storage:o}),s=await d({storage:o,storagePath:"test"});if(!(!e.passed&&s.passed)&&!(e.passed&&!s.passed)&&!e.passed&&!s.passed)return}if(!u){const e={...n};if(t&&t.length>0&&(e.pictures=t),await S({entity:a,input:e,fns:l}),i&&(await f({fns:i}),r&&r.length>0))for(const s of r)await f({fns:i,file:s})}!m&&a&&await h(a,{providers:{crud:w,storage:o,callable:P},payload:{...n,...t&&t.length>0?{pictures:t}:{}}})}export{b as debugIsousou};
1
+ import{getProvider as p}from"@donotdev/core";import{testEntity as h}from"./testEntity";import{testImagePipeline as S}from"./testImagePipeline";import{testImageUpload as d}from"./testImageUpload";import{testStorage as f}from"./testStorage";async function b(a,c={}){const{pipeline:i,crudFns:l,pictures:t,files:r,skipStorage:g=!1,skipPipeline:u=!1,skipCrud:m=!1}=c,o=p("storage"),w=p("crud"),P=p("callable"),n={reference:`TEST-${Date.now().toString(36).toUpperCase()}`,address:{formatted_address:"1 rue de Rivoli, 75001 Paris, France",latitude:48.8606,longitude:2.3376},district_code:1};if(!g){const e=await f({storage:o}),s=await f({storage:o,storagePath:"test"});if(!(!e.passed&&s.passed)&&!(e.passed&&!s.passed)&&!e.passed&&!s.passed)return}if(!u){const e={...n};if(t&&t.length>0&&(e.pictures=t),await S({entity:a,input:e,fns:l}),i&&(await d({fns:i}),r&&r.length>0))for(const s of r)await d({fns:i,file:s})}!m&&a&&await h(a,{providers:{crud:w,storage:o,callable:P},payload:{...n,...t&&t.length>0?{pictures:t}:{}}})}export{b as debugIsousou};
@@ -1 +1 @@
1
- {"version":3,"file":"testEntity.d.ts","sourceRoot":"","sources":["../../src/client/testEntity.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAY,KAAK,MAAM,EAAoB,MAAM,gBAAgB,CAAC;AAEzE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAmHzB;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CA8K3B"}
1
+ {"version":3,"file":"testEntity.d.ts","sourceRoot":"","sources":["../../src/client/testEntity.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAY,KAAK,MAAM,EAAoB,MAAM,gBAAgB,CAAC;AASzE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAiHzB;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAgL3B"}
@@ -1 +1 @@
1
- import{EDITABLE as v}from"@donotdev/core";import{generatePayload as D,getFileFields as P,isMultiFileField as $}from"../common/payloadGenerator";import{reportEntity as C}from"../common/reporter";import{createTestImageBlob as F,createTestFileBlob as M}from"./testStorage";async function y(a,w){const r=performance.now();try{const o=await w();return{step:a,passed:!0,duration:Math.round(performance.now()-r),data:o}}catch(o){return{step:a,passed:!1,duration:Math.round(performance.now()-r),error:o instanceof Error?o.message:String(o),errorDetail:o}}}async function _(a,w,r,o){const g=[],n={};for(const l of a){const p=["image","images","avatar"].includes(l.type),u=$(l),d=l.options?.fieldSpecific?.storagePath??r,h=p?"upload-image":"upload-file",s=await y(h,async()=>{const t=p?F():M(),E=p?"png":"txt",f=`dndev_test_${l.name}_${Date.now()}.${E}`,m=await w.upload(t,{storagePath:d,filename:f,signal:o,onProgress:e=>{}});if(p){const e={fullUrl:m.url,thumbUrl:m.url};n[l.name]=u?[e]:e}else{const e={url:m.url,filename:f,size:t.size,mimeType:t.type};n[l.name]=u?[e]:e}return m});g.push({...s,step:`${h}`}),s.passed||(n[l.name]=u?[]:null)}return{results:g,values:n}}async function k(a,w){const{providers:r,payload:o,cleanup:g=!0,skip:n=[],storagePath:l,signal:p}=w,{crud:u}=r,d=a.collection,h=performance.now(),s=[];let t;const E=await y("generate-payload",async()=>D(a.fields,o));if(s.push(E),!E.passed)return T(a,d,s,t,void 0,h);let f=E.data;const m=P(a.fields);if(m.length>0&&r.storage){const{results:e,values:i}=await _(m,r.storage,l,p);s.push(...e),f={...f,...i}}else m.length>0&&r.storage;if(!n.includes("create")){const e=await y("create",async()=>{const i=await u.add(d,f);return t=i.id,i});if(s.push(e),!e.passed)return T(a,d,s,t,f,h)}if(!n.includes("get")&&t){const e=await y("get",async()=>{const i=await u.get(d,t);if(!i)throw new Error(`get returned null for id=${t}`);return i});s.push(e)}if(!n.includes("list")){const e=await y("list",async()=>{const i=await u.query(d,{limit:5});if(t){const b=i.items.some(c=>c.id===t)}return i});s.push(e)}if(!n.includes("listCard")){const e=await y("listCard",async()=>await u.query(d,{limit:5},void 0,"listCard"));s.push(e)}if(!n.includes("update")&&t){const e=await y("update",async()=>{const i=Object.values(a.fields).find(c=>c.type==="text"&&c.editable!==!1&&c.editable!==v.GENERATED&&c.editable!==v.COMPUTED&&c.editable!==v.CREATE_ONLY&&c.visibility!=="hidden"&&c.visibility!=="technical"),b=i?{[i.name]:`updated_${Date.now().toString(36)}`}:{};return Object.keys(b).length===0?{skipped:!0}:(await u.update(d,t,b),b)});s.push(e)}if(!n.includes("delete")&&t&&g){const e=await y("delete",async()=>{await u.delete(d,t)});s.push(e)}return T(a,d,s,t,f,h)}function T(a,w,r,o,g,n){const l={entity:a.name,collection:w,passed:r.every(p=>p.passed),steps:r,createdId:o,payload:g,duration:Math.round(performance.now()-n)};return C(l),l}export{k as testEntity};
1
+ import{EDITABLE as E}from"@donotdev/core";import{createTestImageBlob as T,createTestFileBlob as D}from"./testStorage";import{generatePayload as $,getFileFields as C,isMultiFileField as F}from"../common/payloadGenerator";import{reportEntity as M}from"../common/reporter";async function f(s,m){const o=performance.now();try{const l=await m();return{step:s,passed:!0,duration:Math.round(performance.now()-o),data:l}}catch(l){return{step:s,passed:!1,duration:Math.round(performance.now()-o),error:l instanceof Error?l.message:String(l),errorDetail:l}}}async function _(s,m,o,l){const w=[],r={};for(const d of s){const p=["image","images","avatar"].includes(d.type),u=F(d),n=d.options?.fieldSpecific,v=(n&&"storagePath"in n&&typeof n.storagePath=="string"?n.storagePath:void 0)??o,i=p?"upload-image":"upload-file",a=await f(i,async()=>{const g=p?T():D(),y=p?"png":"txt",h=`dndev_test_${d.name}_${Date.now()}.${y}`,t=await m.upload(g,{storagePath:v,filename:h,signal:l,onProgress:e=>{}});if(p){const e={fullUrl:t.url,thumbUrl:t.url};r[d.name]=u?[e]:e}else{const e={url:t.url,filename:h,size:g.size,mimeType:g.type};r[d.name]=u?[e]:e}return t});w.push({...a,step:`${i}`}),a.passed||(r[d.name]=u?[]:null)}return{results:w,values:r}}async function O(s,m){const{providers:o,payload:l,cleanup:w=!0,skip:r=[],storagePath:d,signal:p}=m,{crud:u}=o,n=s.collection,v=performance.now(),i=[];let a;const g=await f("generate-payload",async()=>$(s.fields,l));if(i.push(g),!g.passed)return P(s,n,i,a,void 0,v);let y=g.data;const h=C(s.fields);if(h.length>0&&o.storage){const{results:t,values:e}=await _(h,o.storage,d,p);i.push(...t),y={...y,...e}}else h.length>0&&o.storage;if(!r.includes("create")){const t=await f("create",async()=>{const e=await u.add(n,y);return a=e.id,e});if(i.push(t),!t.passed)return P(s,n,i,a,y,v)}if(!r.includes("get")&&a){const t=await f("get",async()=>{const e=await u.get(n,a);if(!e)throw new Error(`get returned null for id=${a}`);return e});i.push(t)}if(!r.includes("list")){const t=await f("list",async()=>{const e=await u.query(n,{limit:5});if(a){const b=e.items.some(c=>c.id===a)}return e});i.push(t)}if(!r.includes("listCard")){const t=await f("listCard",async()=>await u.query(n,{limit:5},void 0,"listCard"));i.push(t)}if(!r.includes("update")&&a){const t=await f("update",async()=>{const e=Object.values(s.fields).find(c=>c.type==="text"&&c.editable!==!1&&c.editable!==E.GENERATED&&c.editable!==E.COMPUTED&&c.editable!==E.CREATE_ONLY&&c.visibility!=="hidden"&&c.visibility!=="technical"),b=e?{[e.name]:`updated_${Date.now().toString(36)}`}:{};return Object.keys(b).length===0?{skipped:!0}:(await u.update(n,a,b),b)});i.push(t)}if(!r.includes("delete")&&a&&w){const t=await f("delete",async()=>{await u.delete(n,a)});i.push(t)}return P(s,n,i,a,y,v)}function P(s,m,o,l,w,r){const d={entity:s.name,collection:m,passed:o.every(p=>p.passed),steps:o,createdId:l,payload:w,duration:Math.round(performance.now()-r)};return M(d),d}export{O as testEntity};
@@ -1,14 +1,3 @@
1
- /**
2
- * @fileoverview Deterministic CRUD pipeline test - pure data, no browser APIs.
3
- *
4
- * Input: entity definition + form object (like the store/UI would give)
5
- * Process: real framework code (generate → validate → metadata → adapter)
6
- * Output: the exact payload that Supabase/Firebase would receive
7
- *
8
- * @version 0.2.0
9
- * @since 0.1.0
10
- * @author AMBROISE PARK Consulting
11
- */
12
1
  import type { TestImagePipelineOptions, TestImagePipelineResult } from '../common/types';
13
2
  /**
14
3
  * Test the CRUD pipeline as pure data: form object in → framework processing → adapter payload out.
@@ -1 +1 @@
1
- {"version":3,"file":"testImagePipeline.d.ts","sourceRoot":"","sources":["../../src/client/testImagePipeline.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EAIxB,MAAM,iBAAiB,CAAC;AAoCzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAqMlC"}
1
+ {"version":3,"file":"testImagePipeline.d.ts","sourceRoot":"","sources":["../../src/client/testImagePipeline.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EAIxB,MAAM,iBAAiB,CAAC;AAkCzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAqMlC"}
@@ -1 +1 @@
1
- import{reportImagePipeline as U}from"../common/reporter";import{generatePayload as j,getFileFields as w}from"../common/payloadGenerator";async function d(e,a){const f=performance.now();try{const t=await a();return{step:e,passed:!0,duration:Math.round(performance.now()-f),data:t}}catch(t){return{step:e,passed:!1,duration:Math.round(performance.now()-f),error:t instanceof Error?t.message:String(t),errorDetail:t}}}async function v(e){const{entity:a,input:f={},fns:t}=e,y=performance.now(),c=[];let i;const m=await d("generate-payload",async()=>{const o=j(a.fields,f);for(const[r,s]of Object.entries(o)){const l=A(s),u=r in f?" (override)":""}const n=w(a.fields);if(n.length>0)for(const r of n){const s=o[r.name]}return o});if(c.push(m),!m.passed)return g(c,void 0,y);if(i=m.data,t?.validate){const o=await d("upload-pipeline",async()=>{const n=t.validate(i);return typeof n=="object"&&n!==null&&(i=n),n});if(c.push(o),!o.passed)return g(c,i,y)}const p=w(a.fields).filter(o=>["image","images","avatar"].includes(o.type));if(p.length>0){const o=await d("verify-full-url",async()=>{const r=[];for(const s of p){const l=i[s.name];l!=null&&(Array.isArray(l)?l:[l]).forEach((u,b)=>{const h=`${s.name}[${b}]`;u.fullUrl?u.fullUrl.startsWith("blob:")&&r.push(`${h}.fullUrl is blob: ${u.fullUrl}`):r.push(`${h}.fullUrl is empty`)})}if(r.length>0){for(const s of r);throw new Error(`${r.length} URL issue(s): ${r.join("; ")}`)}return{checked:p.length}});c.push(o);const n=await d("verify-thumb-url",async()=>{const r=[];for(const s of p){const l=i[s.name];l!=null&&(Array.isArray(l)?l:[l]).forEach((u,b)=>{const h=`${s.name}[${b}]`;u.thumbUrl?u.thumbUrl.startsWith("blob:")&&r.push(`${h}.thumbUrl is blob: ${u.thumbUrl}`):r.push(`${h}.thumbUrl is empty`)})}if(r.length>0){for(const s of r);throw new Error(`${r.length} thumbUrl issue(s): ${r.join("; ")}`)}return{checked:p.length}});c.push(n)}if(t?.createMetadata){const o=await d("cleanup-image",async()=>{const n=t.createMetadata();for(const[r,s]of Object.entries(n));return i={...i,...n},n});c.push(o)}for(const[o,n]of Object.entries(i));const $=g(c,i,y);return U($),$}function A(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e.length>60?`"${e.slice(0,57)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`Array(${e.length})`;if(typeof e=="object"){const a=Object.keys(e);return`{${a.slice(0,4).join(", ")}${a.length>4?", ...":""}}`}return String(e)}function g(e,a,f){return{passed:e.every(t=>t.passed),steps:e,payload:a,duration:Math.round(performance.now()-f)}}export{v as testImagePipeline};
1
+ import{generatePayload as U,getFileFields as w}from"../common/payloadGenerator";import{reportImagePipeline as j}from"../common/reporter";async function d(e,a){const f=performance.now();try{const t=await a();return{step:e,passed:!0,duration:Math.round(performance.now()-f),data:t}}catch(t){return{step:e,passed:!1,duration:Math.round(performance.now()-f),error:t instanceof Error?t.message:String(t),errorDetail:t}}}async function v(e){const{entity:a,input:f={},fns:t}=e,y=performance.now(),c=[];let i;const m=await d("generate-payload",async()=>{const o=U(a.fields,f);for(const[r,s]of Object.entries(o)){const l=A(s),u=r in f?" (override)":""}const n=w(a.fields);if(n.length>0)for(const r of n){const s=o[r.name]}return o});if(c.push(m),!m.passed)return g(c,void 0,y);if(i=m.data,t?.validate){const o=await d("upload-pipeline",async()=>{const n=t.validate(i);return typeof n=="object"&&n!==null&&(i=n),n});if(c.push(o),!o.passed)return g(c,i,y)}const p=w(a.fields).filter(o=>["image","images","avatar"].includes(o.type));if(p.length>0){const o=await d("verify-full-url",async()=>{const r=[];for(const s of p){const l=i[s.name];l!=null&&(Array.isArray(l)?l:[l]).forEach((u,b)=>{const h=`${s.name}[${b}]`;u.fullUrl?u.fullUrl.startsWith("blob:")&&r.push(`${h}.fullUrl is blob: ${u.fullUrl}`):r.push(`${h}.fullUrl is empty`)})}if(r.length>0){for(const s of r);throw new Error(`${r.length} URL issue(s): ${r.join("; ")}`)}return{checked:p.length}});c.push(o);const n=await d("verify-thumb-url",async()=>{const r=[];for(const s of p){const l=i[s.name];l!=null&&(Array.isArray(l)?l:[l]).forEach((u,b)=>{const h=`${s.name}[${b}]`;u.thumbUrl?u.thumbUrl.startsWith("blob:")&&r.push(`${h}.thumbUrl is blob: ${u.thumbUrl}`):r.push(`${h}.thumbUrl is empty`)})}if(r.length>0){for(const s of r);throw new Error(`${r.length} thumbUrl issue(s): ${r.join("; ")}`)}return{checked:p.length}});c.push(n)}if(t?.createMetadata){const o=await d("cleanup-image",async()=>{const n=t.createMetadata();for(const[r,s]of Object.entries(n));return i={...i,...n},n});c.push(o)}for(const[o,n]of Object.entries(i));const $=g(c,i,y);return j($),$}function A(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e.length>60?`"${e.slice(0,57)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`Array(${e.length})`;if(typeof e=="object"){const a=Object.keys(e);return`{${a.slice(0,4).join(", ")}${a.length>4?", ...":""}}`}return String(e)}function g(e,a,f){return{passed:e.every(t=>t.passed),steps:e,payload:a,duration:Math.round(performance.now()-f)}}export{v as testImagePipeline};
@@ -1,13 +1,3 @@
1
- /**
2
- * @fileoverview Browser-side image upload pipeline test — processImage → uploadImage → verify → cleanup
3
- *
4
- * Exercises the REAL upload pipeline using injected functions from @donotdev/crud.
5
- * Runs in browser (requires canvas, fetch). Not for Node/vitest.
6
- *
7
- * @version 0.1.0
8
- * @since 0.1.0
9
- * @author AMBROISE PARK Consulting
10
- */
11
1
  import type { TestImageUploadOptions, TestImageUploadResult } from '../common/types';
12
2
  /**
13
3
  * Create a 100x100 red PNG test image as a File object, with a white diagonal line.
@@ -1 +1 @@
1
- {"version":3,"file":"testImageUpload.d.ts","sourceRoot":"","sources":["../../src/client/testImageUpload.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EAKtB,MAAM,iBAAiB,CAAC;AAOzB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,SAAmB,GAAG,IAAI,CA6BjE;AAkCD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAsMhC"}
1
+ {"version":3,"file":"testImageUpload.d.ts","sourceRoot":"","sources":["../../src/client/testImageUpload.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EAKtB,MAAM,iBAAiB,CAAC;AAMzB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,SAAmB,GAAG,IAAI,CA6BjE;AAkCD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAsMhC"}
@@ -1,9 +1,3 @@
1
- /**
2
- * @fileoverview Standalone storage adapter test — upload, getUrl, delete
3
- * @version 0.1.0
4
- * @since 0.1.0
5
- * @author AMBROISE PARK Consulting
6
- */
7
1
  import type { TestStorageOptions, TestStorageResult } from '../common/types';
8
2
  /**
9
3
  * Generate a minimal valid PNG blob for testing image uploads
@@ -1 +1 @@
1
- {"version":3,"file":"testStorage.d.ts","sourceRoot":"","sources":["../../src/client/testStorage.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AAOzB;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CA0E1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC;AAkCD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CA2C5B"}
1
+ {"version":3,"file":"testStorage.d.ts","sourceRoot":"","sources":["../../src/client/testStorage.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AAMzB;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CA0E1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC;AAkCD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CA2C5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"payloadGenerator.d.ts","sourceRoot":"","sources":["../../src/common/payloadGenerator.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoI5D;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAUvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE5D;AAMD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2CzB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAClC,WAAW,EAAE,CAIf"}
1
+ {"version":3,"file":"payloadGenerator.d.ts","sourceRoot":"","sources":["../../src/common/payloadGenerator.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAwI5D;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAUvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE5D;AAMD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2CzB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAClC,WAAW,EAAE,CAIf"}
@@ -1 +1 @@
1
- import{EDITABLE as d}from"@donotdev/core";const c={text:e=>{const t=e.validation?.maxLength??20;return`test_${e.name}_${Date.now().toString(36)}`.slice(0,t)},textarea:e=>`Test ${e.name} content \u2014 generated by @donotdev/testing`,richtext:()=>"<p>Test rich text content</p>",email:()=>`test_${Date.now().toString(36)}@example.com`,url:()=>"https://example.com/test",password:()=>"Test1234!@#$",tel:()=>"+33612345678",iban:()=>"FR7630006000011234567890189",number:e=>{const t=e.validation?.min??0,n=e.validation?.max??100;return Math.floor(t+(n-t)/2)},range:e=>c.number(e),rating:()=>3,year:e=>{const t=e.validation?.min??2e3,n=e.validation?.max??new Date().getFullYear();return Math.floor(t+(n-t)/2)},price:()=>({amount:9900,currency:"EUR",vatIncluded:!0,discountPercent:0}),currency:e=>{const t=e.validation?.min??0,n=e.validation?.max??1e4;return Math.floor(t+(n-t)/2)},select:e=>o(e),radio:e=>o(e),combobox:e=>o(e)??`test_${e.name}`,multiselect:e=>{const t=o(e);return t?[t]:[]},boolean:()=>!0,checkbox:()=>!0,switch:e=>{const t=e.options?.fieldSpecific?.checkedValue;return t!==void 0?t:!0},date:()=>new Date().toISOString().split("T")[0],"datetime-local":()=>new Date().toISOString().slice(0,16),time:()=>"12:00",month:()=>`${new Date().getFullYear()}-01`,week:()=>`${new Date().getFullYear()}-W01`,timestamp:()=>new Date().toISOString(),image:()=>null,images:()=>[],file:()=>null,files:()=>[],document:()=>null,documents:()=>[],avatar:()=>null,address:()=>({formatted_address:"1 rue de Rivoli, 75001 Paris, France",latitude:48.8606,longitude:2.3376}),geopoint:()=>({lat:48.8566,lng:2.3522}),reference:()=>"",hidden:()=>"test_hidden_value",color:()=>"#3B82F6",badge:()=>"test",map:()=>({key1:"value1"}),array:()=>[],"field-array":()=>[],duration:()=>3600,gdprConsent:()=>!0};function o(e){const t=e.validation?.options;return t?(typeof t=="function"?t({}):t)?.[0]?.value:void 0}function u(e){return!(new Set(["id","createdAt","updatedAt","createdById","updatedById","status"]).has(e.name)||e.editable===d.GENERATED||e.editable===d.COMPUTED||e.editable===!1||e.visibility==="hidden")}function r(e){return["image","images","file","files","document","documents","avatar"].includes(e.type)}function m(e){return["images","files","documents"].includes(e.type)}function f(e,t){const n={};for(const[i,a]of Object.entries(e)){if(!u(a)||r(a))continue;if(t&&i in t){n[i]=t[i];continue}const l=c[a.type];if(!l){a.validation?.required&&(n[i]=`test_${a.type}_${i}`);continue}const s=l(a);(a.validation?.required||s!==null)&&(n[i]=s)}if(t)for(const[i,a]of Object.entries(t))i in n||(n[i]=a);return n}function g(e){return Object.values(e).filter(t=>u(t)&&r(t))}export{f as generatePayload,g as getFileFields,r as isFileField,m as isMultiFileField};
1
+ import{EDITABLE as s}from"@donotdev/core";const c={text:e=>{const t=e.validation?.maxLength??20;return`test_${e.name}_${Date.now().toString(36)}`.slice(0,t)},textarea:e=>`Test ${e.name} content \u2014 generated by @donotdev/testing`,richtext:()=>"<p>Test rich text content</p>",email:()=>`test_${Date.now().toString(36)}@example.com`,url:()=>"https://example.com/test",password:()=>"Test1234!@#$",tel:()=>"+33612345678",iban:()=>"FR7630006000011234567890189",number:e=>{const t=e.validation?.min??0,n=e.validation?.max??100;return Math.floor(t+(n-t)/2)},range:e=>c.number(e),rating:()=>3,year:e=>{const t=e.validation?.min??2e3,n=e.validation?.max??new Date().getFullYear();return Math.floor(t+(n-t)/2)},price:()=>({amount:9900,currency:"EUR",vatIncluded:!0,discountPercent:0}),currency:e=>{const t=e.validation?.min??0,n=e.validation?.max??1e4;return Math.floor(t+(n-t)/2)},select:e=>o(e),radio:e=>o(e),combobox:e=>o(e)??`test_${e.name}`,multiselect:e=>{const t=o(e);return t?[t]:[]},boolean:()=>!0,checkbox:()=>!0,switch:e=>{const t=e.options?.fieldSpecific,n=t&&"checkedValue"in t?t.checkedValue:void 0;return n!==void 0?n:!0},date:()=>new Date().toISOString().split("T")[0],"datetime-local":()=>new Date().toISOString().slice(0,16),time:()=>"12:00",month:()=>`${new Date().getFullYear()}-01`,week:()=>`${new Date().getFullYear()}-W01`,timestamp:()=>new Date().toISOString(),image:()=>null,images:()=>[],file:()=>null,files:()=>[],document:()=>null,documents:()=>[],avatar:()=>null,address:()=>({formatted_address:"1 rue de Rivoli, 75001 Paris, France",latitude:48.8606,longitude:2.3376}),geopoint:()=>({lat:48.8566,lng:2.3522}),reference:()=>"",hidden:()=>"test_hidden_value",color:()=>"#3B82F6",badge:()=>"test",map:()=>({key1:"value1"}),array:()=>[],"field-array":()=>[],duration:()=>3600,gdprConsent:()=>!0};function o(e){const t=e.validation?.options;return t?(typeof t=="function"?t({}):t)?.[0]?.value:void 0}function u(e){return!(new Set(["id","createdAt","updatedAt","createdById","updatedById","status"]).has(e.name)||e.editable===s.GENERATED||e.editable===s.COMPUTED||e.editable===!1||e.visibility==="hidden")}function r(e){return["image","images","file","files","document","documents","avatar"].includes(e.type)}function m(e){return["images","files","documents"].includes(e.type)}function f(e,t){const n={};for(const[i,a]of Object.entries(e)){if(!u(a)||r(a))continue;if(t&&i in t){n[i]=t[i];continue}const l=c[a.type];if(!l){a.validation?.required&&(n[i]=`test_${a.type}_${i}`);continue}const d=l(a);(a.validation?.required||d!==null)&&(n[i]=d)}if(t)for(const[i,a]of Object.entries(t))i in n||(n[i]=a);return n}function g(e){return Object.values(e).filter(t=>u(t)&&r(t))}export{f as generatePayload,g as getFileFields,r as isFileField,m as isMultiFileField};
@@ -1 +1 @@
1
- function a(o){return o?"\x1B[32mPASS\x1B[0m":"\x1B[31mFAIL\x1B[0m"}function r(o){return o<1e3?`${o}ms`:`${(o/1e3).toFixed(2)}s`}function f(o){const s=o.passed?" +":" x",e=r(o.duration),n=o.error?` \u2014 ${o.error}`:"";return`${s} ${o.step} (${e})${n}`}function t(o){const s=`[${a(o.passed)}] ${o.entity} (${o.collection}) \u2014 ${r(o.duration)}`;o.createdId;for(const e of o.steps);if(!o.passed&&o.payload){const e=o.steps.find(n=>n.step==="create"&&!n.passed)}for(const e of o.steps)!e.passed&&e.errorDetail}function p(o){const s=`[${a(o.passed)}] Storage test \u2014 ${r(o.duration)}`;for(const e of o.steps);for(const e of o.steps)!e.passed&&e.errorDetail}function c(o){const s=`[${a(o.passed)}] Image Upload \u2014 ${r(o.duration)}`;o.processed,o.picture;for(const e of o.steps);for(const e of o.steps)!e.passed&&e.errorDetail}function i(o){const s=`[${a(o.passed)}] Image Pipeline \u2014 ${r(o.duration)}`;for(const e of o.steps);for(const e of o.steps)!e.passed&&e.errorDetail}export{t as reportEntity,i as reportImagePipeline,c as reportImageUpload,p as reportStorage};
1
+ function a(s){return s?"\x1B[32mPASS\x1B[0m":"\x1B[31mFAIL\x1B[0m"}function r(s){return s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`}function f(s){const o=s.passed?" +":" x",t=r(s.duration),n=s.error?` \u2014 ${s.error}`:"";return`${o} ${s.step} (${t})${n}`}function e(s){const o=`[${a(s.passed)}] ${s.entity} (${s.collection}) \u2014 ${r(s.duration)}`;s.createdId;for(const t of s.steps);if(!s.passed&&s.payload){const t=s.steps.find(n=>n.step==="create"&&!n.passed)}for(const t of s.steps)!t.passed&&t.errorDetail}function p(s){const o=`[${a(s.passed)}] Storage test \u2014 ${r(s.duration)}`;for(const t of s.steps);for(const t of s.steps)!t.passed&&t.errorDetail}function c(s){const o=`[${a(s.passed)}] Image Upload \u2014 ${r(s.duration)}`;s.processed,s.picture;for(const t of s.steps);for(const t of s.steps)!t.passed&&t.errorDetail}function i(s){const o=`[${a(s.passed)}] Image Pipeline \u2014 ${r(s.duration)}`;for(const t of s.steps);for(const t of s.steps)!t.passed&&t.errorDetail}export{e as reportEntity,i as reportImagePipeline,c as reportImageUpload,p as reportStorage};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/testing",
3
- "version": "0.1.44",
3
+ "version": "0.2.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {},
25
25
  "peerDependencies": {
26
- "@donotdev/core": "^0.1.43"
26
+ "@donotdev/core": "^0.2.3"
27
27
  },
28
28
  "files": [
29
29
  "dist",
@@ -48,4 +48,4 @@
48
48
  "registry": "https://registry.npmjs.org",
49
49
  "access": "public"
50
50
  }
51
- }
51
+ }