UNPKG

printful-sdk-js-v2

Version:

Printful SDK for Node.js / TypeScript. A wrapper for the Printful REST API (v2)

3 lines (2 loc) 27.1 kB
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,a,i,n,d,u,h;"function"==typeof SuppressedError&&SuppressedError;class c extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}}class l{constructor(e){s.set(this,void 0),a.set(this,void 0),i.set(this,void 0),n.set(this,void 0),d.set(this,void 0),u.set(this,void 0),h.set(this,void 0),o(this,s,!1,"f"),o(this,a,!1,"f"),o(this,i,!1,"f"),o(this,n,[],"f"),o(this,d,new Promise(((t,d)=>{o(this,u,t,"f"),o(this,h,d,"f");const c=e=>{r(this,s,"f")||r(this,a,"f")||r(this,i,"f")||r(this,n,"f").push(e)};return Object.defineProperty(c,"isResolved",{get:()=>r(this,s,"f")}),Object.defineProperty(c,"isRejected",{get:()=>r(this,a,"f")}),Object.defineProperty(c,"isCancelled",{get:()=>r(this,i,"f")}),e((e=>{r(this,s,"f")||r(this,a,"f")||r(this,i,"f")||(o(this,s,!0,"f"),r(this,u,"f")&&r(this,u,"f").call(this,e))}),(e=>{r(this,s,"f")||r(this,a,"f")||r(this,i,"f")||(o(this,a,!0,"f"),r(this,h,"f")&&r(this,h,"f").call(this,e))}),c)})),"f")}get[(s=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakMap,d=new WeakMap,u=new WeakMap,h=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,a,"f")||r(this,i,"f"))){if(o(this,i,!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,h,"f")&&r(this,h,"f").call(this,new c("Request aborted"))}}get isCancelled(){return r(this,i,"f")}}const p=e=>null!=e,E=e=>"string"==typeof e,_=e=>E(e)&&""!==e,f=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,m=e=>{const t=[],r=(e,o)=>{p(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("&")}`:""},A=async(e,t)=>"function"==typeof t?t(e):t,T=async(e,t)=>{const[r,o,s,a]=await Promise.all([A(t,e.TOKEN),A(t,e.USERNAME),A(t,e.PASSWORD),A(t,e.HEADERS)]),i=Object.entries(Object.assign(Object.assign({Accept:"application/json"},a),t.headers)).filter((([e,t])=>p(t))).reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:String(r)})),{});if(_(r)&&(i.Authorization=`Bearer ${r}`),_(o)&&_(s)){const e=(e=>{try{return btoa(e)}catch(t){return Buffer.from(e).toString("base64")}})(`${o}:${s}`);i.Authorization=`Basic ${e}`}return void 0!==t.body&&(t.mediaType?i["Content-Type"]=t.mediaType:f(t.body)?i["Content-Type"]=t.body.type||"application/octet-stream":E(t.body)?i["Content-Type"]="text/plain":R(t.body)||(i["Content-Type"]="application/json")),new Headers(i)},I=(e,r)=>new l((async(o,s,a)=>{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}${m(t.query)}`:s})(e,r),i=(e=>{if(e.formData){const t=new FormData,r=(e,r)=>{E(r)||f(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter((([e,t])=>p(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)||f(e.body)||R(e.body)?e.body:JSON.stringify(e.body)})(r),d=await T(e,r);if(!a.isCancelled){const u=await(async(e,t,r,o,s,a,i)=>{const n=new AbortController,d={headers:a,body:null!=o?o:s,method:t.method,signal:n.signal};return e.WITH_CREDENTIALS&&(d.credentials=e.CREDENTIALS),i((()=>n.abort())),await fetch(r,d)})(e,r,s,n,i,d,a),h=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),c=((e,t)=>{if(t){const r=e.headers.get(t);if(E(r))return r}})(u,r.responseHeader),l={url:s,ok:u.ok,status:u.status,statusText:u.statusText,body:null!=c?c:h};((e,r)=>{var o,s;const a=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(a)throw new t(e,r,a);if(!r.ok){const a=null!==(o=r.status)&&void 0!==o?o:"unknown",i=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: ${a}; status text: ${i}; body: ${n}`)}})(r,l),o(l.body)}}catch(e){s(e)}}));class y extends e{constructor(e){super(e)}request(e){return I(this.config,e)}}class g{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 S{constructor(e){this.httpRequest=e}getProducts(e,t,r=20,o=!1,s,a,i="worldwide",n="descending",d,u,h){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products",headers:{"X-PF-Language":h},query:{category_ids:e,colors:t,limit:r,new:o,offset:s,placements:a,selling_region_name:i,sort_direction:n,sort_type:d,techniques:u},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){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/prices",path:{id:e},headers:{"X-PF-Language":o},query:{selling_region_name:t,currency:r},errors:{404:"Not found"}})}getVariantPricesById(e,t,r,o){return this.httpRequest.request({method:"GET",url:"/v2/catalog-variants/{id}/prices",path:{id:e},headers:{"X-PF-Language":o},query:{selling_region_name:t,currency:r},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"}})}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="worldwide",o,s,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,selling_region_name:r,offset:o,limit:s},errors:{401:"Unauthorized",404:"Not found"}})}getMockupTemplatesByProductId(e,t,r="worldwide",o=20,s,a){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/mockup-templates",path:{id:e},headers:{"X-PF-Language":a},query:{placements:t,selling_region_name:r,limit:o,offset:s},errors:{401:"Unauthorized"}})}getProductStockAvailabilityById(e,t,r="worldwide",o=20,s,a){return this.httpRequest.request({method:"GET",url:"/v2/catalog-products/{id}/availability",path:{id:e},headers:{"X-PF-Language":a},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 O{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 q{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 v{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 N{constructor(e){this.httpRequest=e}getOAuthScopes(){return this.httpRequest.request({method:"GET",url:"/v2/oauth-scopes",errors:{401:"Unauthorized"}})}}class D{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 P{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 L{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 b{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 C{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"}})}}class w{constructor(e,t=y){var r,o,s,a;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!==(a=null==e?void 0:e.CREDENTIALS)&&void 0!==a?a:"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 g(this.request),this.catalogV2=new S(this.request),this.countriesV2=new O(this.request),this.filesV2=new q(this.request),this.mockupGeneratorV2=new v(this.request),this.oAuthScopesV2=new N(this.request),this.ordersV2=new D(this.request),this.shippingRatesV2=new P(this.request),this.storesV2=new L(this.request),this.warehouseProductsV2=new b(this.request),this.webhookV2=new C(this.request)}}const U={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 F,B,G,k,z,V,W,M,X,H,j,K,Y,$,x,Z,J,Q,ee,te,re,oe,se,ae,ie,ne,de,ue,he,ce,le,pe,Ee,_e,fe,Re,me,Ae,Te,Ie,ye;!function(e){var t;(t=e.role||(e.role={})).PRINTFILE="printfile",t.LABEL="label",t.PREVIEW="preview"}(F||(F={})),function(e){var t;(t=e.status||(e.status={})).WAITING_FOR_ACTION="waiting_for_action",t.APPROVAL_PENDING="approval_pending",t.APPROVED="approved",t.CHANGES_REQUESTED="changes_requested",t.FILES_CHANGED="files_changed"}(B||(B={})),function(e){e.DONE="done",e.CALCULATING="calculating",e.FAILED="failed"}(G||(G={})),function(e){(e.source||(e.source={})).CATALOG="catalog"}(k||(k={})),function(e){(e.source||(e.source={})).CATALOG="catalog"}(z||(z={})),function(e){var t;(t=e.type||(e.type={})).ORDER_ITEM="order_item",t.BRANDING_ITEM="branding_item",(e.source||(e.source={})).CATALOG="catalog"}(V||(V={})),function(e){(e.source||(e.source={})).CATALOG="catalog"}(W||(W={})),function(e){(e.name||(e.name={})).CUSTOM_BORDER_COLOR="custom_border_color"}(M||(M={})),function(e){(e.name||(e.name={}))._3D_PUFF="3d_puff"}(X||(X={})),function(e){var t;(t=e.status||(e.status={})).WAITING="waiting",t.OK="ok",t.FAILED="failed",t.DELETED="deleted"}(H||(H={})),function(e){var t;(e.name||(e.name={})).INSIDE_LABEL_TYPE="inside_label_type",(t=e.value||(e.value={})).NATIVE="native",t.CUSTOM="custom"}(j||(j={})),function(e){(e.name||(e.name={})).INSIDE_POCKET="inside_pocket"}(K||(K={})),function(e){(e.name||(e.name={})).BASE_COLOR="base_color"}(Y||(Y={})),function(e){var t;(e.name||(e.name={})).COLOR_REDUCTION_MODE="color_reduction_mode",(t=e.value||(e.value={})).SOLID="solid",t.PIXELATED="pixelated"}($||($={})),function(e){e._090909="#090909",e._404040="#404040",e._563C33="#563c33",e._D52213="#d52213",e._6E5242="#6e5242",e._7F6A53="#7f6a53",e._CD5E38="#cd5e38",e._B57648="#b57648",e._D1773B="#d1773b",e._D68785="#d68785",e._C6B5A7="#c6b5a7",e._D6C6B4="#d6c6b4",e._DCD3CC="#dcd3cc",e._EDD9D9="#edd9d9",e._E2DFDC="#e2dfdc",e._FDFAFA="#fdfafa",e._999996="#999996",e._DDA032="#dda032",e._D1C6AE="#d1c6ae",e._EDDEA4="#eddea4",e._48542E="#48542e",e._6E8C4B="#6e8c4b",e._C0C1BD="#c0c1bd",e._243F33="#243f33",e._C5D1D0="#c5d1d0",e._175387="#175387",e._237D96="#237d96",e._787979="#787979",e._343D55="#343d55",e._4E59BE="#4e59be",e._566E99="#566e99",e._504372="#504372",e._4C1C29="#4c1c29",e._F66274="#f66274",e._EDA6B4="#eda6b4",e._DDABC8="#ddabc8"}(x||(x={})),function(e){(e.name||(e.name={})).TRIM_COLOR="trim_color"}(Z||(Z={})),function(e){(e.name||(e.name={})).YARN_COLORS="yarn_colors"}(J||(J={})),function(e){(e.name||(e.name={})).LIFELIKE="lifelike"}(Q||(Q={})),function(e){var t;(t=e.status||(e.status={})).COMPLETED="completed",t.PENDING="pending",t.FAILED="failed"}(ee||(ee={})),function(e){var t;(t=e.print_area_type||(e.print_area_type={})).SIMPLE="simple",t.ADVANCED="advanced"}(te||(te={})),function(e){var t;(t=e.format||(e.format={})).JPG="jpg",t.PNG="png"}(re||(re={})),function(e){var t,r;(t=e.template_positioning||(e.template_positioning={})).OVERLAY="overlay",t.BACKGROUND="background",(r=e.orientation||(e.orientation={})).HORIZONTAL="horizontal",r.VERTICAL="vertical",r.ANY="any"}(oe||(oe={})),function(e){(e.name||(e.name={})).NOTES="notes"}(se||(se={})),function(e){var t,r;(t=e.name||(e.name={})).VIEW_ORDERS_OF_THE_AUTHORIZED_STORE="View orders of the authorized store",t.VIEW_AND_MANAGE_ORDERS_OF_THE_AUTHORIZED_STORE="View and manage orders of the authorized store",t.VIEW_STORE_PRODUCTS="View store products",t.VIEW_AND_MANAGE_STORE_PRODUCTS="View and manage store products",t.VIEW_STORE_FILES="View store files",t.VIEW_AND_MANAGE_STORE_FILES="View and manage store files",t.VIEW_STORE_WEBHOOKS="View store webhooks",t.VIEW_AND_MANAGE_STORE_WEBHOOKS="View and manage store webhooks",(r=e.value||(e.value={})).ORDERS_READ="orders/read",r.ORDERS="orders",r.SYNC_PRODUCTS_READ="sync_products/read",r.SYNC_PRODUCTS="sync_products",r.FILE_LIBRARY_READ="file_library/read",r.FILE_LIBRARY="file_library",r.WEBHOOKS_READ="webhooks/read"}(ae||(ae={})),function(e){var t,r;(t=e.print_area_type||(e.print_area_type={})).SIMPLE="simple",t.ADVANCED="advanced",(r=e.status||(e.status={})).OK="ok",r.FAILED="failed"}(ie||(ie={})),function(e){e.SALES_AND_COSTS="sales_and_costs",e.PROFIT="profit",e.AVERAGE_FULFILLMENT_TYPE="average_fulfillment_type",e.COSTS_BY_AMOUNT="costs_by_amount",e.COSTS_BY_PRODUCT="costs_by_product",e.COSTS_BY_VARIANT="costs_by_variant",e.PRINTFUL_COSTS="printful_costs",e.SALES_AND_COSTS_SUMMARY="sales_and_costs_summary",e.TOTAL_PAID_ORDERS="total_paid_orders"}(ne||(ne={})),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",e.ENGLISH_SPEAKING_REGIONS="english_speaking_regions",e.ALL="all"}(de||(de={})),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",e.ENGLISH_SPEAKING_REGIONS="english_speaking_regions",e.ALL="all"}(ue||(ue={})),function(e){var t,r;(t=e.name||(e.name={})).WORLDWIDE="worldwide",t.NORTH_AMERICA="north_america",t.CANADA="canada",t.EUROPE="europe",t.SPAIN="spain",t.LATVIA="latvia",t.UK="uk",t.FRANCE="france",t.GERMANY="germany",t.AUSTRALIA="australia",t.JAPAN="japan",t.NEW_ZEALAND="new_zealand",t.ITALY="italy",t.BRAZIL="brazil",t.SOUTHEAST_ASIA="southeast_asia",t.REPUBLIC_OF_KOREA="republic_of_korea",t.ENGLISH_SPEAKING_REGIONS="english_speaking_regions",(r=e.availability||(e.availability={})).IN_STOCK="in stock",r.OUT_OF_STOCK="out of stock",r.NOT_FULFILLABLE="not fulfillable",r.UNKNOWN="unknown"}(he||(he={})),function(e){var t,r;(t=e.shipment_status||(e.shipment_status={})).PENDING="pending",t.ONHOLD="onhold",t.CANCELED="canceled",t.PACKAGED="packaged",t.SHIPPED="shipped",t.RETURNED="returned",t.OUTSTOCK="outstock",(r=e.delivery_status||(e.delivery_status={})).UNKNOWN="unknown",r.DELIVERED="delivered",r.PRE_TRANSIT="pre_transit",r.IN_TRANSIT="in_transit",r.OUT_FOR_DELIVERY="out_for_delivery",r.AVAILABLE_FOR_PICKUP="available_for_pickup",r.RETURN_TO_SENDER="return_to_sender",r.FAILURE="failure",r.CANCELED="canceled"}(ce||(ce={})),function(e){var t,r;(t=e.type||(e.type={})).MEASURE_YOURSELF="measure_yourself",t.PRODUCT_MEASURE="product_measure",t.INTERNATIONAL="international",(r=e.unit||(e.unit={})).INCHES="inches",r.CM="cm"}(le||(le={})),function(e){e.ASCENDING="ascending",e.DESCENDING="descending"}(pe||(pe={})),function(e){e.NEW="new",e.RATING="rating",e.PRICE="price",e.BESTSELLER="bestseller"}(Ee||(Ee={})),function(e){(e.name||(e.name={})).STITCH_COLOR="stitch_color"}(_e||(_e={})),function(e){var t;(t=e.status||(e.status={})).PENDING="pending",t.FAILED="failed",t.COMPLETED="completed"}(fe||(fe={})),function(e){e.DTG="dtg",e.DIGITAL="digital",e.CUT_SEW="cut-sew",e.UV="uv",e.EMBROIDERY="embroidery",e.SUBLIMATION="sublimation",e.DTFILM="dtfilm"}(Re||(Re={})),function(e){(e.name||(e.name={})).THREAD_COLORS="thread_colors"}(me||(me={})),function(e){(e.name||(e.name={})).UNLIMITED_COLOR="unlimited_color"}(Ae||(Ae={})),function(e){(e.source||(e.source={})).WAREHOUSE="warehouse"}(Te||(Te={})),function(e){var t;(t=e.type||(e.type={})).ORDER_ITEM="order_item",t.BRANDING_ITEM="branding_item",(e.source||(e.source={})).WAREHOUSE="warehouse"}(Ie||(Ie={})),function(e){(e.source||(e.source={})).CATALOG="catalog"}(ye||(ye={}));export{F as AddFile,t as ApiError,B as ApprovalSheet,g as ApprovalSheetsV2Service,e as BaseHttpRequest,G as CalculationStatus,c as CancelError,l as CancelablePromise,k as CatalogItem,z as CatalogItemReadonly,V as CatalogItemSummary,W as CatalogShippingRateItem,S as CatalogV2Service,O as CountriesV2Service,M as CustomBorderColorOption,H as File,q as FilesV2Service,j as InsideLabelTypeOption,K as InsidePocketOption,Y as KnitwearBaseColor,$ as KnitwearColorReductionMode,x as KnitwearOptionValue,Z as KnitwearTrimColor,J as KnitwearYarnColor,Q as LifelikeOption,ee as MockupGeneratorTask,v as MockupGeneratorV2Service,te as MockupStyles,re as MockupTaskCreation,oe as MockupTemplates,se as NotesOption,ae as OAuthScope,N as OAuthScopesV2Service,U as OpenAPI,D as OrdersV2Service,ie as Placement,w as PrintfulClient,ne as ReportTypes,de as SellingRegion,ue as SellingRegionAll,he as SellingRegionStockAvailability,ce as Shipment,P as ShippingRatesV2Service,le as SizeTable,pe as SortDirection,Ee as SortType,_e as StitchColorOption,L as StoresV2Service,fe as TaskSummary,Re as TechniqueEnum,me as ThreadColorsOption,Ae as UnlimitedColorOption,Te as WarehouseItemReadonly,Ie as WarehouseItemSummary,b as WarehouseProductsV2Service,ye as WarehouseShippingRateItem,C as WebhookV2Service,X as dPuffOption}; //# sourceMappingURL=index.esm.js.map