UNPKG

16.3 kBSource Map (JSON)View Raw
1{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./types.ts","webpack:///./typescript-multi-file/config.ts","webpack:///./typescript-single-file/selection-set.handlebars","webpack:///./typescript-single-file/config.ts","webpack:///./get-generator.ts","webpack:///./typescript-multi-file/fragment.handlebars","webpack:///./typescript-multi-file/operation.handlebars","webpack:///./typescript-multi-file/union.handlebars","webpack:///./typescript-multi-file/scalar.handlebars","webpack:///./typescript-multi-file/enum.handlebars","webpack:///./typescript-multi-file/type.handlebars","webpack:///./typescript-single-file/documents.handlebars","webpack:///./typescript-single-file/schema.handlebars","webpack:///./typescript-single-file/type.handlebars","webpack:///./typescript-single-file/template.handlebars","webpack:///./index.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","w","s","EInputType","SINGLE_FILE","MULTIPLE_FILES","PROJECT","type","enumTemplate","scalar","union","operation","fragment","selectionSet","config","inputType","templates","enum","interface","flattenTypes","primitives","String","Int","Float","Boolean","ID","filesExtension","default","index","schema","documents","outFile","config_1","config_2","definitions","ts","typescript","ts-single","typescript-single","ts-multiple","typescript-multiple","getGeneratorConfig","TypescriptSingleFile","TypescriptMultiFile","types_1","get_generator_1"],"mappings":"6DACA,IAAAA,KAMA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA8CA,OAzCAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,G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MAAO,SACPC,QAAS,UACTC,GAAI,UAENM,QAAS,cAGXxD,EAAAoD,QAAeb,iFC1Bf,IAAAkB,EAAA3D,EAAA,GACA4D,EAAA5D,EAAA,GAEaE,EAAA2D,aAEXC,GAAIH,EAAAL,QACJS,WAAYJ,EAAAL,QACZU,YAAaL,EAAAL,QACbW,oBAAqBN,EAAAL,QAErBY,cAAeN,EAAAN,QACfa,sBAAuBP,EAAAN,SAGzBpD,EAAAkE,mBAAA,SAAmCzD,GACjC,OAAOT,EAAA2D,YAAYlD,mBChBrBR,EAAAD,QAAA,opBCAAC,EAAAD,QAAA,spCCAAC,EAAAD,QAAA,sOCAAC,EAAAD,QAAA,kKCAAC,EAAAD,QAAA,kKCAAC,EAAAD,QAAA,myBCAAC,EAAAD,QAAA,m8DCAAC,EAAAD,QAAA,s8BCAAC,EAAAD,QAAA,0XCAAC,EAAAD,QAAA,gNCAA,IAAAyD,EAAA3D,EAAA,GAIEE,EAAAmE,qBAJKV,EAAAL,QACP,IAAAM,EAAA5D,EAAA,GAIEE,EAAAoE,oBAJKV,EAAAN,QAOP,IAAAiB,EAAAvE,EAAA,GAA0BE,EAAA4B,WAAAyC,EAAAzC,WAC1B,IAAA0C,EAAAxE,EAAA,GAASE,EAAAkE,mBAAAI,EAAAJ,mBAAoBlE,EAAA2D,YAAAW,EAAAX","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading wasm modules\n \tvar installedWasmModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// object with all compiled WebAssembly.Modules\n \t__webpack_require__.w = {};\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n","export const EInputType = {\n SINGLE_FILE: 'SINGLE_FILE',\n MULTIPLE_FILES: 'MULTIPLE_FILES',\n PROJECT: 'PROJECT',\n};\n\nexport interface GeneratorConfig {\n inputType: string; // EInputType\n flattenTypes: boolean;\n config?: { [configName: string]: any };\n templates: { [templateName: string]: string | string[] } | string;\n primitives: {\n String: string;\n Int: string;\n Float: string;\n Boolean: string;\n ID: string;\n };\n outFile?: string;\n filesExtension?: string;\n customHelpers?: { [helperName: string]: Function };\n}\n","import * as type from './type.handlebars';\nimport * as enumTemplate from './enum.handlebars';\nimport * as scalar from './scalar.handlebars';\nimport * as union from './union.handlebars';\nimport * as operation from './operation.handlebars';\nimport * as fragment from './fragment.handlebars';\nimport * as selectionSet from '../typescript-single-file/selection-set.handlebars';\nimport { EInputType, GeneratorConfig } from '../types';\n\nconst config: GeneratorConfig = {\n inputType: EInputType.MULTIPLE_FILES,\n templates: {\n type,\n inputType: type,\n 'enum': enumTemplate,\n 'interface': type,\n scalar,\n union,\n operation,\n fragment,\n selectionSet,\n },\n flattenTypes: true,\n primitives: {\n String: 'string',\n Int: 'number',\n Float: 'number',\n Boolean: 'boolean',\n ID: 'string'\n },\n filesExtension: 'd.ts',\n};\n\nexport default config;\n","module.exports = \"{{#each this}}\\n{{ name }}{{#unless isRequired}}?{{/unless}}: {{ toPrimitive type }}{{#if isArray}}[]{{/if}}{{#unless isRequired}} | null{{/unless}}; {{#if description }} // {{description}}{{/if}}\\n{{/each}}\"","import * as index from './template.handlebars';\nimport * as type from './type.handlebars';\nimport * as schema from './schema.handlebars';\nimport * as documents from './documents.handlebars';\nimport * as selectionSet from './selection-set.handlebars';\nimport { EInputType, GeneratorConfig } from '../types';\n\nconst config: GeneratorConfig = {\n inputType: EInputType.SINGLE_FILE,\n templates: {\n index,\n type,\n schema,\n documents,\n selectionSet,\n },\n flattenTypes: true,\n primitives: {\n String: 'string',\n Int: 'number',\n Float: 'number',\n Boolean: 'boolean',\n ID: 'string'\n },\n outFile: 'types.d.ts',\n};\n\nexport default config;\n","import { GeneratorConfig } from './types';\nimport TypescriptSingleFile from './typescript-single-file/config';\nimport TypescriptMultiFile from './typescript-multi-file/config';\n\nexport const definitions = {\n // TypeScript single file\n ts: TypescriptSingleFile,\n typescript: TypescriptSingleFile,\n 'ts-single': TypescriptSingleFile,\n 'typescript-single': TypescriptSingleFile,\n // TypeScript multiple files\n 'ts-multiple': TypescriptMultiFile,\n 'typescript-multiple': TypescriptMultiFile,\n};\n\nexport function getGeneratorConfig(name: string): GeneratorConfig {\n return definitions[name];\n}\n","module.exports = \"{{#eachImport this }}\\nimport { {{ name }} } from './{{ file }}';\\n{{/eachImport}}\\nexport namespace {{name}} {\\n export type Fragment = {\\n {{> selectionSet fields }}\\n } {{#if hasFragmentsSpread}}{{#each fragmentsSpread}} & {{fragmentName}}.Fragment{{/each}}{{/if}}{{#if hasInlineFragments}}{{#each inlineFragments}} & {{onType}}{{/each}}{{/if}}\\n {{#each innerModels }}\\n export type {{ modelType }} = {\\n {{> selectionSet fields }}\\n } {{#if hasFragmentsSpread}}{{#each fragmentsSpread}} & {{fragmentName}}.Fragment{{/each}}{{/if}}{{#if hasInlineFragments}}{{#each inlineFragments}} & {{onType}}{{/each}}{{/if}}\\n {{/each}}\\n}\"","module.exports = \"{{#eachImport this }}\\nimport { {{ name }} } from './{{ file }}';\\n{{/eachImport}}\\nexport namespace {{ toPascalCase name }} {\\n export type Variables = {\\n{{#each variables}}\\n {{ name }}{{#unless isRequired}}?{{/unless}}: {{ toPrimitive type }}{{#if isArray}}[]{{/if}}{{#unless isRequired}} | null{{/unless}};\\n{{/each}}\\n }\\n\\n export type {{ toPascalCase operationType }} ={{#if hasFields}} {\\n {{> selectionSet fields }}\\n }{{/if}} {{#if hasFragmentsSpread}}{{#if hasFields}}& {{/if}}{{#each fragmentsSpread}}{{fragmentName}}.Fragment{{#unless @last}} & {{/unless}}{{/each}}{{/if}}{{#if hasInlineFragments}}{{#if hasFields}}& {{/if}}{{#each inlineFragments}}{{onType}}{{#unless @last}} & {{/unless}}{{/each}}{{/if}}\\n {{#each innerModels }}\\n\\n export type {{ modelType }} ={{#if hasFields}} {\\n {{> selectionSet fields }}\\n }{{/if}} {{#if hasFragmentsSpread}}{{#if hasFields}}& {{/if}}{{#each fragmentsSpread}}{{fragmentName}}.Fragment{{#unless @last}} & {{/unless}}{{/each}}{{/if}}{{#if hasInlineFragments}}{{#if hasFields}}& {{/if}}{{#each inlineFragments}}{{onType}}{{#unless @last}} & {{/unless}}{{/each}}{{/if}}\\n {{/each}}\\n}\\n\"","module.exports = \"{{#eachImport this }}\\nimport { {{ name }} } from './{{ file }}';\\n{{/eachImport}}\\n{{ toComment description }}\\nexport type {{ name }} = {{#each possibleTypes}}{{this}}{{#unless @last}} | {{/unless}}{{/each}};\\n\"","module.exports = \"{{#eachImport this }}\\nimport { {{ name }} } from './{{ file }}';\\n{{/eachImport}}\\n{{ toComment description }}\\nexport type {{ name }} = any;\\n\"","module.exports = \"{{ toComment description }}\\nexport enum {{ name }} {\\n {{#each values }}{{value}} = \\\"{{ value }}\\\",{{#unless @last}}\\n {{/unless}}{{/each}}\\n}\"","module.exports = \"{{#eachImport this }}\\nimport { {{ name }} } from './{{ file }}';\\n{{/eachImport}}\\n{{ toComment description }}\\nexport interface {{ name }}{{#if hasInterfaces}} extends {{#each interfaces}}{{this}}{{#unless @last}},{{/unless}}{{/each}}{{/if}} {\\n{{#each fields}}\\n {{ name }}{{#unless isRequired}}?{{/unless}}: {{ toPrimitive type }}{{#if isArray}}[]{{/if}}{{#unless isRequired}} | null{{/unless}}; {{ toComment description }}\\n{{/each}}\\n}\\n\\n{{#each fields}}\\n {{~# if hasArguments }}\\nexport interface {{ toPascalCase name }}{{ toPascalCase ../name }}Args {\\n{{#each arguments}}\\n {{ name }}{{#unless isRequired}}?{{/unless}}: {{ toPrimitive type }}{{#if isArray}}[]{{/if}}{{#unless isRequired}} | null{{/unless}}; {{ toComment description }}\\n{{/each}}\\n}\\n {{/if}}\\n{{/each}}\"","module.exports = \"{{#each operations }}\\nexport namespace {{ toPascalCase name }} {\\n export type Variables = {\\n {{#each variables}}\\n {{ name }}{{#unless isRequired}}?{{/unless}}: {{ toPrimitive type }}{{#if isArray}}[]{{/if}}{{#unless isRequired}} | null{{/unless}};\\n {{/each}}\\n }\\n\\n export type {{ toPascalCase operationType }} ={{#if hasFields}} {\\n {{> selectionSet fields }}\\n }{{/if}} {{#if hasFragmentsSpread}}{{#if hasFields}}& {{/if}}{{#each fragmentsSpread}}{{fragmentName}}.Fragment{{#unless @last}} & {{/unless}}{{/each}}{{/if}}{{#if hasInlineFragments}}{{#if hasFields}}& {{/if}}{{#each inlineFragments}}{{onType}}{{#unless @last}} & {{/unless}}{{/each}}{{/if}}\\n {{#each innerModels }}\\n\\n export type {{ modelType }} ={{#if hasFields}} {\\n {{> selectionSet fields }}\\n }{{/if}} {{#if hasFragmentsSpread}}{{#if hasFields}}& {{/if}}{{#each fragmentsSpread}}{{fragmentName}}.Fragment{{#unless @last}} & {{/unless}}{{/each}}{{/if}}{{#if hasInlineFragments}}{{#if hasFields}}& {{/if}}{{#each inlineFragments}}{{onType}}{{#unless @last}} & {{/unless}}{{/each}}{{/if}}\\n {{/each}}\\n}\\n{{/each}}\\n{{#each fragments }}\\n\\nexport namespace {{name}} {\\n export type Fragment ={{#if hasFields}} {\\n {{> selectionSet fields }}\\n }{{/if}} {{#if hasFragmentsSpread}}{{#if hasFields}}& {{/if}}{{#each fragmentsSpread}}{{fragmentName}}.Fragment{{#unless @last}} & {{/unless}}{{/each}}{{/if}}{{#if hasInlineFragments}}{{#if hasFields}}& {{/if}}{{#each inlineFragments}}{{onType}}{{#unless @last}} & {{/unless}}{{/each}}{{/if}}\\n {{#each innerModels }}\\n\\n export type {{ modelType }} ={{#if hasFields}} {\\n {{> selectionSet fields }}\\n }{{/if}} {{#if hasFragmentsSpread}}{{#if hasFields}}& {{/if}}{{#each fragmentsSpread}}{{fragmentName}}.Fragment{{#unless @last}} & {{/unless}}{{/each}}{{/if}}{{#if hasInlineFragments}}{{#if hasFields}}& {{/if}}{{#each inlineFragments}}{{onType}}{{#unless @last}} & {{/unless}}{{/each}}{{/if}}\\n {{/each}}\\n}\\n{{/each}}\"","module.exports = \"{{#each scalars}}\\n\\n{{ toComment description }}\\nexport type {{ name }} = any;\\n{{/each}}\\n{{#each interfaces}}\\n {{~> type }}\\n{{/each}}\\n{{#each types}}\\n {{~> type }}\\n{{/each}}\\n{{#each inputTypes}}\\n {{~> type }}\\n{{/each}}\\n{{~#each types}}\\n {{~#each fields}}\\n {{~# if hasArguments }}\\nexport interface {{ toPascalCase name }}{{ toPascalCase ../name }}Args {\\n{{#each arguments}}\\n {{ name }}{{#unless isRequired}}?{{/unless}}: {{ toPrimitive type }}{{#if isArray}}[]{{/if}}{{#unless isRequired}} | null{{/unless}}; {{ toComment description }}\\n{{/each}}\\n}\\n {{/if}}\\n {{/each}}\\n{{/each}}\\n{{#each enums}}\\n{{ toComment description }}\\nexport enum {{ name }} {\\n {{#each values }}{{value}} = \\\"{{ value }}\\\",{{#unless @last}}\\n {{/unless}}{{/each}}\\n}\\n\\n{{/each}}\\n{{#each unions}}\\n{{ toComment description }}\\nexport type {{ name }} = {{#each possibleTypes}}{{this}}{{#unless @last}} | {{/unless}}{{/each}};\\n\\n{{/each}}\\n\"","module.exports = \"{{ toComment description }}\\nexport interface {{ name }}{{#if hasInterfaces}} extends {{#each interfaces}}{{this}}{{#unless @last}},{{/unless}}{{/each}}{{/if}} {\\n{{#each fields}}\\n {{ name }}{{#unless isRequired}}?{{/unless}}: {{ toPrimitive type }}{{#if isArray}}[]{{/if}}{{#unless isRequired}} | null{{/unless}}; {{ toComment description }}\\n{{/each}}\\n}\\n\"","module.exports = \"/* tslint:disable */\\n{{#if config.printTime }}\\n// Generated in {{ currentTime }}\\n{{/if}}\\n{{> schema }}\\n{{> documents }}\\n\"","import TypescriptSingleFile from './typescript-single-file/config';\nimport TypescriptMultiFile from './typescript-multi-file/config';\n\nexport {\n TypescriptSingleFile,\n TypescriptMultiFile,\n};\n\nexport { GeneratorConfig, EInputType } from './types';\nexport { getGeneratorConfig, definitions } from './get-generator';\n"],"sourceRoot":""}
\No newline at end of file