@looker/sdk-codegen 21.8.1 → 21.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +128 -167
  2. package/README.md +0 -1
  3. package/lib/codeGen.d.ts +1 -1
  4. package/lib/codeGen.js +4 -6
  5. package/lib/codeGen.js.map +1 -1
  6. package/lib/codeGenerators.d.ts +1 -1
  7. package/lib/codeGenerators.js +2 -4
  8. package/lib/codeGenerators.js.map +1 -1
  9. package/lib/csharp.gen.d.ts +1 -1
  10. package/lib/csharp.gen.js +2 -2
  11. package/lib/csharp.gen.js.map +1 -1
  12. package/lib/declarationInfo.d.ts +3 -3
  13. package/lib/declarationInfo.js +1 -2
  14. package/lib/declarationInfo.js.map +1 -1
  15. package/lib/esm/codeGen.js +14 -23
  16. package/lib/esm/codeGen.js.map +1 -1
  17. package/lib/esm/codeGenerators.js +17 -28
  18. package/lib/esm/codeGenerators.js.map +1 -1
  19. package/lib/esm/csharp.gen.js +11 -18
  20. package/lib/esm/csharp.gen.js.map +1 -1
  21. package/lib/esm/declarationInfo.js +3 -10
  22. package/lib/esm/declarationInfo.js.map +1 -1
  23. package/lib/esm/exampleInfo.js +9 -24
  24. package/lib/esm/exampleInfo.js.map +1 -1
  25. package/lib/esm/go.gen.js +11 -18
  26. package/lib/esm/go.gen.js.map +1 -1
  27. package/lib/esm/index.js +13 -148
  28. package/lib/esm/index.js.map +1 -1
  29. package/lib/esm/kotlin.gen.js +11 -18
  30. package/lib/esm/kotlin.gen.js.map +1 -1
  31. package/lib/esm/pseudo.gen.js +6 -13
  32. package/lib/esm/pseudo.gen.js.map +1 -1
  33. package/lib/esm/python.gen.js +15 -19
  34. package/lib/esm/python.gen.js.map +1 -1
  35. package/lib/esm/sdkModels.js +52 -96
  36. package/lib/esm/sdkModels.js.map +1 -1
  37. package/lib/esm/specConverter.js +29 -57
  38. package/lib/esm/specConverter.js.map +1 -1
  39. package/lib/esm/specDiff.js +17 -36
  40. package/lib/esm/specDiff.js.map +1 -1
  41. package/lib/esm/swift.gen.js +17 -24
  42. package/lib/esm/swift.gen.js.map +1 -1
  43. package/lib/esm/testUtils/index.js +1 -16
  44. package/lib/esm/testUtils/index.js.map +1 -1
  45. package/lib/esm/testUtils/testUtils.js +12 -25
  46. package/lib/esm/testUtils/testUtils.js.map +1 -1
  47. package/lib/esm/typescript.gen.js +16 -23
  48. package/lib/esm/typescript.gen.js.map +1 -1
  49. package/lib/exampleInfo.d.ts +6 -6
  50. package/lib/exampleInfo.js +1 -2
  51. package/lib/exampleInfo.js.map +1 -1
  52. package/lib/go.gen.js +3 -3
  53. package/lib/go.gen.js.map +1 -1
  54. package/lib/index.js.map +1 -1
  55. package/lib/kotlin.gen.d.ts +1 -1
  56. package/lib/kotlin.gen.js +2 -2
  57. package/lib/kotlin.gen.js.map +1 -1
  58. package/lib/pseudo.gen.js +2 -2
  59. package/lib/pseudo.gen.js.map +1 -1
  60. package/lib/python.gen.js +6 -3
  61. package/lib/python.gen.js.map +1 -1
  62. package/lib/sdkModels.d.ts +13 -13
  63. package/lib/sdkModels.js +15 -25
  64. package/lib/sdkModels.js.map +1 -1
  65. package/lib/specConverter.d.ts +6 -9
  66. package/lib/specConverter.js +12 -20
  67. package/lib/specConverter.js.map +1 -1
  68. package/lib/specDiff.d.ts +4 -4
  69. package/lib/specDiff.js +4 -8
  70. package/lib/specDiff.js.map +1 -1
  71. package/lib/swift.gen.js +2 -2
  72. package/lib/swift.gen.js.map +1 -1
  73. package/lib/testUtils/index.js.map +1 -1
  74. package/lib/testUtils/testUtils.js +4 -6
  75. package/lib/testUtils/testUtils.js.map +1 -1
  76. package/lib/typescript.gen.js +4 -4
  77. package/lib/typescript.gen.js.map +1 -1
  78. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"python.gen.js","names":["_sdkModels","require","_codeGen","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","PythonGen","CodeGen","constructor","arguments","concat","indentStr","repeat","Set","_indent","warnEditing","packagePath","packageName","apiVersion","apiRef","structureHookTK","hooks","join","prop","required","type","customType","EnumType","includes","className","sdkFileName","baseFileName","fileName","argGroup","args","length","nullStr","hash","push","dataStructureDelimiter","beginRegion","indent","description","endRegion","_description","declareProperty","property","annotations","mappedType","typeMapModels","propName","name","pythonKeywords","has","propType","propDef","annotation","isBareForwardRef","bumper","methodReturnType","method","typeMapMethods","returnType","responseIsBoth","responseIsBinary","methodSignature","_method$description","bump","params","allParams","forEach","p","declareParameter","head","trim","httpMethod","endpoint","commentHeader","paramDelimiter","param","location","strBody","writeableType","mapped","paramType","describeParam","default","makeTheCall","inputs","origDelim","argDelimiter","resp","assignParams","initArg","declareType","decl","invalid","typeProperties","values","requiredProperties","optionalProperties","construct","inits","declareConstructorArg","result","properties","some","argFill","current","delimiter","match","replace","httpArgs","callerIndent","currIndent","bodyArg","queryArgs","queryParams","test","httpCall","deprecation","callOpener","it","toLowerCase","callArgs","callCloser","returnStmt","encodePathParams","encodings","pathParams","doEncode","declareMethod","summary","typeSignature","b2","attrs","isEnum","baseClass","usesReservedPythonKeyword","attr","text","prefixModelsNamespace","format","forwardRef","typeMap","asString","_","v","pythonTypes","any","boolean","byte","datetime","double","float","int32","int64","integer","number","password","asVal","string","object","uri","void","elementType","map","typeName","defaultValue","Error","JSON","stringify","mt","exports"],"sources":["../src/python.gen.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type {\n Arg,\n ArgValues,\n IMethod,\n IParameter,\n IProperty,\n IType,\n} from './sdkModels'\nimport { describeParam, EnumType, strBody } from './sdkModels'\nimport type { IMappedType, CodeAssignment } from './codeGen'\nimport { CodeGen } from './codeGen'\n\nexport class PythonGen extends CodeGen {\n codePath = './python/'\n packagePath = 'looker_sdk'\n itself = 'self'\n fileExtension = '.py'\n commentStr = '# '\n nullStr = 'None'\n\n indentStr = ' '\n argDelimiter = `,\\n${this.indentStr.repeat(3)}`\n argSetSep = '='\n paramDelimiter = ',\\n'\n propDelimiter = '\\n'\n dataStructureDelimiter = ', '\n enumDelimiter = '\\n'\n codeQuote = '\"'\n typeOpen = '('\n typeClose = ')'\n hashKeyQuote = '\"'\n useModelClassForTypes = true\n\n endTypeStr = ''\n\n // keyword.kwlist\n pythonKeywords = new Set<string>([\n 'False',\n 'None',\n 'True',\n 'and',\n 'as',\n 'assert',\n 'async',\n 'await',\n 'break',\n 'class',\n 'continue',\n 'def',\n 'del',\n 'elif',\n 'else',\n 'except',\n 'finally',\n 'for',\n 'from',\n 'global',\n 'if',\n 'import',\n 'in',\n 'is',\n 'lambda',\n 'nonlocal',\n 'not',\n 'or',\n 'pass',\n 'raise',\n 'return',\n 'try',\n 'while',\n 'with',\n 'yield',\n ])\n\n // cattrs [un]structure hooks for model [de]serialization\n hooks: string[] = []\n structureHookTK = 'translate_keys_structure_hook'\n pythonReservedKeywordClasses: Set<string> = new Set()\n\n methodsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nfrom typing import Any, MutableMapping, Optional, Sequence, Union, cast\nimport warnings\n\nfrom . import models as mdls\nfrom ${this.packagePath}.rtl import api_methods\nfrom ${this.packagePath}.rtl import transport\n\nclass ${this.packageName}(api_methods.APIMethods):\n`\n\n methodsEpilogue = (_indent: string) =>\n this.apiVersion === '3.1' ? `LookerSDK = ${this.packageName}` : ''\n\n modelsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nimport enum\nfrom typing import Any, MutableMapping, Optional, Sequence\n\ntry:\n from typing import ForwardRef # type: ignore\nexcept ImportError:\n from typing import _ForwardRef as ForwardRef # type: ignore\n\nimport attr\n\nfrom ${this.packagePath}.rtl import model\nfrom ${this.packagePath}.rtl import serialize as sr\n\nEXPLICIT_NULL = model.EXPLICIT_NULL # type: ignore\nDelimSequence = model.DelimSequence\n`\n\n modelsEpilogue = (_indent: string) => `\nimport functools # noqa:E402\n\nforward_ref_structure_hook = functools.partial(\n sr.forward_ref_structure_hook, globals(), sr.converter${this.apiRef}\n)\nsr.converter${this.apiRef}.register_structure_hook_func(\n lambda t: t.__class__ is ForwardRef, forward_ref_structure_hook\n)\n${\n this.structureHookTK\n} = functools.partial(sr.translate_keys_structure_hook, sr.converter${\n this.apiRef\n })\n${this.hooks.join('\\n')}\n`\n\n sdkFileName(baseFileName: string) {\n return this.fileName(`sdk/api${this.apiRef}/${baseFileName}`)\n }\n\n argGroup(_indent: string, args: Arg[]) {\n if (!args || args.length === 0) return this.nullStr\n const hash: string[] = []\n for (const arg of args) {\n hash.push(`\"${arg}\": ${arg}`)\n }\n return `{${hash.join(this.dataStructureDelimiter)}}`\n }\n\n beginRegion(indent: string, description: string): string {\n // Sadly, Black reformats this to \"# region\" and IntelliJ doesn't recognize it either way\n return `${indent}#region ${description}`\n }\n\n endRegion(indent: string, _description: string): string {\n // Sadly, Black reformats this to \"# endregion\" and IntelliJ doesn't recognize it either way\n return `${indent}#endregion`\n }\n\n declareProperty(indent: string, property: IProperty, annotations = false) {\n const mappedType = this.typeMapModels(property.type)\n let propName = property.name\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_'\n }\n let propType = mappedType.name\n if (!property.required) {\n propType = `Optional[${mappedType.name}]`\n }\n\n let propDef\n if (annotations) {\n let annotation = propType\n if (this.isBareForwardRef(property)) {\n annotation = `ForwardRef(${propType})`\n }\n propDef = `${this.bumper(indent)}\"${propName}\": ${annotation}`\n } else {\n if (!property.required) {\n propType += ` = ${this.nullStr}`\n }\n propDef = `${indent}${propName}: ${propType}`\n }\n return propDef\n }\n\n private methodReturnType(method: IMethod) {\n const type = this.typeMapMethods(method.type)\n let returnType = type.name\n if (method.responseIsBoth()) {\n returnType = `Union[${returnType}, bytes]`\n } else if (method.responseIsBinary()) {\n returnType = 'bytes'\n }\n return returnType\n }\n\n // because Python has named default parameters, Request types are not required like\n // they are for TypeScript\n methodSignature(indent: string, method: IMethod) {\n const returnType = this.methodReturnType(method)\n const bump = this.bumper(indent)\n const params: string[] = []\n const args = method.allParams\n if (args && args.length > 0) {\n method.allParams.forEach((p) =>\n params.push(this.declareParameter(bump, method, p))\n )\n }\n let head = method.description?.trim()\n head =\n (head ? `${head}\\n\\n` : '') +\n `${method.httpMethod} ${method.endpoint} -> ${returnType}`\n params.push(\n `${bump}transport_options: Optional[transport.TransportOptions] = None,`\n )\n return (\n this.commentHeader(indent, head) +\n `${indent}def ${method.name}(\\n` +\n `${bump}self${params.length > 0 ? ',\\n' : ''}` +\n `${params.join(this.paramDelimiter)}\\n` +\n `${indent}) -> ${returnType}:\\n`\n )\n }\n\n declareParameter(indent: string, method: IMethod, param: IParameter) {\n let type: IType\n if (param.location === strBody) {\n type = this.writeableType(param.type, method) || param.type\n } else {\n type = param.type\n }\n const mapped = this.typeMapMethods(type)\n const paramType = param.required ? mapped.name : `Optional[${mapped.name}]`\n return (\n this.commentHeader(indent, describeParam(param)) +\n `${indent}${param.name}: ${paramType}` +\n (param.required ? '' : ` = ${mapped.default}`)\n )\n }\n\n makeTheCall(method: IMethod, inputs: ArgValues): string {\n const origDelim = this.argDelimiter\n this.argDelimiter = `,\\n${this.indentStr}`\n const resp = `response = sdk.${method.name}(`\n const args = this.assignParams(method, inputs)\n this.argDelimiter = origDelim\n return `${resp}${args})`\n }\n\n initArg(indent: string, property: IProperty) {\n let propName = property.name\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_'\n }\n return `${indent}self.${propName} = ${propName}`\n }\n\n declareType(indent: string, type: IType) {\n let decl = super.declareType(indent, type)\n if (type instanceof EnumType) {\n const invalid =\n 'invalid_api_enum_value = \"invalid_api_enum_value\"' +\n '\\n\\n\\n# https://github.com/python/mypy/issues/2427' +\n `\\n${type.name}.__new__ = model.safe_enum__new__ # type: ignore`\n decl += `\\n${this.bumper(indent)}${invalid}`\n }\n return decl\n }\n\n typeProperties(type: IType) {\n return Object.values(type.requiredProperties).concat(\n Object.values(type.optionalProperties)\n )\n }\n\n private isBareForwardRef = (prop: IProperty) => {\n // contains a \"bare\" forward reference e.g. `result_format: \"ResultFormat\"`\n // so we need to emit the `__annotations__` property\n return (\n prop.required &&\n (prop.type.customType || prop.type instanceof EnumType) &&\n !['ArrayType', 'HashType', 'DelimArrayType'].includes(prop.type.className)\n )\n }\n\n /**\n * Ideally we'd rely on @attr.s to generate the constructor for us\n * However, neither Jedi (https://github.com/davidhalter/jedi-vim/issues/816)\n * nor microsoft/python-language-server\n * (https://github.com/microsoft/python-language-server/issues/399)\n * display good tooltips for these auto-generated __init__ methods. So for\n * now we'll generate them ourselves following the functionality of\n * @attr.s(kw_only=True) we'll only allow kw_args.\n */\n construct(indent: string, type: IType) {\n if (type instanceof EnumType) return ''\n indent = this.bumper(indent)\n const bump = this.bumper(indent)\n const annotations: string[] = []\n const args: string[] = []\n const inits: string[] = []\n this.typeProperties(type).forEach((prop) => {\n annotations.push(this.declareProperty(indent, prop, true))\n args.push(this.declareConstructorArg('', prop))\n inits.push(this.initArg(bump, prop))\n })\n let result = ''\n if (Object.values(type.properties).some(this.isBareForwardRef)) {\n result =\n `\\n${indent}__annotations__ = {\\n` +\n `${annotations.join(',\\n')}` +\n `\\n${indent}}`\n }\n result +=\n `\\n\\n${indent}def __init__(self, *${this.argDelimiter}` +\n `${args.join(this.argDelimiter)}):\\n` +\n inits.join('\\n')\n return result\n }\n\n declareConstructorArg(indent: string, property: IProperty) {\n const mappedType = this.typeMapModels(property.type)\n let propType: string\n if (property.required) {\n propType = mappedType.name\n } else {\n propType = `Optional[${mappedType.name}] = ${this.nullStr}`\n }\n let propName = property.name\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_'\n }\n return `${indent}${propName}: ${propType}`\n }\n\n // this is a builder function to produce arguments with optional null place holders but no extra required optional arguments\n argFill(current: string, args: string): string {\n if (!current && args.trim() === this.nullStr) {\n // Don't append trailing optional arguments if none have been set yet\n return ''\n }\n let delimiter = ',\\n'\n if (!current) {\n delimiter = ''\n // Caller manually inserted delimiter followed by inline comment\n } else if (args.match(/, {2}#/)) {\n delimiter = delimiter.replace(',', '')\n }\n return `${args}${delimiter}${current}`\n }\n\n httpArgs(callerIndent: string, method: IMethod): string {\n const currIndent = this.bumper(callerIndent)\n let args = ''\n args = this.argFill(\n args,\n `${currIndent}transport_options=transport_options`\n )\n if (method.bodyArg) {\n args = this.argFill(args, `${currIndent}body=${method.bodyArg}`)\n }\n if (method.queryArgs.length) {\n const queryParams = this.argGroup('', method.queryArgs)\n args = this.argFill(args, `${currIndent}query_params=${queryParams}`)\n }\n let returnType = this.methodReturnType(method)\n if (method.responseIsBoth()) {\n // cattrs needs the python object Union[<rt>, bytes] in order\n // to properly deserialize the response. However, this argument\n // is passed as a value so we get a mypy error that the argument\n // has type \"object\" instead of TStructure. Hence the # type: ignore\n returnType += ', # type: ignore'\n }\n args = this.argFill(args, `${currIndent}structure=${returnType}`)\n let endpoint = `\"${method.endpoint}\"`\n if (/\\{\\w+\\}/.test(endpoint)) {\n // avoid flake8: f-string is missing placeholders\n endpoint = `f${endpoint}`\n }\n args = this.argFill(args, `${currIndent}path=${endpoint}`)\n return args\n }\n\n httpCall(callerIndent: string, method: IMethod): string {\n // callOpener itself is nested inside a cast()\n const currIndent = this.bumper(callerIndent)\n let deprecation = ''\n if (method.name === 'login_user') {\n deprecation =\n `${callerIndent}warnings.warn(\"login_user behavior changed significantly ` +\n `in 21.4.0. See https://git.io/JOtH1\")\\n`\n }\n const callOpener =\n `${callerIndent}response = cast(\\n` +\n `${currIndent}${this.methodReturnType(method)},\\n` +\n `${currIndent}${this.it(method.httpMethod.toLowerCase())}(\\n`\n const callArgs = `${this.httpArgs(currIndent, method)}\\n`\n const callCloser = `${currIndent})\\n${callerIndent})\\n`\n const returnStmt = `${callerIndent}return response`\n return deprecation + callOpener + callArgs + callCloser + returnStmt\n }\n\n encodePathParams(indent: string, method: IMethod) {\n let encodings = ''\n const pathParams = method.pathParams\n if (pathParams.length > 0) {\n for (const param of pathParams) {\n if (param.doEncode()) {\n encodings += `${indent}${param.name} = self.encode_path_param(${param.name})\\n`\n }\n }\n }\n return encodings\n }\n\n declareMethod(indent: string, method: IMethod) {\n const bump = this.bumper(indent)\n\n return (\n this.methodSignature(indent, method) +\n this.summary(bump, method.summary) +\n this.encodePathParams(bump, method) +\n this.httpCall(bump, method)\n )\n }\n\n typeSignature(indent: string, type: IType) {\n const bump = this.bumper(indent)\n const b2 = this.bumper(bump)\n const attrs: string[] = []\n const isEnum = type instanceof EnumType\n const baseClass = isEnum ? 'enum.Enum' : 'model.Model'\n let usesReservedPythonKeyword = false\n\n if (!isEnum) {\n for (const prop of this.typeProperties(type)) {\n let propName = prop.name\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_'\n usesReservedPythonKeyword = true\n }\n let attr = `${b2}${propName}:`\n if (prop.description) {\n attr += ` ${prop.description}`\n }\n attrs.push(attr)\n }\n }\n\n if (usesReservedPythonKeyword) {\n this.hooks.push(\n `sr.converter${this.apiRef}.register_structure_hook(\\n${bump}${type.name}, # type: ignore\\n${bump}${this.structureHookTK} # type:ignore\\n)`\n )\n }\n\n let result =\n `\\n` +\n (isEnum ? '' : `${indent}@attr.s(auto_attribs=True, init=False)\\n`) +\n `${indent}class ${type.name}(${baseClass}):\\n` +\n `${bump}\"\"\"\\n` +\n (type.description ? `${bump}${type.description}\\n\\n` : '')\n\n if (attrs.length > 0) {\n result += `${bump}Attributes:\\n` + `${attrs.join('\\n')}\\n`\n }\n\n return result + `${bump}\"\"\"\\n`\n }\n\n summary(indent: string, text: string | undefined) {\n return text ? `${indent}\"\"\"${text}\"\"\"\\n` : ''\n }\n\n // when format is \"methods\" that means we're in the methods.py module\n // and we need to reference the type by the `mdls.` package name\n prefixModelsNamespace(\n name: string,\n format: 'models' | 'methods',\n forwardRef = false\n ): string {\n if (format === 'models') {\n // need to quote this forwardRef\n name = forwardRef ? `\"${name}\"` : name\n } else if (format === 'methods') {\n name = `mdls.${name}`\n }\n return name\n }\n\n // hack default format to 'methods' so that argValue() calls the right thing\n typeMap(type: IType, format: 'models' | 'methods' = 'methods'): IMappedType {\n const asString: CodeAssignment = (_, v) => `\"${v}\"`\n const pythonTypes: Record<string, IMappedType> = {\n any: { default: this.nullStr, name: 'Any' },\n boolean: { default: this.nullStr, name: 'bool' },\n byte: { default: this.nullStr, name: 'bytes' },\n datetime: { default: this.nullStr, name: 'datetime.datetime' },\n double: { default: this.nullStr, name: 'float' },\n float: { default: this.nullStr, name: 'float' },\n int32: { default: this.nullStr, name: 'int' },\n int64: { default: this.nullStr, name: 'int' },\n integer: { default: this.nullStr, name: 'int' },\n number: { default: this.nullStr, name: 'float' },\n password: { default: this.nullStr, name: 'str', asVal: asString },\n string: { default: this.nullStr, name: 'str', asVal: asString },\n object: { default: this.nullStr, name: 'str', asVal: asString },\n uri: { default: this.nullStr, name: 'str', asVal: asString },\n void: { default: this.nullStr, name: 'None' },\n }\n\n super.typeMap(type)\n if (type.elementType) {\n const map = this.typeMap(type.elementType, format)\n let typeName: string\n let name: string\n const defaultValue = this.nullStr\n let asVal: CodeAssignment | undefined\n switch (type.className) {\n case 'ArrayType':\n typeName = 'Sequence'\n name = `${typeName}[${map.name}]`\n break\n case 'HashType':\n typeName = 'MutableMapping'\n // TODO fix bad API spec, like MergeQuery vis_config\n name =\n typeName +\n '[str, ' +\n (type.elementType.name === 'string' ? 'Any' : map.name) +\n ']'\n break\n case 'DelimArrayType':\n typeName = this.prefixModelsNamespace('DelimSequence', format)\n name = `${typeName}[${map.name}]`\n asVal = (_, v) => `${typeName}([${v}])`\n break\n case 'EnumType':\n name = typeName = this.prefixModelsNamespace(type.name, format, true)\n asVal = (_, v) => `${typeName}.${v}`\n break\n default:\n throw new Error(`Don't know how to handle: ${JSON.stringify(type)}`)\n }\n const mt: IMappedType = { default: defaultValue, name: name }\n if (asVal) {\n mt.asVal = asVal\n }\n return mt\n }\n if (!type.name) {\n throw new Error('Cannot output a nameless type.')\n }\n const name = this.prefixModelsNamespace(\n type.name,\n format,\n !!type.customType\n )\n const result = pythonTypes[type.name]\n return result || { default: this.nullStr, name: name }\n }\n\n typeMapMethods(type: IType) {\n return this.typeMap(type, 'methods')\n }\n\n typeMapModels(type: IType) {\n return this.typeMap(type, 'models')\n }\n}\n"],"mappings":";;;;;;AAkCA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAAmC,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GA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AAaA,CAACxB,IAAW,EAAE;IACzB,OAAO,IAAI,CAACuH,OAAO,CAACvH,IAAI,EAAE,QAAQ,CAAC;EACrC;AACF;AAACoJ,OAAA,CAAAvK,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"file":"python.gen.js","names":["_sdkModels","require","_codeGen","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","PythonGen","CodeGen","constructor","arguments","concat","indentStr","repeat","Set","_indent","warnEditing","packagePath","packageName","apiVersion","apiRef","structureHookTK","hooks","join","prop","required","type","customType","EnumType","includes","className","sdkFileName","baseFileName","fileName","argGroup","args","length","nullStr","hash","arg","push","dataStructureDelimiter","beginRegion","indent","description","endRegion","_description","declareProperty","property","annotations","undefined","mappedType","typeMapModels","propName","name","pythonKeywords","has","propType","propDef","annotation","isBareForwardRef","bumper","methodReturnType","method","typeMapMethods","returnType","responseIsBoth","responseIsBinary","methodSignature","_method$description","bump","params","allParams","forEach","p","declareParameter","head","trim","httpMethod","endpoint","commentHeader","paramDelimiter","param","location","strBody","writeableType","mapped","paramType","describeParam","default","makeTheCall","inputs","origDelim","argDelimiter","resp","assignParams","match","initArg","declareType","decl","invalid","typeProperties","values","requiredProperties","optionalProperties","construct","inits","declareConstructorArg","result","properties","some","argFill","current","delimiter","replace","httpArgs","callerIndent","currIndent","bodyArg","queryArgs","queryParams","test","httpCall","deprecation","callOpener","it","toLowerCase","callArgs","callCloser","returnStmt","encodePathParams","encodings","pathParams","doEncode","declareMethod","summary","typeSignature","b2","attrs","isEnum","baseClass","usesReservedPythonKeyword","attr","text","prefixModelsNamespace","format","forwardRef","typeMap","asString","_","v","pythonTypes","any","boolean","byte","datetime","double","float","int32","int64","integer","number","password","asVal","string","object","uri","void","elementType","map","typeName","defaultValue","Error","JSON","stringify","mt","exports"],"sources":["../src/python.gen.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type {\n Arg,\n ArgValues,\n IMethod,\n IParameter,\n IProperty,\n IType,\n} from './sdkModels';\nimport { EnumType, describeParam, strBody } from './sdkModels';\nimport type { CodeAssignment, IMappedType } from './codeGen';\nimport { CodeGen } from './codeGen';\n\nexport class PythonGen extends CodeGen {\n codePath = './python/';\n packagePath = 'looker_sdk';\n itself = 'self';\n fileExtension = '.py';\n commentStr = '# ';\n nullStr = 'None';\n\n indentStr = ' ';\n argDelimiter = `,\\n${this.indentStr.repeat(3)}`;\n argSetSep = '=';\n paramDelimiter = ',\\n';\n propDelimiter = '\\n';\n dataStructureDelimiter = ', ';\n enumDelimiter = '\\n';\n codeQuote = '\"';\n typeOpen = '(';\n typeClose = ')';\n hashKeyQuote = '\"';\n useModelClassForTypes = true;\n\n endTypeStr = '';\n\n // keyword.kwlist\n pythonKeywords = new Set<string>([\n 'False',\n 'None',\n 'True',\n 'and',\n 'as',\n 'assert',\n 'async',\n 'await',\n 'break',\n 'class',\n 'continue',\n 'def',\n 'del',\n 'elif',\n 'else',\n 'except',\n 'finally',\n 'for',\n 'from',\n 'global',\n 'if',\n 'import',\n 'in',\n 'is',\n 'lambda',\n 'nonlocal',\n 'not',\n 'or',\n 'pass',\n 'raise',\n 'return',\n 'try',\n 'while',\n 'with',\n 'yield',\n ]);\n\n // cattrs [un]structure hooks for model [de]serialization\n hooks: string[] = [];\n structureHookTK = 'translate_keys_structure_hook';\n pythonReservedKeywordClasses: Set<string> = new Set();\n\n methodsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nfrom typing import Any, MutableMapping, Optional, Sequence, Union, cast\nimport warnings\n\nfrom . import models as mdls\nfrom ${this.packagePath}.rtl import api_methods\nfrom ${this.packagePath}.rtl import transport\n\nclass ${this.packageName}(api_methods.APIMethods):\n`;\n\n methodsEpilogue = (_indent: string) =>\n this.apiVersion === '4.0' ? `LookerSDK = ${this.packageName}` : '';\n\n modelsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nimport enum\nfrom typing import Any, MutableMapping, Optional, Sequence\n\ntry:\n from typing import ForwardRef # type: ignore\nexcept ImportError:\n from typing import _ForwardRef as ForwardRef # type: ignore\n\nimport attr\n\nfrom ${this.packagePath}.rtl import model\nfrom ${this.packagePath}.rtl import serialize as sr\n\nEXPLICIT_NULL = model.EXPLICIT_NULL # type: ignore\nDelimSequence = model.DelimSequence\n`;\n\n modelsEpilogue = (_indent: string) => `\nimport functools # noqa:E402\n\nforward_ref_structure_hook = functools.partial(\n sr.forward_ref_structure_hook, globals(), sr.converter${this.apiRef}\n)\nsr.converter${this.apiRef}.register_structure_hook_func(\n lambda t: t.__class__ is ForwardRef, forward_ref_structure_hook\n)\n${\n this.structureHookTK\n} = functools.partial(sr.translate_keys_structure_hook, sr.converter${\n this.apiRef\n })\n${this.hooks.join('\\n')}\n`;\n\n sdkFileName(baseFileName: string) {\n return this.fileName(`sdk/api${this.apiRef}/${baseFileName}`);\n }\n\n argGroup(_indent: string, args: Arg[]) {\n if (!args || args.length === 0) return this.nullStr;\n const hash: string[] = [];\n for (const arg of args) {\n hash.push(`\"${arg}\": ${arg}`);\n }\n return `{${hash.join(this.dataStructureDelimiter)}}`;\n }\n\n beginRegion(indent: string, description: string): string {\n // Sadly, Black reformats this to \"# region\" and IntelliJ doesn't recognize it either way\n return `${indent}#region ${description}`;\n }\n\n endRegion(indent: string, _description: string): string {\n // Sadly, Black reformats this to \"# endregion\" and IntelliJ doesn't recognize it either way\n return `${indent}#endregion`;\n }\n\n declareProperty(indent: string, property: IProperty, annotations = false) {\n const mappedType = this.typeMapModels(property.type);\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n let propType = mappedType.name;\n if (!property.required) {\n propType = `Optional[${mappedType.name}]`;\n }\n\n let propDef;\n if (annotations) {\n let annotation = propType;\n if (this.isBareForwardRef(property)) {\n annotation = `ForwardRef(${propType})`;\n }\n propDef = `${this.bumper(indent)}\"${propName}\": ${annotation}`;\n } else {\n if (!property.required) {\n propType += ` = ${this.nullStr}`;\n }\n propDef = `${indent}${propName}: ${propType}`;\n }\n return propDef;\n }\n\n private methodReturnType(method: IMethod) {\n const type = this.typeMapMethods(method.type);\n let returnType = type.name;\n if (method.responseIsBoth()) {\n returnType = `Union[${returnType}, bytes]`;\n } else if (method.responseIsBinary()) {\n returnType = 'bytes';\n }\n return returnType;\n }\n\n // because Python has named default parameters, Request types are not required like\n // they are for TypeScript\n methodSignature(indent: string, method: IMethod) {\n const returnType = this.methodReturnType(method);\n const bump = this.bumper(indent);\n const params: string[] = [];\n const args = method.allParams;\n if (args && args.length > 0) {\n method.allParams.forEach((p) =>\n params.push(this.declareParameter(bump, method, p))\n );\n }\n let head = method.description?.trim();\n head =\n (head ? `${head}\\n\\n` : '') +\n `${method.httpMethod} ${method.endpoint} -> ${returnType}`;\n params.push(\n `${bump}transport_options: Optional[transport.TransportOptions] = None,`\n );\n return (\n this.commentHeader(indent, head) +\n `${indent}def ${method.name}(\\n` +\n `${bump}self${params.length > 0 ? ',\\n' : ''}` +\n `${params.join(this.paramDelimiter)}\\n` +\n `${indent}) -> ${returnType}:\\n`\n );\n }\n\n declareParameter(indent: string, method: IMethod, param: IParameter) {\n let type: IType;\n if (param.location === strBody) {\n type = this.writeableType(param.type, method) || param.type;\n } else {\n type = param.type;\n }\n const mapped = this.typeMapMethods(type);\n const paramType = param.required ? mapped.name : `Optional[${mapped.name}]`;\n return (\n this.commentHeader(indent, describeParam(param)) +\n `${indent}${param.name}: ${paramType}` +\n (param.required ? '' : ` = ${mapped.default}`)\n );\n }\n\n makeTheCall(method: IMethod, inputs: ArgValues): string {\n const origDelim = this.argDelimiter;\n this.argDelimiter = `,\\n${this.indentStr}`;\n let resp = `response = sdk.${method.name}(`;\n const args = this.assignParams(method, inputs);\n if (args.match(/\\bmdls\\b/)) {\n resp = 'from looker_sdk import models as mdls\\n\\n' + resp;\n }\n this.argDelimiter = origDelim;\n return `${resp}${args})`;\n }\n\n initArg(indent: string, property: IProperty) {\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n return `${indent}self.${propName} = ${propName}`;\n }\n\n declareType(indent: string, type: IType) {\n let decl = super.declareType(indent, type);\n if (type instanceof EnumType) {\n const invalid =\n 'invalid_api_enum_value = \"invalid_api_enum_value\"' +\n '\\n\\n\\n# https://github.com/python/mypy/issues/2427' +\n `\\n${type.name}.__new__ = model.safe_enum__new__ # type: ignore`;\n decl += `\\n${this.bumper(indent)}${invalid}`;\n }\n return decl;\n }\n\n typeProperties(type: IType) {\n return Object.values(type.requiredProperties).concat(\n Object.values(type.optionalProperties)\n );\n }\n\n private isBareForwardRef = (prop: IProperty) => {\n // contains a \"bare\" forward reference e.g. `result_format: \"ResultFormat\"`\n // so we need to emit the `__annotations__` property\n return (\n prop.required &&\n (prop.type.customType || prop.type instanceof EnumType) &&\n !['ArrayType', 'HashType', 'DelimArrayType'].includes(prop.type.className)\n );\n };\n\n /**\n * Ideally we'd rely on @attr.s to generate the constructor for us\n * However, neither Jedi (https://github.com/davidhalter/jedi-vim/issues/816)\n * nor microsoft/python-language-server\n * (https://github.com/microsoft/python-language-server/issues/399)\n * display good tooltips for these auto-generated __init__ methods. So for\n * now we'll generate them ourselves following the functionality of\n * @attr.s(kw_only=True) we'll only allow kw_args.\n */\n construct(indent: string, type: IType) {\n if (type instanceof EnumType) return '';\n indent = this.bumper(indent);\n const bump = this.bumper(indent);\n const annotations: string[] = [];\n const args: string[] = [];\n const inits: string[] = [];\n this.typeProperties(type).forEach((prop) => {\n annotations.push(this.declareProperty(indent, prop, true));\n args.push(this.declareConstructorArg('', prop));\n inits.push(this.initArg(bump, prop));\n });\n let result = '';\n if (Object.values(type.properties).some(this.isBareForwardRef)) {\n result =\n `\\n${indent}__annotations__ = {\\n` +\n `${annotations.join(',\\n')}` +\n `\\n${indent}}`;\n }\n result +=\n `\\n\\n${indent}def __init__(self, *${this.argDelimiter}` +\n `${args.join(this.argDelimiter)}):\\n` +\n inits.join('\\n');\n return result;\n }\n\n declareConstructorArg(indent: string, property: IProperty) {\n const mappedType = this.typeMapModels(property.type);\n let propType: string;\n if (property.required) {\n propType = mappedType.name;\n } else {\n propType = `Optional[${mappedType.name}] = ${this.nullStr}`;\n }\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n return `${indent}${propName}: ${propType}`;\n }\n\n // this is a builder function to produce arguments with optional null place holders but no extra required optional arguments\n argFill(current: string, args: string): string {\n if (!current && args.trim() === this.nullStr) {\n // Don't append trailing optional arguments if none have been set yet\n return '';\n }\n let delimiter = ',\\n';\n if (!current) {\n delimiter = '';\n // Caller manually inserted delimiter followed by inline comment\n } else if (args.match(/, {2}#/)) {\n delimiter = delimiter.replace(',', '');\n }\n return `${args}${delimiter}${current}`;\n }\n\n httpArgs(callerIndent: string, method: IMethod): string {\n const currIndent = this.bumper(callerIndent);\n let args = '';\n args = this.argFill(\n args,\n `${currIndent}transport_options=transport_options`\n );\n if (method.bodyArg) {\n args = this.argFill(args, `${currIndent}body=${method.bodyArg}`);\n }\n if (method.queryArgs.length) {\n const queryParams = this.argGroup('', method.queryArgs);\n args = this.argFill(args, `${currIndent}query_params=${queryParams}`);\n }\n let returnType = this.methodReturnType(method);\n if (method.responseIsBoth()) {\n // cattrs needs the python object Union[<rt>, bytes] in order\n // to properly deserialize the response. However, this argument\n // is passed as a value so we get a mypy error that the argument\n // has type \"object\" instead of TStructure. Hence the # type: ignore\n returnType += ', # type: ignore';\n }\n args = this.argFill(args, `${currIndent}structure=${returnType}`);\n let endpoint = `\"${method.endpoint}\"`;\n if (/\\{\\w+\\}/.test(endpoint)) {\n // avoid flake8: f-string is missing placeholders\n endpoint = `f${endpoint}`;\n }\n args = this.argFill(args, `${currIndent}path=${endpoint}`);\n return args;\n }\n\n httpCall(callerIndent: string, method: IMethod): string {\n // callOpener itself is nested inside a cast()\n const currIndent = this.bumper(callerIndent);\n let deprecation = '';\n if (method.name === 'login_user') {\n deprecation =\n `${callerIndent}warnings.warn(\"login_user behavior changed significantly ` +\n `in 21.4.0. See https://git.io/JOtH1\")\\n`;\n }\n const callOpener =\n `${callerIndent}response = cast(\\n` +\n `${currIndent}${this.methodReturnType(method)},\\n` +\n `${currIndent}${this.it(method.httpMethod.toLowerCase())}(\\n`;\n const callArgs = `${this.httpArgs(currIndent, method)}\\n`;\n const callCloser = `${currIndent})\\n${callerIndent})\\n`;\n const returnStmt = `${callerIndent}return response`;\n return deprecation + callOpener + callArgs + callCloser + returnStmt;\n }\n\n encodePathParams(indent: string, method: IMethod) {\n let encodings = '';\n const pathParams = method.pathParams;\n if (pathParams.length > 0) {\n for (const param of pathParams) {\n if (param.doEncode()) {\n encodings += `${indent}${param.name} = self.encode_path_param(${param.name})\\n`;\n }\n }\n }\n return encodings;\n }\n\n declareMethod(indent: string, method: IMethod) {\n const bump = this.bumper(indent);\n\n return (\n this.methodSignature(indent, method) +\n this.summary(bump, method.summary) +\n this.encodePathParams(bump, method) +\n this.httpCall(bump, method)\n );\n }\n\n typeSignature(indent: string, type: IType) {\n const bump = this.bumper(indent);\n const b2 = this.bumper(bump);\n const attrs: string[] = [];\n const isEnum = type instanceof EnumType;\n const baseClass = isEnum ? 'enum.Enum' : 'model.Model';\n let usesReservedPythonKeyword = false;\n\n if (!isEnum) {\n for (const prop of this.typeProperties(type)) {\n let propName = prop.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n usesReservedPythonKeyword = true;\n }\n let attr = `${b2}${propName}:`;\n if (prop.description) {\n attr += ` ${prop.description}`;\n }\n attrs.push(attr);\n }\n }\n\n if (usesReservedPythonKeyword) {\n this.hooks.push(\n `sr.converter${this.apiRef}.register_structure_hook(\\n${bump}${type.name}, # type: ignore\\n${bump}${this.structureHookTK} # type:ignore\\n)`\n );\n }\n\n let result =\n `\\n` +\n (isEnum ? '' : `${indent}@attr.s(auto_attribs=True, init=False)\\n`) +\n `${indent}class ${type.name}(${baseClass}):\\n` +\n `${bump}\"\"\"\\n` +\n (type.description ? `${bump}${type.description}\\n\\n` : '');\n\n if (attrs.length > 0) {\n result += `${bump}Attributes:\\n` + `${attrs.join('\\n')}\\n`;\n }\n\n return result + `${bump}\"\"\"\\n`;\n }\n\n summary(indent: string, text: string | undefined) {\n return text ? `${indent}\"\"\"${text}\"\"\"\\n` : '';\n }\n\n // when format is \"methods\" that means we're in the methods.py module\n // and we need to reference the type by the `mdls.` package name\n prefixModelsNamespace(\n name: string,\n format: 'models' | 'methods',\n forwardRef = false\n ): string {\n if (format === 'models') {\n // need to quote this forwardRef\n name = forwardRef ? `\"${name}\"` : name;\n } else if (format === 'methods') {\n name = `mdls.${name}`;\n }\n return name;\n }\n\n // hack default format to 'methods' so that argValue() calls the right thing\n typeMap(type: IType, format: 'models' | 'methods' = 'methods'): IMappedType {\n const asString: CodeAssignment = (_, v) => `\"${v}\"`;\n const pythonTypes: Record<string, IMappedType> = {\n any: { default: this.nullStr, name: 'Any' },\n boolean: { default: this.nullStr, name: 'bool' },\n byte: { default: this.nullStr, name: 'bytes' },\n datetime: { default: this.nullStr, name: 'datetime.datetime' },\n double: { default: this.nullStr, name: 'float' },\n float: { default: this.nullStr, name: 'float' },\n int32: { default: this.nullStr, name: 'int' },\n int64: { default: this.nullStr, name: 'int' },\n integer: { default: this.nullStr, name: 'int' },\n number: { default: this.nullStr, name: 'float' },\n password: { default: this.nullStr, name: 'str', asVal: asString },\n string: { default: this.nullStr, name: 'str', asVal: asString },\n object: { default: this.nullStr, name: 'str', asVal: asString },\n uri: { default: this.nullStr, name: 'str', asVal: asString },\n void: { default: this.nullStr, name: 'None' },\n };\n\n super.typeMap(type);\n if (type.elementType) {\n const map = this.typeMap(type.elementType, format);\n let typeName: string;\n let name: string;\n const defaultValue = this.nullStr;\n let asVal: CodeAssignment | undefined;\n switch (type.className) {\n case 'ArrayType':\n typeName = 'Sequence';\n name = `${typeName}[${map.name}]`;\n break;\n case 'HashType':\n typeName = 'MutableMapping';\n // TODO fix bad API spec, like MergeQuery vis_config\n name =\n typeName +\n '[str, ' +\n (type.elementType.name === 'string' ? 'Any' : map.name) +\n ']';\n break;\n case 'DelimArrayType':\n typeName = this.prefixModelsNamespace('DelimSequence', format);\n name = `${typeName}[${map.name}]`;\n asVal = (_, v) => `${typeName}([${v}])`;\n break;\n case 'EnumType':\n name = typeName = this.prefixModelsNamespace(type.name, format, true);\n asVal = (_, v) => `${typeName}.${v}`;\n break;\n default:\n throw new Error(`Don't know how to handle: ${JSON.stringify(type)}`);\n }\n const mt: IMappedType = { default: defaultValue, name: name };\n if (asVal) {\n mt.asVal = asVal;\n }\n return mt;\n }\n if (!type.name) {\n throw new Error('Cannot output a nameless type.');\n }\n const name = this.prefixModelsNamespace(\n type.name,\n format,\n !!type.customType\n );\n const result = pythonTypes[type.name];\n return result || { default: this.nullStr, name: name };\n }\n\n typeMapMethods(type: IType) {\n return this.typeMap(type, 'methods');\n }\n\n typeMapModels(type: IType) {\n return this.typeMap(type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ACA,IAAMqJ,EAAe,GAAG;QAAEtF,OAAO,EAAEkF,YAAY;QAAErH,IAAI,EAAEA;MAAK,CAAC;MAC7D,IAAI6G,KAAK,EAAE;QACTY,EAAE,CAACZ,KAAK,GAAGA,KAAK;MAClB;MACA,OAAOY,EAAE;IACX;IACA,IAAI,CAACrJ,IAAI,CAAC4B,IAAI,EAAE;MACd,MAAM,IAAIsH,KAAK,CAAC,gCAAgC,CAAC;IACnD;IACA,IAAMtH,IAAI,GAAG,IAAI,CAAC0F,qBAAqB,CACrCtH,IAAI,CAAC4B,IAAI,EACT2F,MAAM,EACN,CAAC,CAACvH,IAAI,CAACC,UACT,CAAC;IACD,IAAMiF,MAAM,GAAG2C,WAAW,CAAC7H,IAAI,CAAC4B,IAAI,CAAC;IACrC,OAAOsD,MAAM,IAAI;MAAEnB,OAAO,EAAE,IAAI,CAACpD,OAAO;MAAEiB,IAAI,EAAEA;IAAK,CAAC;EACxD;EAEAU,cAAcA,CAACtC,IAAW,EAAE;IAC1B,OAAO,IAAI,CAACyH,OAAO,CAACzH,IAAI,EAAE,SAAS,CAAC;EACtC;EAEA0B,aAAaA,CAAC1B,IAAW,EAAE;IACzB,OAAO,IAAI,CAACyH,OAAO,CAACzH,IAAI,EAAE,QAAQ,CAAC;EACrC;AACF;AAACsJ,OAAA,CAAAzK,SAAA,GAAAA,SAAA"}
@@ -15,7 +15,7 @@ export declare enum TypeOfType {
15
15
  }
16
16
  export declare const typeOfType: (type: IType) => TypeOfType;
17
17
  export declare const isSpecialName: (name: string) => boolean;
18
- export declare type ArgValues = {
18
+ export type ArgValues = {
19
19
  [key: string]: any;
20
20
  };
21
21
  export declare const safeName: (value: string) => string;
@@ -49,14 +49,14 @@ export interface IParameter extends ITypedSymbol {
49
49
  doEncode(): boolean;
50
50
  }
51
51
  export declare const describeParam: (param: IParameter) => string;
52
- export declare type KeyedCollection<T> = Record<string, T>;
53
- export declare type MethodList = KeyedCollection<IMethod>;
54
- export declare type TypeList = KeyedCollection<IType>;
55
- export declare type TagList = KeyedCollection<MethodList>;
56
- export declare type TypeTagList = KeyedCollection<TypeList>;
57
- export declare type PropertyList = KeyedCollection<IProperty>;
58
- export declare type KeyList = Set<string>;
59
- export declare type EnumValueType = string | number;
52
+ export type KeyedCollection<T> = Record<string, T>;
53
+ export type MethodList = KeyedCollection<IMethod>;
54
+ export type TypeList = KeyedCollection<IType>;
55
+ export type TagList = KeyedCollection<MethodList>;
56
+ export type TypeTagList = KeyedCollection<TypeList>;
57
+ export type PropertyList = KeyedCollection<IProperty>;
58
+ export type KeyList = Set<string>;
59
+ export type EnumValueType = string | number;
60
60
  export declare const keyValues: (list: KeyList) => string[];
61
61
  export declare const mayQuote: (value: any, quoteChar?: string) => string;
62
62
  export declare const methodRefs: (api: IApiModel, refs: KeyList) => IMethod[];
@@ -78,8 +78,8 @@ export declare enum SearchCriterion {
78
78
  status = 8,
79
79
  response = 9
80
80
  }
81
- export declare type SearchCriterionTerm = keyof typeof SearchCriterion;
82
- export declare type SearchCriteria = Set<SearchCriterion>;
81
+ export type SearchCriterionTerm = keyof typeof SearchCriterion;
82
+ export type SearchCriteria = Set<SearchCriterion>;
83
83
  export declare const SearchAll: SearchCriteria;
84
84
  export declare const criteriaToSet: (criteria: string[]) => SearchCriteria;
85
85
  export declare const setToCriteria: (criteria: SearchCriteria) => string[];
@@ -140,7 +140,7 @@ export interface IMethodResponse {
140
140
  search(rx: RegExp, criteria: SearchCriteria): boolean;
141
141
  searchString(criteria: SearchCriteria): string;
142
142
  }
143
- export declare const tagTypes: (api: ApiModel, types: TypeList) => {};
143
+ export declare const tagTypes: (api: ApiModel, types: TypeList) => any;
144
144
  export interface IProperty extends ITypedSymbol {
145
145
  required: boolean;
146
146
  nullable: boolean;
@@ -418,7 +418,7 @@ export declare class ApiModel implements ISymbolTable, IApiModel {
418
418
  resolveType(schema: string | OAS.SchemaObject | OAS.ReferenceObject, style?: string, typeName?: string, methodName?: string): IType;
419
419
  private requestTypeName;
420
420
  makeRequestType(method: IMethod): RequestType;
421
- registerEnum(type: IType, methodName?: string): IType;
421
+ registerEnum(type: IType, methodName?: string): IType | EnumType;
422
422
  private _getRequestType;
423
423
  getRequestType(method: IMethod): IType | undefined;
424
424
  getEnumList(): TypeList;
package/lib/sdkModels.js CHANGED
@@ -8,23 +8,20 @@ var OAS = _interopRequireWildcard(require("openapi3-ts"));
8
8
  var _blueimpMd = _interopRequireDefault(require("blueimp-md5"));
9
9
  var _sdkRtl = require("@looker/sdk-rtl");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
15
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
17
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
- var strBody = 'body';
19
- exports.strBody = strBody;
20
- var strRequest = 'Request';
21
- exports.strRequest = strRequest;
22
- var strWrite = 'Write';
23
- exports.strWrite = strWrite;
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
17
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
+ var strBody = exports.strBody = 'body';
19
+ var strRequest = exports.strRequest = 'Request';
20
+ var strWrite = exports.strWrite = 'Write';
24
21
  var lookerValuesTag = 'x-looker-values';
25
22
  var enumTag = 'enum';
26
23
  var simpleName = /^[a-z_][a-z_\d]*(\[])?$/im;
27
- var TypeOfType = function (TypeOfType) {
24
+ var TypeOfType = exports.TypeOfType = function (TypeOfType) {
28
25
  TypeOfType[TypeOfType["Intrinsic"] = 0] = "Intrinsic";
29
26
  TypeOfType[TypeOfType["Array"] = 1] = "Array";
30
27
  TypeOfType[TypeOfType["Hash"] = 2] = "Hash";
@@ -33,7 +30,6 @@ var TypeOfType = function (TypeOfType) {
33
30
  TypeOfType[TypeOfType["Complex"] = 5] = "Complex";
34
31
  return TypeOfType;
35
32
  }({});
36
- exports.TypeOfType = TypeOfType;
37
33
  var typeOfType = type => {
38
34
  if (type.intrinsic) return TypeOfType.Intrinsic;
39
35
  switch (type.className) {
@@ -100,13 +96,12 @@ var keyValues = list => {
100
96
  return Array.from(list.values()).sort();
101
97
  };
102
98
  exports.keyValues = keyValues;
103
- var mayQuote = function mayQuote(value) {
99
+ var mayQuote = exports.mayQuote = function mayQuote(value) {
104
100
  var quoteChar = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "'";
105
101
  var str = value.toString();
106
102
  if (!isSpecialName(str)) return str;
107
103
  return "".concat(quoteChar).concat(str).concat(quoteChar);
108
104
  };
109
- exports.mayQuote = mayQuote;
110
105
  var methodRefs = (api, refs) => {
111
106
  var keys = keyValues(refs);
112
107
  var result = [];
@@ -130,7 +125,7 @@ var typeRefs = (api, refs) => {
130
125
  return result;
131
126
  };
132
127
  exports.typeRefs = typeRefs;
133
- var firstMethodRef = function firstMethodRef(api, type) {
128
+ var firstMethodRef = exports.firstMethodRef = function firstMethodRef(api, type) {
134
129
  var stack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
135
130
  stack.add(type.name);
136
131
  var method = methodRefs(api, type.methodRefs)[0];
@@ -145,7 +140,6 @@ var firstMethodRef = function firstMethodRef(api, type) {
145
140
  }
146
141
  return method;
147
142
  };
148
- exports.firstMethodRef = firstMethodRef;
149
143
  var anyWriter = function anyWriter(api, type) {
150
144
  var stack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
151
145
  var result;
@@ -171,7 +165,7 @@ var anyWriter = function anyWriter(api, type) {
171
165
  }
172
166
  return result;
173
167
  };
174
- var SearchCriterion = function (SearchCriterion) {
168
+ var SearchCriterion = exports.SearchCriterion = function (SearchCriterion) {
175
169
  SearchCriterion[SearchCriterion["method"] = 0] = "method";
176
170
  SearchCriterion[SearchCriterion["type"] = 1] = "type";
177
171
  SearchCriterion[SearchCriterion["name"] = 2] = "name";
@@ -184,9 +178,7 @@ var SearchCriterion = function (SearchCriterion) {
184
178
  SearchCriterion[SearchCriterion["response"] = 9] = "response";
185
179
  return SearchCriterion;
186
180
  }({});
187
- exports.SearchCriterion = SearchCriterion;
188
- var SearchAll = new Set([SearchCriterion.method, SearchCriterion.type, SearchCriterion.name, SearchCriterion.description, SearchCriterion.argument, SearchCriterion.property, SearchCriterion.title, SearchCriterion.activityType, SearchCriterion.status, SearchCriterion.response]);
189
- exports.SearchAll = SearchAll;
181
+ var SearchAll = exports.SearchAll = new Set([SearchCriterion.method, SearchCriterion.type, SearchCriterion.name, SearchCriterion.description, SearchCriterion.argument, SearchCriterion.property, SearchCriterion.title, SearchCriterion.activityType, SearchCriterion.status, SearchCriterion.response]);
190
182
  var criteriaToSet = criteria => {
191
183
  var result = new Set();
192
184
  criteria.forEach(name => {
@@ -202,7 +194,7 @@ var setToCriteria = criteria => {
202
194
  return result;
203
195
  };
204
196
  exports.setToCriteria = setToCriteria;
205
- var MetaType = function (MetaType) {
197
+ var MetaType = exports.MetaType = function (MetaType) {
206
198
  MetaType["Intrinsic"] = "Intrinsic";
207
199
  MetaType["Specification"] = "Specification";
208
200
  MetaType["Write"] = "Write";
@@ -210,7 +202,6 @@ var MetaType = function (MetaType) {
210
202
  MetaType["Enumerated"] = "Enumerated";
211
203
  return MetaType;
212
204
  }({});
213
- exports.MetaType = MetaType;
214
205
  var tagTypes = (api, types) => {
215
206
  var typeTags = {};
216
207
  Object.entries(types).filter(_ref => {
@@ -1051,7 +1042,6 @@ class ApiModel {
1051
1042
  _defineProperty(this, "types", {});
1052
1043
  _defineProperty(this, "tags", {});
1053
1044
  _defineProperty(this, "typeTags", {});
1054
- ;
1055
1045
  ['string', 'integer', 'int64', 'boolean', 'object', 'uri', 'float', 'double', 'void', 'datetime', 'email', 'uuid', 'uri', 'hostname', 'ipv4', 'ipv6', 'any'].forEach(name => this.types[name] = new IntrinsicType(name));
1056
1046
  this.load();
1057
1047
  }