UNPKG

@shopify/shopify-app-remix

Version:

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

1 lines 1.3 kB
{"version":3,"file":"revoke-scopes.mjs","sources":["../../../../../../../../src/server/authenticate/admin/scope/client/revoke-scopes.ts"],"sourcesContent":["import {AdminApiContext} from '../../../../clients';\n\nexport interface RevokeScopesResponse {\n revoked: {\n handle: string;\n }[];\n userErrors: {\n field: string;\n message: string;\n }[];\n}\n\nconst REVOKE_SCOPE_MUTATION = `#graphql\nmutation AppRevokeAccessScopes($scopes: [String!]!) {\n appRevokeAccessScopes(scopes: $scopes){\n revoked {\n handle\n }\n userErrors {\n field\n message\n }\n }\n}`;\n\nexport async function revokeScopes(\n admin: AdminApiContext,\n scopes: string[],\n): Promise<RevokeScopesResponse> {\n const revokeScopesResult = await admin.graphql(REVOKE_SCOPE_MUTATION, {\n variables: {\n scopes,\n },\n });\n\n const resultContent = await revokeScopesResult.json();\n return resultContent.data.appRevokeAccessScopes;\n}\n"],"names":[],"mappings":"AAYA,MAAM,qBAAqB,GAAG,CAAA;;;;;;;;;;;EAW5B;AAEK,eAAe,YAAY,CAChC,KAAsB,EACtB,MAAgB,EAAA;IAEhB,MAAM,kBAAkB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE;AACpE,QAAA,SAAS,EAAE;YACT,MAAM;AACP,SAAA;AACF,KAAA,CAAC;AAEF,IAAA,MAAM,aAAa,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE;AACrD,IAAA,OAAO,aAAa,CAAC,IAAI,CAAC,qBAAqB;AACjD;;;;"}