{"version":3,"file":"refresh.cjs","names":["refreshData: RefreshOptions"],"sources":["../../../../src/rest/commands/auth/refresh.ts"],"sourcesContent":["import type { AuthenticationData, RefreshOptions } from '../../../index.js';\nimport type { RestCommand } from '../../types.js';\n\n/**\n * Retrieve a new access token using a refresh token.\n *\n * @param options Optional refresh settings.\n *\n * @returns The new access and refresh tokens for the session.\n */\nexport const refresh =\n\t<Schema>(options: RefreshOptions = {}): RestCommand<AuthenticationData, Schema> =>\n\t() => {\n\t\tconst refreshData: RefreshOptions = {\n\t\t\tmode: options.mode ?? 'cookie',\n\t\t};\n\n\t\tif (refreshData.mode === 'json' && options.refresh_token) {\n\t\t\trefreshData['refresh_token'] = options.refresh_token;\n\t\t}\n\n\t\treturn {\n\t\t\tpath: '/auth/refresh',\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify(refreshData),\n\t\t};\n\t};\n"],"mappings":"AAUA,MAAa,GACH,EAA0B,EAAE,OAC/B,CACL,IAAMA,EAA8B,CACnC,KAAM,EAAQ,MAAQ,SACtB,CAMD,OAJI,EAAY,OAAS,QAAU,EAAQ,gBAC1C,EAAY,cAAmB,EAAQ,eAGjC,CACN,KAAM,gBACN,OAAQ,OACR,KAAM,KAAK,UAAU,EAAY,CACjC"}