UNPKG

@shopify/shopify-app-remix

Version:

Shopify Remix - to simplify the building of Shopify Apps with Remix

1 lines 1.32 kB
{"version":3,"file":"fetch-scopes-details.mjs","sources":["../../../../../../../../src/server/authenticate/admin/scope/client/fetch-scopes-details.ts"],"sourcesContent":["import {AdminApiContext} from '../../../../clients';\n\nexport interface FetchScopesDetailResponse {\n app: {\n requestedAccessScopes: {\n handle: string;\n }[];\n optionalAccessScopes: {\n handle: string;\n }[];\n installation: {\n accessScopes: {\n handle: string;\n }[];\n };\n };\n}\n\nconst FETCH_SCOPES_DETAIL_QUERY = `#graphql\nquery FetchAccessScopes{\n app {\n requestedAccessScopes {\n handle\n }\n optionalAccessScopes {\n handle\n }\n installation {\n accessScopes {\n handle\n }\n }\n }\n}`;\n\nexport async function fetchScopeDetail(\n admin: AdminApiContext,\n): Promise<FetchScopesDetailResponse> {\n const fetchScopeDetailResult = await admin.graphql(FETCH_SCOPES_DETAIL_QUERY);\n\n const resultContent = await fetchScopeDetailResult.json();\n return resultContent.data;\n}\n"],"names":[],"mappings":"AAkBA,MAAM,yBAAyB,GAAG,CAAA;;;;;;;;;;;;;;;EAehC;AAEK,eAAe,gBAAgB,CACpC,KAAsB,EAAA;IAEtB,MAAM,sBAAsB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAyB,CAAC;AAE7E,IAAA,MAAM,aAAa,GAAG,MAAM,sBAAsB,CAAC,IAAI,EAAE;IACzD,OAAO,aAAa,CAAC,IAAI;AAC3B;;;;"}