mirror of
https://github.com/ASzc/change-string-case-action.git
synced 2024-11-24 02:23:51 +08:00
1 line
5.9 KiB
Plaintext
1 line
5.9 KiB
Plaintext
{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/error.js","../dist-src/graphql.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"4.5.3\";\n","export class GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n Object.assign(this, { headers: response.headers });\n this.name = \"GraphqlError\";\n this.request = request;\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n","import { GraphqlError } from \"./error\";\nconst NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\",\n \"mediaType\",\n];\nexport function graphql(request, query, options) {\n options =\n typeof query === \"string\"\n ? (options = Object.assign({ query }, options))\n : (options = query);\n const requestOptions = Object.keys(options).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = options[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = options[key];\n return result;\n }, {});\n return request(requestOptions).then((response) => {\n if (response.data.errors) {\n const headers = {};\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n throw new GraphqlError(requestOptions, {\n headers,\n data: response.data,\n });\n }\n return response.data.data;\n });\n}\n","import { request as Request } from \"@octokit/request\";\nimport { graphql } from \"./graphql\";\nexport function withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: Request.endpoint,\n });\n}\n","import { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport { withDefaults } from \"./with-defaults\";\nexport const graphql = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,\n },\n method: \"POST\",\n url: \"/graphql\",\n});\nexport function withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\",\n });\n}\n"],"names":["VERSION","GraphqlError","Error","constructor","request","response","message","data","errors","Object","assign","headers","name","captureStackTrace","NON_VARIABLE_OPTIONS","graphql","query","options","requestOptions","keys","reduce","result","key","includes","variables","then","withDefaults","newDefaults","newRequest","defaults","newApi","bind","endpoint","Request","getUserAgent","method","url","withCustomRequest","customRequest"],"mappings":";;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACAA,MAAMC,YAAN,SAA2BC,KAA3B,CAAiC;AACpCC,EAAAA,WAAW,CAACC,OAAD,EAAUC,QAAV,EAAoB;AAC3B,UAAMC,OAAO,GAAGD,QAAQ,CAACE,IAAT,CAAcC,MAAd,CAAqB,CAArB,EAAwBF,OAAxC;AACA,UAAMA,OAAN;AACAG,IAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoBL,QAAQ,CAACE,IAA7B;AACAE,IAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoB;AAAEC,MAAAA,OAAO,EAAEN,QAAQ,CAACM;AAApB,KAApB;AACA,SAAKC,IAAL,GAAY,cAAZ;AACA,SAAKR,OAAL,GAAeA,OAAf,CAN2B;;AAQ3B;;AACA,QAAIF,KAAK,CAACW,iBAAV,EAA6B;AACzBX,MAAAA,KAAK,CAACW,iBAAN,CAAwB,IAAxB,EAA8B,KAAKV,WAAnC;AACH;AACJ;;AAbmC;;ACCxC,MAAMW,oBAAoB,GAAG,CACzB,QADyB,EAEzB,SAFyB,EAGzB,KAHyB,EAIzB,SAJyB,EAKzB,SALyB,EAMzB,OANyB,EAOzB,WAPyB,CAA7B;AASA,AAAO,SAASC,OAAT,CAAiBX,OAAjB,EAA0BY,KAA1B,EAAiCC,OAAjC,EA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