@shopify/admin-api-client
Version:
Shopify Admin API Client - A lightweight JS client to interact with Shopify's Admin API
1 lines • 1.12 kB
Source Map (JSON)
{"version":3,"file":"validations.mjs","sources":["../src/validations.ts"],"sourcesContent":["import {CLIENT} from './constants';\n\nexport function validateRequiredStoreDomain(storeDomain: string | undefined) {\n if (\n !storeDomain ||\n typeof storeDomain !== 'string' ||\n storeDomain.trim().length < 1\n ) {\n throw new Error(`${CLIENT}: a valid store domain must be provided`);\n }\n}\n\nexport function validateRequiredAccessToken(accessToken: string) {\n if (!accessToken) {\n throw new Error(`${CLIENT}: an access token must be provided`);\n }\n}\n\nexport function validateServerSideUsage(isTesting = false) {\n if (typeof window !== 'undefined' && !isTesting) {\n throw new Error(`${CLIENT}: this client should not be used in the browser`);\n }\n}\n"],"names":[],"mappings":";;AAYM,SAAU,2BAA2B,CAAC,WAAmB,EAAA;IAC7D,IAAI,CAAC,WAAW,EAAE;AAChB,QAAA,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAA,kCAAA,CAAoC,CAAC;IAChE;AACF;AAEM,SAAU,uBAAuB,CAAC,SAAS,GAAG,KAAK,EAAA;IACvD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,SAAS,EAAE;AAC/C,QAAA,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAA,+CAAA,CAAiD,CAAC;IAC7E;AACF;;;;"}