Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meta-cms/core

Package Overview
Dependencies
Maintainers
2
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meta-cms/core - npm Package Compare versions

Comparing version 1.0.112 to 1.0.113

2

index.js

@@ -232,2 +232,2 @@ "use strict";var A=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ie=Object.prototype.hasOwnProperty;var ae=(t,e)=>{for(var r in e)A(t,r,{get:e[r],enumerable:!0})},oe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of se(e))!ie.call(t,s)&&s!==r&&A(t,s,{get:()=>e[s],enumerable:!(n=ne(e,s))||n.enumerable});return t};var ce=t=>oe(A({},"__esModule",{value:!0}),t);var he={};ae(he,{GraphqlClient:()=>y,MetaCms:()=>U,buildQuery:()=>P,chunk:()=>O,collectionFragment:()=>j,config:()=>de,contentQuery:()=>D,fieldToMetafieldType:()=>w,getLoremCollectionData:()=>J,getLoremImageData:()=>v,getLoremProductData:()=>x,getMetaCMSConfigQuery:()=>le,getOwnerIdQuery:()=>N,imageFragment:()=>b,isId:()=>C,mediaImageFragment:()=>E,metafieldFragment:()=>$,metafieldsForNodes:()=>q,metafieldsQuery:()=>R,mockValue:()=>_,mustaching:()=>te,normalizeEdges:()=>m,productFragment:()=>M,randomId:()=>g,setInNamespace:()=>T,setMetaCMSConfigMutation:()=>F,syncConfig:()=>me,templating:()=>ge,traverse:()=>S,videoFragment:()=>L});module.exports=ce(he);var W=t=>{let e=[];return t.forEach(r=>{!r||(r.type==="product_reference"&&r.product.content&&r.product.content.map(n=>{e.push(n.id)}),r.type==="list.product_reference"&&r.values.edges.map(({node:n})=>{n.content&&n.content.map(s=>{e.push(s.id)})}),r.type==="collection_reference"&&r.collection.content&&r.collection.content.map(n=>{e.push(n.id)}),r.type==="list.collection_reference"&&r.values.edges.map(({node:n})=>{n.content&&n.content.map(s=>{e.push(s.id)})}))}),e};var F=`

}`;var m=t=>t.edges.reduce((e,{node:r})=>(e.push(r),e),[]),de=t=>t,g=()=>{let t="meta-cms-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",e="",r=10;for(;r--;)e+=t[Math.random()*t.length|0];return`meta-cms-${e}`},C=t=>typeof t=="string"?t.startsWith("gid://shopify/Metafield/"):!1,T=({content:t,namespace:e,key:r,id:n,value:s})=>{let a=n?`${r}@${n}`:r;t[e]||Object.assign(t,{[e]:{}}),Object.assign(t[e],{[a]:s})},P=({handles:t,ids:e})=>{let r=n=>n.replace("gid://shopify/Product/","");return(t==null?void 0:t.length)||(e==null?void 0:e.length)?`${(e||[]).map((n,s,a)=>`id:${r(n)}${a.length-1>s?" or ":t!=null&&t.length?" or":""}`).join("")} ${(t||[]).map((n,s,a)=>`handle:${n}${a.length-1>s?" or ":""}`).join("")}`.trim():void 0},S=(t,e,r=s=>s,n=[])=>typeof t!="object"?t:(Array.isArray(t)?t:Object.entries(t)).reduce((a,i,c)=>{if(Array.isArray(t))a.push(S(i,e,r,n.concat(c)));else{let[l,u]=i;Array.isArray(u)?(a[l]=[],u.forEach((o,d)=>a[l].push(S(o,e,r,n.concat(l).concat(d))))):u&&(u.attributes?a[l]=e(u,n.concat(l)):a[l]=r(S(u,e,r,n.concat(l)),n.concat(l)))}return a},Array.isArray(t)?[]:{}),O=(t,e)=>{let r=[],n=0;for(;n<t.length;)r.push(t.slice(n,e+n)),n+=e;return r};var V=({acc:t,item:e,client:r,locale:n,jsonMetafields:s,nestedContent:a})=>{var u;let i={itemID:e.id,itemType:e.type,itemProp:`${e.namespace}:${e.key}`},c,l=({id:o,key:d,namespace:f,objectId:p})=>{a&&t&&n&&T({content:t,key:d,id:p,namespace:f.replace(`@${n}`,""),value:a[o]})};switch(e.type){case"collection_reference":{c={attributes:i,value:{...e.collection,products:m(e.collection.products).map(({content:o,...d})=>(o==null||o.forEach(f=>l({...f,objectId:d.id})),{...d,variants:m(d.variants)}))}};break}case"file_reference":{if("image"in e&&"image"in(e==null?void 0:e.image)){(!e.image.image.alt||!e.image.image.alt.length)&&(e.image.image.alt="image"),c={attributes:i,value:{...e.image.image,id:e.image.id}};break}if("video"in e){c={attributes:i,value:e.video};break}break}case"product_reference":{let{product:o}=e;if(!o)break;(u=o.content)==null||u.forEach(d=>l({...d,objectId:o.id})),c={attributes:i,value:{...o,variants:m(e.product.variants)}};break}case"list.collection_reference":{c={attributes:i,value:m(e.values).map(o=>{var d;return(d=o.content)==null||d.forEach(f=>l({...f,objectId:o.id})),{...o,products:m(o.products).map(f=>{var p;return(p=f.content)==null||p.forEach(h=>l({...h,objectId:f.id})),{...f,variants:m(f.variants)}})}})};break}case"list.file_reference":{c={attributes:i,value:m(e.values).map(o=>{if("image"in o)return{...o.image,id:o.id};if("video"in o)return o})};break}case"list.product_reference":{c={attributes:i,value:m(e.values).map(o=>{var d;return(d=o.content)==null||d.forEach(f=>l({...f,objectId:o.id})),{...o,variants:m(o.variants)}})};break}case"json":{let o=JSON.parse(e.value);if(o.country&&o.address&&o.locality&&o.postal_code)c={attributes:i,value:o};else{let d=B(e.value,s);c={attributes:i,value:d.value||d}}break}case"list.multi_line_text_field":case"list.single_line_text_field":{c={attributes:i,value:JSON.parse(e.value)};break}case"multi_line_text_field":case"single_line_text_field":{c={attributes:i,value:e.value||""};break}case"boolean":{c={attributes:i,value:e.value==="true"};break}case"number_decimal":{c={attributes:i,value:Number(e.value)};break}case"list.number_decimal":{c={attributes:i,value:JSON.parse(e.value,(o,d)=>Number(d))};break}case"url":{c={attributes:i,value:e.value};break}case"date_time":{c={attributes:i,value:(()=>{try{return new Date(e.value)}catch{return new Date}})()};break}}return c},G=({client:t,id:e,initalizer:r,content:n,jsonMetafields:s,nestedContent:a})=>{var c,l;let i=r||{};for(let u=0;u<n.length;u++){let o=n[u];if(o){if(!((l=(c=t.config[o.namespace.replace(`@${t.locale}`,"")])==null?void 0:c.schema)==null?void 0:l[o.key]))return i;let f=V({client:t,acc:i,item:o,jsonMetafields:s,nestedContent:a});T({content:i,key:o.key,namespace:o.namespace.replace(`@${t.locale}`,""),value:f})}}return i};var ue=t=>{let e=[];return t&&JSON.parse(t,(r,n)=>(Array.isArray(n)?n.forEach(s=>{C(s)&&e.push(s)}):C(n)&&e.push(n),n)),e},K=t=>{let e=[];return t.forEach(r=>{!r||r.type==="json"&&(e=e.concat(ue(r.value)))}),e},k=(t,e)=>t.reduce((r,n)=>(n&&(r[n.id]=V({item:n,client:e})),r),{}),B=(t,e)=>e?JSON.parse(t,(r,n)=>Array.isArray(n)?n.map(s=>C(s)?e[s]:s):C(n)?e[n]:n):JSON.parse(t);var w=t=>{let r={text:"multi_line_text_field",richtext:"multi_line_text_field",image:"file_reference",product:"product_reference",collection:"collection_reference",object:"json",boolean:"boolean",video:"file_reference",url:"single_line_text_field",list:"single_line_text_field",number:"number_decimal",address:"json",date:"date_time"}[t.type];return t.isList&&r!=="json"?`list.${r}`:r},v=(t=400,e=300)=>({alt:"image",src:`https://picsum.photos/${t}/${e}`,width:t,height:e}),x=()=>({id:g(),descriptionHtml:"Lorem ipsum",title:"Lorem ipsum",handle:"",featuredImage:v(),compareAtPriceRange:{maxVariantPrice:{amount:"0",currencyCode:"EUR"},minVariantPrice:{amount:"0",currencyCode:"EUR"}},priceRange:{maxVariantPrice:{amount:"0",currencyCode:"EUR"},minVariantPrice:{amount:"0",currencyCode:"EUR"}},variants:[],tags:[]}),J=()=>({id:g(),title:"Lorem ipsum",descriptionHtml:"Lorem ipsum",handle:"",image:v(),products:[x(),x(),x()]}),H=(t,e=3)=>{let r=[];for(let n=0;n<4;n++)r.push(t());return r};var Q=(t,e=!0,r)=>Object.entries(t.schema).reduce((n,[s,a])=>{if(a.isList)a.type==="object"?n[s]=Q(a,!1,r):n[s]=[];else if(a.type==="object")n[s]=Q(a,!1,r);else{let i=w(a),c={itemID:g(),itemType:i,itemProp:""};n[s]=_(a,c)}return n},t.type==="object"&&e?{}:t.isList?[]:{}),_=(t,e,r=!0,n)=>{var s;switch(t.type){case"object":return t.isList?{attributes:e,value:[]}:{attributes:e,value:Q(t,!0,(s=e.itemProp)==null?void 0:s.split(":")[0])};case"collection":return{attributes:e,value:t.isList?H(J):J()};case"image":return{value:t.isList?r?H(v):[]:r?{id:g(),...v()}:void 0,attributes:e};case"video":return{value:void 0,attributes:e};case"product":return{attributes:e,value:t.isList?H(x):x()};case"richtext":return{attributes:e,value:t.isList?n?[n]:["Lorem ipsum","Lorem ipsum","Lorem ipsum"]:n||`<i>Lorem ipsum dolor sit amet consectetur adipisicing elit</i>.
Officia quisquam, vero eius nam, reiciendis fugiat dolore, sit aspernatur numquam a vitae quae laborum? Rem quidem, neque dignissimos delectus vel quasi!`};case"boolean":return{attributes:e,value:!1};case"url":return{attributes:e,value:"/"};case"list":return{attributes:e,value:t.options[0].value};case"number":return{attributes:e,value:0};case"date":return{attributes:e,value:new Date};default:case"text":return{attributes:e,value:t.isList?n?[n]:["Lorem ipsum","Lorem ipsum","Lorem ipsum"]:n||"Lorem ipsum dolor sit amet consectetur adipisicing elit."}}};var fe=async t=>[...new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t)))].map(e=>e.toString(16).padStart(2,"0")).join(""),X=async t=>{let e=await t.clone().text();return{hash:await fe(e+t.url.toString())}};var Y=(t=5e3)=>new Promise(e=>{setTimeout(e,t)}),y=class{constructor(e,r){this.cache={};this.request=async(e,r)=>{let n=new Request(this.url,{method:"POST",body:JSON.stringify({query:e,variables:r||{}}),headers:{...this.headers||{},"Content-Type":"application/json"}}),{hash:s}=await X(n);if(console.log(process.env.CMS_BUILD),this.cache[s]&&process.env.CMS_BUILD==="build")return console.log("CACHED"),this.cache[s];let a=await await fetch(n);if(a.ok){let{data:i}=await a.json();return this.cache[s]=i,i}else throw new Error(await a.text())};this.url=e,this.headers=r}},U=class{constructor(e,{storefrontName:r,storefrontAccessToken:n,defaultNameSpaces:s},a){this.getMetafieldsByIds=async e=>{if(!e.length)return[{},[]];let r=O(e,250),s=(await Promise.all(r.map(async a=>{var c,l;let i;for(;!(i!=null&&i.metafields);)i=await this.client.request(R(!1,{customProductMetafields:(l=(c=this.params)==null?void 0:c.product)==null?void 0:l.customMetafieldsIdentifiers}),{ids:a}),i!=null&&i.metafields||await Y(1e3);return i.metafields}))).flat();return s.length?[k(s,this),s]:[{},[]]};this.getMetafieldsForProductsAndCollection=async({collection:e,product:r,locale:n})=>{var p,h;if(!(e!=null&&e.ids)&&!(e!=null&&e.handles)&&!(e!=null&&e.namespaces)&&!(r!=null&&r.ids)&&!(r!=null&&r.handles)&&!(r!=null&&r.namespaces))return[{},[],[]];let s=await this.client.request(q({collectionQuery:P({ids:e==null?void 0:e.ids,handles:e==null?void 0:e.handles}),productQuery:P({ids:r==null?void 0:r.ids,handles:r==null?void 0:r.handles})},{customProductMetafields:(h=(p=this.params)==null?void 0:p.product)==null?void 0:h.customMetafieldsIdentifiers}),{productIdentifiers:this.buildIdentifiers((r==null?void 0:r.namespaces)||[],n),collectionIdentifiers:this.buildIdentifiers((e==null?void 0:e.namespaces)||[],n)});if(!s)return[{},[],[]];let{products:a,collections:i}=s,c=a?m(a):[],l=i?m(i):[],u=c.map(I=>I.content).flat(),o=l.map(I=>I.content).flat(),d=k(u,this),f=k(o,this);return[{...d,...f},u.concat(o),c.concat(l)]};this.translate=async(e,r)=>{let n=Object.keys(this.config)};this.getContentForNamespaces=async e=>{var f,p,h;if(this.locale=e.locale||"en",!e.global)return{content:{},params:e};this.params=e;let r;for(;!(r!=null&&r.shop);)r=await this.client.request(D(!0,{customProductMetafields:(f=e.product)==null?void 0:f.customMetafieldsIdentifiers}),{productIdentifiers:this.buildIdentifiers(((p=e.product)==null?void 0:p.namespaces)||[],e.locale),collectionIdentifiers:this.buildIdentifiers(((h=e.collection)==null?void 0:h.namespaces)||[],e.locale),identifiers:this.buildIdentifiers(e.global.concat(this.defaultNameSpaces),e.locale)}),r!=null&&r.shop||await Y();let{shop:{content:n}}=r,[[s,a],[i,c,l]]=await Promise.all([this.getMetafieldsByIds(W(n)),this.getMetafieldsForProductsAndCollection(e)]),[u,o]=await this.getMetafieldsByIds(K(n.concat(a).concat(c))),d=G({client:this,content:n,jsonMetafields:u,nestedContent:{...s,...i}});return l.forEach(({id:I,content:re})=>{G({client:this,initalizer:d,id:I,content:re,jsonMetafields:u,nestedContent:{...s,...i}})}),{params:{...e,global:e.global.concat(this.defaultNameSpaces)},content:d}};this.t=(e,r,{productId:n,collectionId:s})=>{let[a,i]=e.split(".");if(!(a in this.config))throw new Error(`Namespace "${a}" is not defined in the schema`);let{kind:c,schema:l}=this.config[a];if(n&&c==="product"&&(i=`${i}@${n}`),s&&c==="collection"&&(i=`${i}@${s}`),!(i in l))throw new Error(`Path "${i}" is not defined in the "${a}" schema`);let u=l[i],o=()=>{let d=w(u),f={itemID:g(),itemType:d,itemProp:`${a}:${i}`},p=this.config[a].schema[i].default;return _(u,f,!0,p)};return a in r||Object.assign(r,{[a]:{}}),[r[a][i]||o(),u,this.locale]};this.buildIdentifiers=(e,r)=>e?e.reduce((n,s)=>{let a=this.config[s];return a&&Object.keys(a.schema).forEach(i=>{n.push({namespace:`${s}@${r}`,key:i})}),n},[]):[];this.locale="en",this.adapter=a||(i=>i),this.config=e,this.defaultNameSpaces=s||[],this.client=new y(`https://${r}.myshopify.com/api/2022-10/graphql.json`,{"X-SHOPIFY-STOREFRONT-ACCESS-TOKEN":n})}};var me=async(t,{storefrontName:e,storefrontAccessToken:r,adminAccessToken:n},s)=>{let a=new y(`https://${e}.myshopify.com/api/2022-10/graphql.json`,{"X-SHOPIFY-STOREFRONT-ACCESS-TOKEN":r}),i=new y(`https://${e}.myshopify.com/admin/api/2022-10/graphql.json`,{"X-Shopify-Access-Token":n}),{shop:{id:c}}=await a.request(N);return await i.request(F,{value:JSON.stringify(t),key:s,ownerId:c})};var Z=/{{([\:\/\-\\\,\.a-zA-Z0-9\s])*}}/g,te=(t,e)=>(e&&Object.keys(e).forEach(r=>{t=t.replace(new RegExp(`{{${r}}}`,"g"),String(e[r]))}),t.replace(Z,"")),ee=/\(\(([\:\/\-\\\,\s\u0030-\u4351\u4e00-\u9fa5])*\)\)/g,pe=(t,e)=>{if(!e)return t;let r=t.matchAll(ee);return Array.from(r).forEach(n=>{let[s]=n,[a,i,c]=s.replace("((","").replace("))","").split(","),l=typeof e[a]=="number"?Number(e[a])>1:!!e[a];c?l===!0?t=t.replace(s,c.trim()):t=t.replace(s,i.trim()):l===!0?(c=i,t=t.replace(s,c.trim())):t=t.replace(ee,"")}),t},ge=(t,e)=>pe(te(t,e),e);0&&(module.exports={GraphqlClient,MetaCms,buildQuery,chunk,collectionFragment,config,contentQuery,fieldToMetafieldType,getLoremCollectionData,getLoremImageData,getLoremProductData,getMetaCMSConfigQuery,getOwnerIdQuery,imageFragment,isId,mediaImageFragment,metafieldFragment,metafieldsForNodes,metafieldsQuery,mockValue,mustaching,normalizeEdges,productFragment,randomId,setInNamespace,setMetaCMSConfigMutation,syncConfig,templating,traverse,videoFragment});
Officia quisquam, vero eius nam, reiciendis fugiat dolore, sit aspernatur numquam a vitae quae laborum? Rem quidem, neque dignissimos delectus vel quasi!`};case"boolean":return{attributes:e,value:!1};case"url":return{attributes:e,value:"/"};case"list":return{attributes:e,value:t.options[0].value};case"number":return{attributes:e,value:0};case"date":return{attributes:e,value:new Date};default:case"text":return{attributes:e,value:t.isList?n?[n]:["Lorem ipsum","Lorem ipsum","Lorem ipsum"]:n||"Lorem ipsum dolor sit amet consectetur adipisicing elit."}}};var fe=async t=>[...new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t)))].map(e=>e.toString(16).padStart(2,"0")).join(""),X=async t=>{let e=await t.clone().text();return{hash:await fe(e+t.url.toString())}};var Y=(t=5e3)=>new Promise(e=>{setTimeout(e,t)}),y=class{constructor(e,r){this.cache={};this.request=async(e,r)=>{let n=new Request(this.url,{method:"POST",body:JSON.stringify({query:e,variables:r||{}}),headers:{...this.headers||{},"Content-Type":"application/json"}}),{hash:s}=await X(n);if(console.log(process.env.CMS_BUILD,s),this.cache[s]&&process.env.CMS_BUILD==="build")return console.log("CACHED"),this.cache[s];let a=await await fetch(n);if(a.ok){let{data:i}=await a.json();return this.cache[s]=i,i}else throw new Error(await a.text())};this.url=e,this.headers=r}},U=class{constructor(e,{storefrontName:r,storefrontAccessToken:n,defaultNameSpaces:s},a){this.getMetafieldsByIds=async e=>{if(!e.length)return[{},[]];let r=O(e,250),s=(await Promise.all(r.map(async a=>{var c,l;let i;for(;!(i!=null&&i.metafields);)i=await this.client.request(R(!1,{customProductMetafields:(l=(c=this.params)==null?void 0:c.product)==null?void 0:l.customMetafieldsIdentifiers}),{ids:a}),i!=null&&i.metafields||await Y(1e3);return i.metafields}))).flat();return s.length?[k(s,this),s]:[{},[]]};this.getMetafieldsForProductsAndCollection=async({collection:e,product:r,locale:n})=>{var p,h;if(!(e!=null&&e.ids)&&!(e!=null&&e.handles)&&!(e!=null&&e.namespaces)&&!(r!=null&&r.ids)&&!(r!=null&&r.handles)&&!(r!=null&&r.namespaces))return[{},[],[]];let s=await this.client.request(q({collectionQuery:P({ids:e==null?void 0:e.ids,handles:e==null?void 0:e.handles}),productQuery:P({ids:r==null?void 0:r.ids,handles:r==null?void 0:r.handles})},{customProductMetafields:(h=(p=this.params)==null?void 0:p.product)==null?void 0:h.customMetafieldsIdentifiers}),{productIdentifiers:this.buildIdentifiers((r==null?void 0:r.namespaces)||[],n),collectionIdentifiers:this.buildIdentifiers((e==null?void 0:e.namespaces)||[],n)});if(!s)return[{},[],[]];let{products:a,collections:i}=s,c=a?m(a):[],l=i?m(i):[],u=c.map(I=>I.content).flat(),o=l.map(I=>I.content).flat(),d=k(u,this),f=k(o,this);return[{...d,...f},u.concat(o),c.concat(l)]};this.translate=async(e,r)=>{let n=Object.keys(this.config)};this.getContentForNamespaces=async e=>{var f,p,h;if(this.locale=e.locale||"en",!e.global)return{content:{},params:e};this.params=e;let r;for(;!(r!=null&&r.shop);)r=await this.client.request(D(!0,{customProductMetafields:(f=e.product)==null?void 0:f.customMetafieldsIdentifiers}),{productIdentifiers:this.buildIdentifiers(((p=e.product)==null?void 0:p.namespaces)||[],e.locale),collectionIdentifiers:this.buildIdentifiers(((h=e.collection)==null?void 0:h.namespaces)||[],e.locale),identifiers:this.buildIdentifiers(e.global.concat(this.defaultNameSpaces),e.locale)}),r!=null&&r.shop||await Y();let{shop:{content:n}}=r,[[s,a],[i,c,l]]=await Promise.all([this.getMetafieldsByIds(W(n)),this.getMetafieldsForProductsAndCollection(e)]),[u,o]=await this.getMetafieldsByIds(K(n.concat(a).concat(c))),d=G({client:this,content:n,jsonMetafields:u,nestedContent:{...s,...i}});return l.forEach(({id:I,content:re})=>{G({client:this,initalizer:d,id:I,content:re,jsonMetafields:u,nestedContent:{...s,...i}})}),{params:{...e,global:e.global.concat(this.defaultNameSpaces)},content:d}};this.t=(e,r,{productId:n,collectionId:s})=>{let[a,i]=e.split(".");if(!(a in this.config))throw new Error(`Namespace "${a}" is not defined in the schema`);let{kind:c,schema:l}=this.config[a];if(n&&c==="product"&&(i=`${i}@${n}`),s&&c==="collection"&&(i=`${i}@${s}`),!(i in l))throw new Error(`Path "${i}" is not defined in the "${a}" schema`);let u=l[i],o=()=>{let d=w(u),f={itemID:g(),itemType:d,itemProp:`${a}:${i}`},p=this.config[a].schema[i].default;return _(u,f,!0,p)};return a in r||Object.assign(r,{[a]:{}}),[r[a][i]||o(),u,this.locale]};this.buildIdentifiers=(e,r)=>e?e.reduce((n,s)=>{let a=this.config[s];return a&&Object.keys(a.schema).forEach(i=>{n.push({namespace:`${s}@${r}`,key:i})}),n},[]):[];this.locale="en",this.adapter=a||(i=>i),this.config=e,this.defaultNameSpaces=s||[],this.client=new y(`https://${r}.myshopify.com/api/2022-10/graphql.json`,{"X-SHOPIFY-STOREFRONT-ACCESS-TOKEN":n})}};var me=async(t,{storefrontName:e,storefrontAccessToken:r,adminAccessToken:n},s)=>{let a=new y(`https://${e}.myshopify.com/api/2022-10/graphql.json`,{"X-SHOPIFY-STOREFRONT-ACCESS-TOKEN":r}),i=new y(`https://${e}.myshopify.com/admin/api/2022-10/graphql.json`,{"X-Shopify-Access-Token":n}),{shop:{id:c}}=await a.request(N);return await i.request(F,{value:JSON.stringify(t),key:s,ownerId:c})};var Z=/{{([\:\/\-\\\,\.a-zA-Z0-9\s])*}}/g,te=(t,e)=>(e&&Object.keys(e).forEach(r=>{t=t.replace(new RegExp(`{{${r}}}`,"g"),String(e[r]))}),t.replace(Z,"")),ee=/\(\(([\:\/\-\\\,\s\u0030-\u4351\u4e00-\u9fa5])*\)\)/g,pe=(t,e)=>{if(!e)return t;let r=t.matchAll(ee);return Array.from(r).forEach(n=>{let[s]=n,[a,i,c]=s.replace("((","").replace("))","").split(","),l=typeof e[a]=="number"?Number(e[a])>1:!!e[a];c?l===!0?t=t.replace(s,c.trim()):t=t.replace(s,i.trim()):l===!0?(c=i,t=t.replace(s,c.trim())):t=t.replace(ee,"")}),t},ge=(t,e)=>pe(te(t,e),e);0&&(module.exports={GraphqlClient,MetaCms,buildQuery,chunk,collectionFragment,config,contentQuery,fieldToMetafieldType,getLoremCollectionData,getLoremImageData,getLoremProductData,getMetaCMSConfigQuery,getOwnerIdQuery,imageFragment,isId,mediaImageFragment,metafieldFragment,metafieldsForNodes,metafieldsQuery,mockValue,mustaching,normalizeEdges,productFragment,randomId,setInNamespace,setMetaCMSConfigMutation,syncConfig,templating,traverse,videoFragment});
{
"name": "@meta-cms/core",
"version": "1.0.112",
"version": "1.0.113",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc