@shopify/cli
Version:
A CLI tool to build for the Shopify platform
2 lines (1 loc) • 2.26 kB
JavaScript
import{f as l,ga as o,ha as h,ia as c,v as s,w as q,z as f}from"./chunk-XONFGLJQ.js";import{b as g}from"./chunk-4LNCYIS3.js";import{b as m}from"./chunk-ZSBA6VIC.js";import{e as i,g as a}from"./chunk-VPRTJUIN.js";a();var y=i(c()),x=new y.default({minTime:150,maxConcurrent:10});async function v(e){let n="App Management",r=`https://${await s()}/app_management/unstable/graphql.json`;return{token:e,api:n,url:r,responseOptions:{onResponse:d}}}var A=e=>l(e),T=async(e,n,t)=>{let u=`https://${await s()}/app_management/unstable/organizations/${e}/app_logs/poll`;return h(u,n,t)};async function U(e){let n=e.cacheOptions?.cacheExtraKey??"",t=e.cacheOptions?{...e.cacheOptions,cacheExtraKey:n}:void 0;return x.schedule(async()=>o({...await v(e.token),query:e.query,variables:e.variables,cacheOptions:t,preferredBehaviour:e.requestOptions?.requestMode,unauthorizedHandler:e.unauthorizedHandler}))}function d(e){if(!e.extensions)return;let n=[];for(let t of e.extensions.deprecations)t.supportedUntilDate&&n.push(new Date(t.supportedUntilDate));g(n)}a();var D=i(c()),z=new D.default({minTime:150,maxConcurrent:10});async function L(e){let n="App Dev",t=f(e.shopFqdn),u=`https://${await q(t)}/app_dev/unstable/graphql.json`,p=m()==="local"?{"x-forwarded-host":t}:void 0;return z.schedule(()=>o({query:e.query,api:n,url:u,token:e.token,addedHeaders:p,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler,preferredBehaviour:e.requestOptions?.requestMode}))}a();var b=i(c()),k=new b.default({minTime:150,maxConcurrent:10});async function R(e,n,t){let r="Functions",p=`https://${await s()}/functions/unstable/organizations/${e}/${t}/graphql`;return{token:n,api:r,url:p,responseOptions:{onResponse:d}}}async function P(e){return await k.schedule(async()=>o({...await R(e.organizationId,e.token,e.appId),query:e.query,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}a();var w=i(c()),H=new w.default({minTime:150,maxConcurrent:10});async function Z(e){let n="Webhooks",r=`https://${await s()}/webhooks/unstable/organizations/${e.organizationId}/graphql.json`;return H.schedule(()=>o({query:e.query,api:n,url:r,token:e.token,variables:e.variables,unauthorizedHandler:e.unauthorizedHandler}))}export{A as a,T as b,U as c,L as d,P as e,Z as f};