printful-sdk-js-v2
Version:
Printful SDK for Node.js / TypeScript. A wrapper for the Printful REST API (v2)
3 lines (2 loc) • 30 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class e{constructor(e){this.config=e}}class t extends Error{constructor(e,t,r){super(r),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}}function r(e,t,r,o){if("a"===r&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?o:"a"===r?o.call(e):o?o.value:t.get(e)}function o(e,t,r,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(e,r):s?s.value=r:t.set(e,r),r}var s,i,a,n,d,u,p;"function"==typeof SuppressedError&&SuppressedError;class l extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}}class h{constructor(e){s.set(this,void 0),i.set(this,void 0),a.set(this,void 0),n.set(this,void 0),d.set(this,void 0),u.set(this,void 0),p.set(this,void 0),o(this,s,!1,"f"),o(this,i,!1,"f"),o(this,a,!1,"f"),o(this,n,[],"f"),o(this,d,new Promise(((t,d)=>{o(this,u,t,"f"),o(this,p,d,"f");const l=e=>{r(this,s,"f")||r(this,i,"f")||r(this,a,"f")||r(this,n,"f").push(e)};return Object.defineProperty(l,"isResolved",{get:()=>r(this,s,"f")}),Object.defineProperty(l,"isRejected",{get:()=>r(this,i,"f")}),Object.defineProperty(l,"isCancelled",{get:()=>r(this,a,"f")}),e((e=>{r(this,s,"f")||r(this,i,"f")||r(this,a,"f")||(o(this,s,!0,"f"),r(this,u,"f")&&r(this,u,"f").call(this,e))}),(e=>{r(this,s,"f")||r(this,i,"f")||r(this,a,"f")||(o(this,i,!0,"f"),r(this,p,"f")&&r(this,p,"f").call(this,e))}),l)})),"f")}get[(s=new WeakMap,i=new WeakMap,a=new WeakMap,n=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,Symbol.toStringTag)](){return"Cancellable Promise"}then(e,t){return r(this,d,"f").then(e,t)}catch(e){return r(this,d,"f").catch(e)}finally(e){return r(this,d,"f").finally(e)}cancel(){if(!(r(this,s,"f")||r(this,i,"f")||r(this,a,"f"))){if(o(this,a,!0,"f"),r(this,n,"f").length)try{for(const e of r(this,n,"f"))e()}catch(e){return void console.warn("Cancellation threw an error",e)}r(this,n,"f").length=0,r(this,p,"f")&&r(this,p,"f").call(this,new l("Request aborted"))}}get isCancelled(){return r(this,a,"f")}}const c=e=>null!=e,E=e=>"string"==typeof e,_=e=>E(e)&&""!==e,m=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),R=e=>e instanceof FormData,T=e=>{const t=[],r=(e,o)=>{c(o)&&(Array.isArray(o)?o.forEach((t=>{r(e,t)})):"object"==typeof o?Object.entries(o).forEach((([t,o])=>{r(`${e}[${t}]`,o)})):((e,r)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)})(e,o))};return Object.entries(e).forEach((([e,t])=>{r(e,t)})),t.length>0?`?${t.join("&")}`:""},S=async(e,t)=>"function"==typeof t?t(e):t,A=async(e,t)=>{const[r,o,s,i]=await Promise.all([S(t,e.TOKEN),S(t,e.USERNAME),S(t,e.PASSWORD),S(t,e.HEADERS)]),a=Object.entries(Object.assign(Object.assign({Accept:"application/json"},i),t.headers)).filter((([e,t])=>c(t))).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:String(r)})),{});if(_(r)&&(a.Authorization=`Bearer ${r}`),_(o)&&_(s)){const e=(e=>{try{return btoa(e)}catch(t){return Buffer.from(e).toString("base64")}})(`${o}:${s}`);a.Authorization=`Basic ${e}`}return void 0!==t.body&&(t.mediaType?a["Content-Type"]=t.mediaType:m(t.body)?a["Content-Type"]=t.body.type||"application/octet-stream":E(t.body)?a["Content-Type"]="text/plain":R(t.body)||(a["Content-Type"]="application/json")),new Headers(a)},y=(e,r)=>new h((async(o,s,i)=>{try{const s=((e,t)=>{const r=e.ENCODE_PATH||encodeURI,o=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,((e,o)=>{var s;return(null===(s=t.path)||void 0===s?void 0:s.hasOwnProperty(o))?r(String(t.path[o])):e})),s=`${e.BASE}${o}`;return t.query?`${s}${T(t.query)}`:s})(e,r),a=(e=>{if(e.formData){const t=new FormData,r=(e,r)=>{E(r)||m(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter((([e,t])=>c(t))).forEach((([e,t])=>{Array.isArray(t)?t.forEach((t=>r(e,t))):r(e,t)})),t}})(r),n=(e=>{var t;if(void 0!==e.body)return(null===(t=e.mediaType)||void 0===t?void 0:t.includes("/json"))?JSON.stringify(e.body):E(e.body)||m(e.body)||R(e.body)?e.body:JSON.stringify(e.body)})(r),d=await A(e,r);if(!i.isCancelled){const u=await(async(e,t,r,o,s,i,a)=>{const n=new AbortController,d={headers:i,body:null!=o?o:s,method:t.method,signal:n.signal};return e.WITH_CREDENTIALS&&(d.credentials=e.CREDENTIALS),a((()=>n.abort())),await fetch(r,d)})(e,r,s,n,a,d,i),p=await(async e=>{if(204!==e.status)try{const t=e.headers.get("Content-Type");if(t)return["application/json","application/problem+json"].some((e=>t.toLowerCase().startsWith(e)))?await e.json():await e.text()}catch(e){console.error(e)}})(u),l=((e,t)=>{if(t){const r=e.headers.get(t);if(E(r))return r}})(u,r.responseHeader),h={url:s,ok:u.ok,status:u.status,statusText:u.statusText,body:null!=l?l:p};((e,r)=>{var o,s;const i=Object.assign({400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"},e.errors)[r.status];if(i)throw new t(e,r,i);if(!r.ok){const i=null!==(o=r.status)&&void 0!==o?o:"unknown",a=null!==(s=r.statusText)&&void 0!==s?s:"unknown",n=(()=>{try{return JSON.stringify(r.body,null,2)}catch(e){return}})();throw new t(e,r,`Generic Error: status: ${i}; status text: ${a}; body: ${n}`)}})(r,h),o(h.body)}}catch(e){s(e)}}));class g extends e{constructor(e){super(e)}request(e){return y(this.config,e)}}class f{constructor(e){this.httpRequest=e}getApprovalSheets(e,t){return this.httpRequest.request({method:"GET",url:"/v2/approval-sheets",headers:{"X-PF-Store-Id":e},query:{order_id:t},errors:{401:"Unauthorized"}})}}class I{constructor(e){this.httpRequest=e}getProducts(e,t,r=20,o=!1,s,i,a="worldwide",n="descending",d,u,p,l){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products",headers:{"X-PF-Language":l},query:{category_ids:e,colors:t,limit:r,new:o,offset:s,placements:i,selling_region_name:a,sort_direction:n,sort_type:d,techniques:u,destination_country:p},errors:{401:"Unauthorized"}})}getProductById(e,t="worldwide",r){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}",path:{id:e},headers:{"X-PF-Language":r},query:{selling_region_name:t},errors:{401:"Unauthorized"}})}getVariantById(e,t){return this.httpRequest.request({method:"GET",url:"/v2/catalog-variants/{id}",path:{id:e},headers:{"X-PF-Language":t},errors:{401:"Unauthorized"}})}getProductVariantsById(e,t){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/catalog-variants",path:{id:e},headers:{"X-PF-Language":t},errors:{401:"Unauthorized"}})}getCategories(){return this.httpRequest.request({method:"GET",url:"/v2/catalog-categories",errors:{401:"Unauthorized"}})}getCategoryById(e){return this.httpRequest.request({method:"GET",url:"/v2/catalog-categories/{id}",path:{id:e},errors:{401:"Unauthorized"}})}getCategoriesByProductId(e,t="worldwide"){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/catalog-categories",path:{id:e},query:{selling_region_name:t},errors:{401:"Unauthorized"}})}getProductSizeGuideById(e,t,r){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/sizes",path:{id:e},headers:{"X-PF-Language":r},query:{unit:t},errors:{404:"Not found"}})}getProductPricesById(e,t,r,o,s){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/prices",path:{id:e},headers:{"X-PF-Language":s},query:{selling_region_name:t,currency:r,production_currency:o},errors:{404:"Not found"}})}getVariantPricesById(e,t,r,o,s){return this.httpRequest.request({method:"GET",url:"/v2/catalog-variants/{id}/prices",path:{id:e},headers:{"X-PF-Language":s},query:{selling_region_name:t,currency:r,production_currency:o},errors:{404:"Not found"}})}getProductImagesById(e,t,r,o,s){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/images",path:{id:e},headers:{"X-PF-Language":s},query:{mockup_style_ids:t,colors:r,placement:o},errors:{401:"Unauthorized"}})}getProductShippingCountriesById(e,t){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/shipping-countries",path:{id:e},headers:{"X-PF-Language":t},errors:{401:"Unauthorized"}})}getVariantImagesById(e,t,r,o){return this.httpRequest.request({method:"GET",url:"/v2/catalog-variants/{id}/images",path:{id:e},headers:{"X-PF-Language":o},query:{mockup_style_ids:t,placement:r},errors:{401:"Unauthorized"}})}retrieveMockupStylesByProductId(e,t,r=!1,o="worldwide",s,i,a){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/mockup-styles",path:{id:e},headers:{"X-PF-Language":a},query:{placements:t,default_mockup_styles:r,selling_region_name:o,offset:s,limit:i},errors:{401:"Unauthorized",404:"Not found"}})}getMockupTemplatesByProductId(e,t,r="worldwide",o=20,s,i){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/mockup-templates",path:{id:e},headers:{"X-PF-Language":i},query:{placements:t,selling_region_name:r,limit:o,offset:s},errors:{401:"Unauthorized"}})}getProductStockAvailabilityById(e,t,r="worldwide",o=20,s,i){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/availability",path:{id:e},headers:{"X-PF-Language":i},query:{techniques:t,selling_region_name:r,limit:o,offset:s},errors:{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not found"}})}getVariantStockAvailabilityById(e,t,r="worldwide",o){return this.httpRequest.request({method:"GET",url:"/v2/catalog-variants/{id}/availability",path:{id:e},headers:{"X-PF-Language":o},query:{techniques:t,selling_region_name:r},errors:{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not found"}})}}class v{constructor(e){this.httpRequest=e}getCountries(e,t=20){return this.httpRequest.request({method:"GET",url:"/v2/countries",query:{offset:e,limit:t},errors:{400:"Bad Request"}})}}class O{constructor(e){this.httpRequest=e}addFile(e,t){return this.httpRequest.request({method:"POST",url:"/v2/files",headers:{"X-PF-Store-Id":t},body:e,mediaType:"application/json",errors:{400:"Bad Request",404:"Not found"}})}getFileById(e){return this.httpRequest.request({method:"GET",url:"/v2/files/{id}",path:{id:e},errors:{400:"Bad Request",404:"Not found"}})}}class C{constructor(e){this.httpRequest=e}createMockupGeneratorTasks(e,t){return this.httpRequest.request({method:"POST",url:"/v2/mockup-tasks",headers:{"X-PF-Store-Id":e},body:t,mediaType:"application/json",errors:{400:"Bad Request",401:"Unauthorized",404:"Not found"}})}getMockupGeneratorTasks(e,t=20,r){return this.httpRequest.request({method:"GET",url:"/v2/mockup-tasks",query:{id:e,limit:t,offset:r},errors:{400:"Bad Request",401:"Unauthorized",404:"Not found"}})}}class q{constructor(e){this.httpRequest=e}getOAuthScopes(){return this.httpRequest.request({method:"GET",url:"/v2/oauth-scopes",errors:{401:"Unauthorized"}})}}class N{constructor(e){this.httpRequest=e}getOrders(e=20,t,r){return this.httpRequest.request({method:"GET",url:"/v2/orders",headers:{"X-PF-Store-Id":r},query:{limit:e,offset:t},errors:{401:"Unauthorized"}})}createOrder(e,t){return this.httpRequest.request({method:"POST",url:"/v2/orders",headers:{"X-PF-Store-Id":e},body:t,mediaType:"application/json",errors:{400:"Bad Request"}})}getOrder(e,t){return this.httpRequest.request({method:"GET",url:"/v2/orders/{order_id}",path:{order_id:e},headers:{"X-PF-Store-Id":t},errors:{401:"Unauthorized",404:"Not found"}})}deleteOrder(e,t){return this.httpRequest.request({method:"DELETE",url:"/v2/orders/{order_id}",path:{order_id:e},headers:{"X-PF-Store-Id":t},errors:{401:"Unauthorized",404:"Not found",409:"Conflict"}})}updateOrder(e,t,r){return this.httpRequest.request({method:"PATCH",url:"/v2/orders/{order_id}",path:{order_id:e},headers:{"X-PF-Store-Id":t},body:r,mediaType:"application/json",errors:{400:"Bad Request"}})}confirmOrder(e,t){return this.httpRequest.request({method:"POST",url:"/v2/orders/{order_id}/confirmation",path:{order_id:e},headers:{"X-PF-Store-Id":t},errors:{401:"Unauthorized"}})}getItemsByOrderId(e,t,r=20,o,s){return this.httpRequest.request({method:"GET",url:"/v2/orders/{order_id}/order-items",path:{order_id:e},headers:{"X-PF-Store-Id":s},query:{type:t,limit:r,offset:o},errors:{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not found"}})}createItemByOrderId(e,t,r){return this.httpRequest.request({method:"POST",url:"/v2/orders/{order_id}/order-items",path:{order_id:e},headers:{"X-PF-Store-Id":r},body:t,mediaType:"application/json",errors:{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not found"}})}getItemById(e,t,r){return this.httpRequest.request({method:"GET",url:"/v2/orders/{order_id}/order-items/{order_item_id}",path:{order_item_id:e,order_id:t},headers:{"X-PF-Store-Id":r},errors:{401:"Unauthorized"}})}updateItem(e,t,r,o){return this.httpRequest.request({method:"PATCH",url:"/v2/orders/{order_id}/order-items/{order_item_id}",path:{order_item_id:e,order_id:t},headers:{"X-PF-Store-Id":o},body:r,mediaType:"application/json",errors:{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not found"}})}deleteItemById(e,t,r){return this.httpRequest.request({method:"DELETE",url:"/v2/orders/{order_id}/order-items/{order_item_id}",path:{order_item_id:e,order_id:t},headers:{"X-PF-Store-Id":r},errors:{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not found"}})}getShipments(e,t,r=20,o){return this.httpRequest.request({method:"GET",url:"/v2/orders/{order_id}/shipments",path:{order_id:e},headers:{"X-PF-Store-Id":t},query:{limit:r,offset:o},errors:{401:"Unauthorized"}})}getInvoiceByOrderId(e,t){return this.httpRequest.request({method:"GET",url:"/v2/orders/{order_id}/invoices",path:{order_id:e},headers:{"X-PF-Store-Id":t},errors:{401:"Unauthorized"}})}getOrderEstimationTask(e,t){return this.httpRequest.request({method:"GET",url:"/v2/order-estimation-tasks",headers:{"X-PF-Store-Id":t},query:{id:e},errors:{401:"Unauthorized",404:"Not found"}})}createOrderEstimationTask(e,t){return this.httpRequest.request({method:"POST",url:"/v2/order-estimation-tasks",headers:{"X-PF-Store-Id":e},body:t,mediaType:"application/json",errors:{400:"Bad Request"}})}}class x{constructor(e){this.httpRequest=e}calculateShppingRates(e,t,r){return this.httpRequest.request({method:"POST",url:"/v2/shipping-rates",headers:{"X-PF-Store-Id":e,"X-PF-Language":t},body:r,mediaType:"application/json",errors:{400:"Bad Request"}})}}class P{constructor(e){this.httpRequest=e}getStoreById(e,t){return this.httpRequest.request({method:"GET",url:"/v2/stores/{store_id}",path:{store_id:e},headers:{"X-PF-Store-Id":t},errors:{401:"Unauthorized",404:"Not found"}})}getStores(e){return this.httpRequest.request({method:"GET",url:"/v2/stores",headers:{"X-PF-Store-Id":e},errors:{401:"Unauthorized",404:"Not found"}})}getReports(e,t,r,o,s){return this.httpRequest.request({method:"GET",url:"/v2/stores/{store_id}/statistics",path:{store_id:e},query:{date_from:t,date_to:r,currency:s,report_types:o},errors:{400:"Bad Request",401:"Unauthorized",404:"Not found"}})}}class D{constructor(e){this.httpRequest=e}getWarehouseProducts(e,t,r=20,o){return this.httpRequest.request({method:"GET",url:"/v2/warehouse-products",headers:{"X-PF-Store-Id":t},query:{"filter[name*]":e,limit:r,offset:o},errors:{401:"Unauthorized"}})}getWarehouseProductById(e,t){return this.httpRequest.request({method:"GET",url:"/v2/warehouse-products/{warehouse_product_id}",path:{warehouse_product_id:e},headers:{"X-PF-Store-Id":t},errors:{401:"Unauthorized",404:"Not found"}})}}class b{constructor(e){this.httpRequest=e}getWebhooks(e,t){return this.httpRequest.request({method:"GET",url:"/v2/webhooks",headers:{"X-PF-Store-Id":e},query:{show_expired:t},errors:{401:"Unauthorized"}})}createWebhook(e,t){return this.httpRequest.request({method:"POST",url:"/v2/webhooks",headers:{"X-PF-Store-Id":t},body:e,mediaType:"application/json",errors:{400:"Bad Request",401:"Unauthorized"}})}disableWebhook(e){return this.httpRequest.request({method:"DELETE",url:"/v2/webhooks",headers:{"X-PF-Store-Id":e},errors:{401:"Unauthorized",404:"Not found"}})}getWebhookEventConfiguration(e,t,r){return this.httpRequest.request({method:"GET",url:"/v2/webhooks/{eventType}",path:{eventType:e},headers:{"X-PF-Store-Id":t},query:{show_expired:r},errors:{401:"Unauthorized"}})}createWebhookEventConfiguration(e,t,r){return this.httpRequest.request({method:"POST",url:"/v2/webhooks/{eventType}",path:{eventType:e},headers:{"X-PF-Store-Id":r},body:t,mediaType:"application/json",errors:{400:"Bad Request",401:"Unauthorized"}})}disableWebhookEvent(e,t){return this.httpRequest.request({method:"DELETE",url:"/v2/webhooks/{eventType}",path:{eventType:e},headers:{"X-PF-Store-Id":t},errors:{401:"Unauthorized",404:"Not found"}})}}const L={BASE:"https://api.printful.com",VERSION:"2.0.0-beta",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var w,U,F,k,B,G,V,M,W,z,X,H,K,j,Y,$,Z,J,Q,ee,te,re,oe,se,ie,ae,ne,de,ue,pe,le,he,ce,Ee,_e,me,Re,Te,Se,Ae,ye,ge,fe,Ie,ve,Oe,Ce,qe,Ne,xe,Pe,De,be,Le,we,Ue,Fe;exports.AddFile=void 0,w=exports.AddFile||(exports.AddFile={}),(U=w.role||(w.role={})).PRINTFILE="printfile",U.LABEL="label",U.PREVIEW="preview",exports.ApprovalSheet=void 0,F=exports.ApprovalSheet||(exports.ApprovalSheet={}),(k=F.status||(F.status={})).WAITING_FOR_ACTION="waiting_for_action",k.APPROVAL_PENDING="approval_pending",k.APPROVED="approved",k.CHANGES_REQUESTED="changes_requested",k.FILES_CHANGED="files_changed",exports.CalculationStatus=void 0,(B=exports.CalculationStatus||(exports.CalculationStatus={})).DONE="done",B.CALCULATING="calculating",B.FAILED="failed",exports.CatalogItem=void 0,((G=exports.CatalogItem||(exports.CatalogItem={})).source||(G.source={})).CATALOG="catalog",exports.CatalogItemReadonly=void 0,((V=exports.CatalogItemReadonly||(exports.CatalogItemReadonly={})).source||(V.source={})).CATALOG="catalog",exports.CatalogItemSummary=void 0,M=exports.CatalogItemSummary||(exports.CatalogItemSummary={}),(W=M.type||(M.type={})).ORDER_ITEM="order_item",W.BRANDING_ITEM="branding_item",(M.source||(M.source={})).CATALOG="catalog",exports.CatalogShippingRateItem=void 0,((z=exports.CatalogShippingRateItem||(exports.CatalogShippingRateItem={})).source||(z.source={})).CATALOG="catalog",exports.CustomBorderColorOption=void 0,((X=exports.CustomBorderColorOption||(exports.CustomBorderColorOption={})).name||(X.name={})).CUSTOM_BORDER_COLOR="custom_border_color",exports.dPuffOption=void 0,((H=exports.dPuffOption||(exports.dPuffOption={})).name||(H.name={}))._3D_PUFF="3d_puff",exports.File=void 0,function(e){e.WAITING="waiting",e.OK="ok",e.FAILED="failed",e.DELETED="deleted"}((K=exports.File||(exports.File={})).status||(K.status={})),exports.InsideLabelTypeOption=void 0,((j=exports.InsideLabelTypeOption||(exports.InsideLabelTypeOption={})).name||(j.name={})).INSIDE_LABEL_TYPE="inside_label_type",(Y=j.value||(j.value={})).NATIVE="native",Y.CUSTOM="custom",exports.InsidePocketOption=void 0,(($=exports.InsidePocketOption||(exports.InsidePocketOption={})).name||($.name={})).INSIDE_POCKET="inside_pocket",exports.Item=void 0,Z=exports.Item||(exports.Item={}),(J=Z.orientation||(Z.orientation={})).HORIZONTAL="horizontal",J.VERTICAL="vertical",J.ANY="any",exports.KnitwearBaseColor=void 0,((Q=exports.KnitwearBaseColor||(exports.KnitwearBaseColor={})).name||(Q.name={})).BASE_COLOR="base_color",exports.KnitwearColorReductionMode=void 0,((ee=exports.KnitwearColorReductionMode||(exports.KnitwearColorReductionMode={})).name||(ee.name={})).COLOR_REDUCTION_MODE="color_reduction_mode",function(e){e.SOLID="solid",e.PIXELATED="pixelated"}(ee.value||(ee.value={})),exports.KnitwearOptionValue=void 0,(te=exports.KnitwearOptionValue||(exports.KnitwearOptionValue={}))._090909="#090909",te._404040="#404040",te._563C33="#563c33",te._D52213="#d52213",te._6E5242="#6e5242",te._7F6A53="#7f6a53",te._CD5E38="#cd5e38",te._B57648="#b57648",te._D1773B="#d1773b",te._D68785="#d68785",te._C6B5A7="#c6b5a7",te._D6C6B4="#d6c6b4",te._DCD3CC="#dcd3cc",te._EDD9D9="#edd9d9",te._E2DFDC="#e2dfdc",te._FDFAFA="#fdfafa",te._999996="#999996",te._DDA032="#dda032",te._D1C6AE="#d1c6ae",te._EDDEA4="#eddea4",te._48542E="#48542e",te._6E8C4B="#6e8c4b",te._C0C1BD="#c0c1bd",te._243F33="#243f33",te._C5D1D0="#c5d1d0",te._175387="#175387",te._237D96="#237d96",te._787979="#787979",te._343D55="#343d55",te._4E59BE="#4e59be",te._566E99="#566e99",te._504372="#504372",te._4C1C29="#4c1c29",te._F66274="#f66274",te._EDA6B4="#eda6b4",te._DDABC8="#ddabc8",exports.KnitwearTrimColor=void 0,((re=exports.KnitwearTrimColor||(exports.KnitwearTrimColor={})).name||(re.name={})).TRIM_COLOR="trim_color",exports.KnitwearYarnColor=void 0,((oe=exports.KnitwearYarnColor||(exports.KnitwearYarnColor={})).name||(oe.name={})).YARN_COLORS="yarn_colors",exports.LifelikeOption=void 0,((se=exports.LifelikeOption||(exports.LifelikeOption={})).name||(se.name={})).LIFELIKE="lifelike",exports.MockupGeneratorTask=void 0,function(e){e.COMPLETED="completed",e.PENDING="pending",e.FAILED="failed"}((ie=exports.MockupGeneratorTask||(exports.MockupGeneratorTask={})).status||(ie.status={})),exports.MockupStyles=void 0,ae=exports.MockupStyles||(exports.MockupStyles={}),(ne=ae.print_area_type||(ae.print_area_type={})).SIMPLE="simple",ne.ADVANCED="advanced",exports.MockupTaskCreation=void 0,de=exports.MockupTaskCreation||(exports.MockupTaskCreation={}),(ue=de.format||(de.format={})).JPG="jpg",ue.PNG="png",exports.MockupTemplates=void 0,pe=exports.MockupTemplates||(exports.MockupTemplates={}),(le=pe.template_positioning||(pe.template_positioning={})).OVERLAY="overlay",le.BACKGROUND="background",function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.ANY="any"}(pe.orientation||(pe.orientation={})),(he=pe.template_type||(pe.template_type={})).CUSTOM="custom",he.NATIVE="native",he.COLOR_GROUP="color_group",he.ADVANCED="advanced",function(e){e.PRIMARY="primary",e.TEMPLATE="template",e.EXTRA="extra",e.UNKNOWN="unknown",e.ADVANCED_TEMPLATE="advanced_template"}(pe.role||(pe.role={})),exports.NotesOption=void 0,((ce=exports.NotesOption||(exports.NotesOption={})).name||(ce.name={})).NOTES="notes",exports.OAuthScope=void 0,Ee=exports.OAuthScope||(exports.OAuthScope={}),(_e=Ee.name||(Ee.name={})).VIEW_ORDERS_OF_THE_AUTHORIZED_STORE="View orders of the authorized store",_e.VIEW_AND_MANAGE_ORDERS_OF_THE_AUTHORIZED_STORE="View and manage orders of the authorized store",_e.VIEW_STORE_PRODUCTS="View store products",_e.VIEW_AND_MANAGE_STORE_PRODUCTS="View and manage store products",_e.VIEW_STORE_FILES="View store files",_e.VIEW_AND_MANAGE_STORE_FILES="View and manage store files",_e.VIEW_STORE_WEBHOOKS="View store webhooks",_e.VIEW_AND_MANAGE_STORE_WEBHOOKS="View and manage store webhooks",function(e){e.ORDERS_READ="orders/read",e.ORDERS="orders",e.SYNC_PRODUCTS_READ="sync_products/read",e.SYNC_PRODUCTS="sync_products",e.FILE_LIBRARY_READ="file_library/read",e.FILE_LIBRARY="file_library",e.WEBHOOKS_READ="webhooks/read"}(Ee.value||(Ee.value={})),exports.Placement_2=void 0,function(e){e.SIMPLE="simple",e.ADVANCED="advanced"}((me=exports.Placement_2||(exports.Placement_2={})).print_area_type||(me.print_area_type={})),exports.ProductTemplateItem=void 0,((Re=exports.ProductTemplateItem||(exports.ProductTemplateItem={})).source||(Re.source={})).PRODUCT_TEMPLATE="product_template",exports.ReportTypes=void 0,(Te=exports.ReportTypes||(exports.ReportTypes={})).SALES_AND_COSTS="sales_and_costs",Te.PROFIT="profit",Te.AVERAGE_FULFILLMENT_TYPE="average_fulfillment_type",Te.COSTS_BY_AMOUNT="costs_by_amount",Te.COSTS_BY_PRODUCT="costs_by_product",Te.COSTS_BY_VARIANT="costs_by_variant",Te.PRINTFUL_COSTS="printful_costs",Te.SALES_AND_COSTS_SUMMARY="sales_and_costs_summary",Te.TOTAL_PAID_ORDERS="total_paid_orders",exports.SellingRegion=void 0,(Se=exports.SellingRegion||(exports.SellingRegion={})).WORLDWIDE="worldwide",Se.NORTH_AMERICA="north_america",Se.CANADA="canada",Se.EUROPE="europe",Se.SPAIN="spain",Se.LATVIA="latvia",Se.UK="uk",Se.FRANCE="france",Se.GERMANY="germany",Se.AUSTRALIA="australia",Se.JAPAN="japan",Se.NEW_ZEALAND="new_zealand",Se.ITALY="italy",Se.BRAZIL="brazil",Se.SOUTHEAST_ASIA="southeast_asia",Se.REPUBLIC_OF_KOREA="republic_of_korea",Se.ALL="all",exports.SellingRegionAll=void 0,(Ae=exports.SellingRegionAll||(exports.SellingRegionAll={})).WORLDWIDE="worldwide",Ae.NORTH_AMERICA="north_america",Ae.CANADA="canada",Ae.EUROPE="europe",Ae.SPAIN="spain",Ae.LATVIA="latvia",Ae.UK="uk",Ae.FRANCE="france",Ae.GERMANY="germany",Ae.AUSTRALIA="australia",Ae.JAPAN="japan",Ae.NEW_ZEALAND="new_zealand",Ae.ITALY="italy",Ae.BRAZIL="brazil",Ae.SOUTHEAST_ASIA="southeast_asia",Ae.REPUBLIC_OF_KOREA="republic_of_korea",Ae.ALL="all",exports.SellingRegionStockAvailability=void 0,function(e){e.WORLDWIDE="worldwide",e.NORTH_AMERICA="north_america",e.CANADA="canada",e.EUROPE="europe",e.SPAIN="spain",e.LATVIA="latvia",e.UK="uk",e.FRANCE="france",e.GERMANY="germany",e.AUSTRALIA="australia",e.JAPAN="japan",e.NEW_ZEALAND="new_zealand",e.ITALY="italy",e.BRAZIL="brazil",e.SOUTHEAST_ASIA="southeast_asia",e.REPUBLIC_OF_KOREA="republic_of_korea"}((ye=exports.SellingRegionStockAvailability||(exports.SellingRegionStockAvailability={})).name||(ye.name={})),(ge=ye.availability||(ye.availability={})).IN_STOCK="in stock",ge.OUT_OF_STOCK="out of stock",ge.NOT_FULFILLABLE="not fulfillable",ge.UNKNOWN="unknown",exports.Shipment=void 0,fe=exports.Shipment||(exports.Shipment={}),(Ie=fe.shipment_status||(fe.shipment_status={})).PENDING="pending",Ie.ONHOLD="onhold",Ie.CANCELED="canceled",Ie.PACKAGED="packaged",Ie.SHIPPED="shipped",Ie.RETURNED="returned",Ie.OUTSTOCK="outstock",(ve=fe.delivery_status||(fe.delivery_status={})).UNKNOWN="unknown",ve.DELIVERED="delivered",ve.PRE_TRANSIT="pre_transit",ve.IN_TRANSIT="in_transit",ve.OUT_FOR_DELIVERY="out_for_delivery",ve.AVAILABLE_FOR_PICKUP="available_for_pickup",ve.RETURN_TO_SENDER="return_to_sender",ve.FAILURE="failure",ve.CANCELED="canceled",exports.SizeTable=void 0,function(e){e.MEASURE_YOURSELF="measure_yourself",e.PRODUCT_MEASURE="product_measure",e.INTERNATIONAL="international"}((Oe=exports.SizeTable||(exports.SizeTable={})).type||(Oe.type={})),(Ce=Oe.unit||(Oe.unit={})).INCHES="inches",Ce.CM="cm",exports.SortDirection=void 0,(qe=exports.SortDirection||(exports.SortDirection={})).ASCENDING="ascending",qe.DESCENDING="descending",exports.SortType=void 0,(Ne=exports.SortType||(exports.SortType={})).NEW="new",Ne.RATING="rating",Ne.PRICE="price",Ne.BESTSELLER="bestseller",exports.StitchColorOption=void 0,function(e){e.STITCH_COLOR="stitch_color"}((xe=exports.StitchColorOption||(exports.StitchColorOption={})).name||(xe.name={})),exports.TaskSummary=void 0,function(e){e.PENDING="pending",e.FAILED="failed",e.COMPLETED="completed"}((Pe=exports.TaskSummary||(exports.TaskSummary={})).status||(Pe.status={})),exports.TechniqueEnum=void 0,(De=exports.TechniqueEnum||(exports.TechniqueEnum={})).DTG="dtg",De.DIGITAL="digital",De.CUT_SEW="cut-sew",De.UV="uv",De.EMBROIDERY="embroidery",De.SUBLIMATION="sublimation",De.DTFILM="dtfilm",exports.ThreadColorsOption=void 0,function(e){e.THREAD_COLORS="thread_colors"}((be=exports.ThreadColorsOption||(exports.ThreadColorsOption={})).name||(be.name={})),exports.UnlimitedColorOption=void 0,function(e){e.UNLIMITED_COLOR="unlimited_color"}((Le=exports.UnlimitedColorOption||(exports.UnlimitedColorOption={})).name||(Le.name={})),exports.WarehouseItemReadonly=void 0,((we=exports.WarehouseItemReadonly||(exports.WarehouseItemReadonly={})).source||(we.source={})).WAREHOUSE="warehouse",exports.WarehouseItemSummary=void 0,function(e){e.ORDER_ITEM="order_item",e.BRANDING_ITEM="branding_item"}((Ue=exports.WarehouseItemSummary||(exports.WarehouseItemSummary={})).type||(Ue.type={})),(Ue.source||(Ue.source={})).WAREHOUSE="warehouse",exports.WarehouseShippingRateItem=void 0,((Fe=exports.WarehouseShippingRateItem||(exports.WarehouseShippingRateItem={})).source||(Fe.source={})).CATALOG="catalog",exports.ApiError=t,exports.ApprovalSheetsV2Service=f,exports.BaseHttpRequest=e,exports.CancelError=l,exports.CancelablePromise=h,exports.CatalogV2Service=I,exports.CountriesV2Service=v,exports.FilesV2Service=O,exports.MockupGeneratorV2Service=C,exports.OAuthScopesV2Service=q,exports.OpenAPI=L,exports.OrdersV2Service=N,exports.PrintfulClient=class{constructor(e,t=g){var r,o,s,i;this.request=new t({BASE:null!==(r=null==e?void 0:e.BASE)&&void 0!==r?r:"https://api.printful.com",VERSION:null!==(o=null==e?void 0:e.VERSION)&&void 0!==o?o:"2.0.0-beta",WITH_CREDENTIALS:null!==(s=null==e?void 0:e.WITH_CREDENTIALS)&&void 0!==s&&s,CREDENTIALS:null!==(i=null==e?void 0:e.CREDENTIALS)&&void 0!==i?i:"include",TOKEN:null==e?void 0:e.TOKEN,USERNAME:null==e?void 0:e.USERNAME,PASSWORD:null==e?void 0:e.PASSWORD,HEADERS:null==e?void 0:e.HEADERS,ENCODE_PATH:null==e?void 0:e.ENCODE_PATH}),this.approvalSheetsV2=new f(this.request),this.catalogV2=new I(this.request),this.countriesV2=new v(this.request),this.filesV2=new O(this.request),this.mockupGeneratorV2=new C(this.request),this.oAuthScopesV2=new q(this.request),this.ordersV2=new N(this.request),this.shippingRatesV2=new x(this.request),this.storesV2=new P(this.request),this.warehouseProductsV2=new D(this.request),this.webhookV2=new b(this.request)}},exports.ShippingRatesV2Service=x,exports.StoresV2Service=P,exports.WarehouseProductsV2Service=D,exports.WebhookV2Service=b;
//# sourceMappingURL=index.cjs.js.map