@looker/sdk-codegen-scripts 21.5.24 → 21.5.25

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.
package/CHANGELOG.md CHANGED
@@ -160,6 +160,15 @@
160
160
  * @looker/sdk-codegen-utils bumped from 21.0.13 to 21.0.14
161
161
  * @looker/sdk-node bumped from 24.16.1 to 24.16.2
162
162
 
163
+ ### Dependencies
164
+
165
+ * The following workspace dependencies were updated
166
+ * dependencies
167
+ * @looker/sdk bumped from 24.16.2 to 24.18.0
168
+ * @looker/sdk-codegen bumped from 21.9.3 to 21.9.4
169
+ * @looker/sdk-codegen-utils bumped from 21.0.14 to 21.0.15
170
+ * @looker/sdk-node bumped from 24.16.2 to 24.18.0
171
+
163
172
  ## [21.5.23](https://github.com/looker-open-source/sdk-codegen/compare/sdk-codegen-scripts-v21.5.22...sdk-codegen-scripts-v21.5.23) (2024-09-14)
164
173
 
165
174
 
@@ -202,4 +202,4 @@ var baseUrl = sdk.authSession.settings.base_url;
202
202
  }));
203
203
  });
204
204
  });
205
- //# sourceMappingURL=convert.apitest.js.map
205
+ //# sourceMappingURL=convert.apispec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"convert.apitest.js","names":["_fs","require","_nodeTest","_expect","_cloneDeep","_interopRequireDefault","_isEmpty","_sdkNode","_sdkCodegen","_sdkCodegenUtils","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","swaggerFrag","openApiFrag","specFrag","swagger","JSON","parse","api","config","TestConfig","specToModel","swaggerFile","testFile","apiFile","swaggerSource","readFileSync","fullSwagger","apiSource","settings","NodeSettingsIniFile","localIni","sdk","LookerNodeSDK","init40","baseUrl","authSession","base_url","describe","it","actual","swapXLookerTags","expect","toContain","not","openApiStyle","toEqual","toBeUndefined","fixConversion","spec","fixes","toHaveLength","onlyPublic","specs","filter","v","status","toBeDefined","getLookerSpecs","looker_release_version","current_version","version","supported","supported_versions","versions","getSpecLinks","forEach","name","url","isEmpty","current","find","s","links","link","replace","substring","indexOf","loadSpecs","description","op","paths","get","param","parameters","convertParam","expected","defs","definitions","convertDefs","keys","Object","length","skip","upgradeSpec","left","ApiModel","fromString","right","diff","compareSpecs","full_version","swagger_url","api_server_url","getSpecsFromVersions","entries","_ref6","_","a","isDefault","moar","cloneDeep","push"],"sources":["../src/convert.apitest.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 { readFileSync } from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport { LookerNodeSDK, NodeSettingsIniFile } from '@looker/sdk-node';\nimport type { ISpecItem } from '@looker/sdk-codegen';\nimport {\n ApiModel,\n compareSpecs,\n convertDefs,\n convertParam,\n fixConversion,\n getLookerSpecs,\n getSpecLinks,\n getSpecsFromVersions,\n loadSpecs,\n openApiStyle,\n specToModel,\n swapXLookerTags,\n upgradeSpec,\n} from '@looker/sdk-codegen';\nimport { TestConfig, testFile } from '@looker/sdk-codegen-utils';\n\nconst swaggerFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"collectionFormat\": \"csv\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"body\",\n \"in\": \"body\",\n \"description\": \"Dashboard\",\n \"required\": false,\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"type\": \"boolean\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"schema\": {\n \"$ref\": \"#/definitions/ValidationError\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst openApiFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"style\": \"simple\",\n \"explode\": false,\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n },\n \"description\": \"Dashboard\"\n },\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationError\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst specFrag = `\n\"can\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"boolean\"\n },\n \"readOnly\": true,\n \"description\": \"Operations the current user is able to perform on this object\",\n \"x-looker-nullable\": false\n},\n\"content_favorite_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Content Favorite Id\",\n \"x-looker-nullable\": true\n},\n\"content_metadata_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Id of content metadata\",\n \"x-looker-nullable\": true\n},\n\"description\": {\n \"type\": \"string\",\n \"readOnly\": true,\n \"description\": \"Description\",\n \"x-looker-nullable\": true\n},\n\"hidden\": {\n \"type\": \"boolean\",\n \"readOnly\": true,\n \"description\": \"Is Hidden\",\n \"x-looker-nullable\": false,\n \"x-looker-deprecated\": true,\n},\n\"supported_formats\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"readOnly\": true,\n \"x-looker-values\": [\n \"txt\",\n \"csv\",\n \"inline_json\",\n \"json\",\n \"json_label\",\n \"json_detail\",\n \"json_detail_lite_stream\",\n \"xlsx\",\n \"html\",\n \"wysiwyg_pdf\",\n \"assembled_pdf\",\n \"wysiwyg_png\",\n \"csv_zip\"\n ],\n \"description\": \"A list of data formats the integration supports. If unspecified, the default is all data formats. Valid values are: \\\\\"txt\\\\\", \\\\\"csv\\\\\", \\\\\"inline_json\\\\\", \\\\\"json\\\\\", \\\\\"json_label\\\\\", \\\\\"json_detail\\\\\", \\\\\"json_detail_lite_stream\\\\\", \\\\\"xlsx\\\\\", \\\\\"html\\\\\", \\\\\"wysiwyg_pdf\\\\\", \\\\\"assembled_pdf\\\\\", \\\\\"wysiwyg_png\\\\\", \\\\\"csv_zip\\\\\".\",\n \"nullable\": false\n},\n`;\n\nconst swagger = JSON.parse(swaggerFrag);\nconst api = JSON.parse(openApiFrag);\n\nconst config = TestConfig(specToModel);\nconst swaggerFile = testFile('Looker.4.0.json');\nconst apiFile = testFile('Looker.4.0.oas.json');\nconst swaggerSource = readFileSync(swaggerFile, 'utf-8');\nconst fullSwagger = JSON.parse(swaggerSource);\nconst apiSource = readFileSync(apiFile, 'utf-8');\nconst settings = new NodeSettingsIniFile(\n 'LOOKERSDK',\n config.localIni,\n 'Looker'\n);\nconst sdk = LookerNodeSDK.init40(settings);\nconst baseUrl = sdk.authSession.settings.base_url;\n\ndescribe('spec conversion', () => {\n it('swaps out x-looker-tags', () => {\n const actual = swapXLookerTags(specFrag);\n expect(actual).toContain('\"nullable\": true');\n expect(actual).not.toContain('\"x-looker-nullable\": true');\n expect(actual).toContain('\"enum\": [');\n expect(actual).not.toContain('\"x-looker-values\": [');\n expect(actual).toContain('\"deprecated\": true');\n expect(actual).not.toContain('\"x-looker-deprecated\"');\n });\n\n it('collectionFormat to style', () => {\n expect(openApiStyle('csv')).toEqual('simple');\n expect(openApiStyle('ssv')).toEqual('spaceDelimited');\n expect(openApiStyle('pipes')).toEqual('pipeDelimited');\n expect(openApiStyle('tabs')).toBeUndefined();\n });\n\n it('fixes missing conversion items', () => {\n const actual = fixConversion(openApiFrag, swaggerFrag);\n expect(actual.spec).toContain(`\"style\":\"simple\"`);\n expect(actual.fixes).not.toHaveLength(0);\n });\n\n describe('spec retrieval', () => {\n const onlyPublic = (specs: ISpecItem[]) => {\n return specs.filter(v => v.status !== 'undocumented');\n };\n\n it('gets looker specs', async () => {\n expect(baseUrl).toBeDefined();\n const actual = await getLookerSpecs(sdk, baseUrl);\n expect(actual).toBeDefined();\n expect(actual.looker_release_version).not.toEqual('');\n expect(actual.current_version.version).not.toEqual('');\n const supported = onlyPublic(actual.supported_versions);\n expect(supported).toHaveLength(1);\n });\n\n it('gets spec links', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const actual = getSpecLinks(versions);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(spec.name).not.toEqual('');\n expect(spec.version).not.toEqual('');\n expect(spec.status).not.toEqual('');\n expect(spec.url).not.toEqual('');\n expect(isEmpty(spec.api)).toEqual(true);\n });\n const current = actual.find(s => s.status === 'current');\n expect(current).toBeDefined();\n actual.forEach(spec => expect(isEmpty(spec.api)).toEqual(true));\n });\n\n it('fetches and parses all specs', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const links = getSpecLinks(versions);\n links.forEach(\n link =>\n (link.url = link.url.replace(\n link.url.substring(0, link.url.indexOf('/api/')),\n baseUrl\n ))\n );\n const actual = await loadSpecs(sdk, links);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(isEmpty(spec.api)).toEqual(false);\n expect(spec.api.version).not.toEqual('');\n expect(spec.api.description).not.toEqual('');\n });\n });\n });\n\n describe('spec upgrade', () => {\n it('converts a swagger array param', () => {\n const op = swagger.paths['/query_tasks/multi_results'].get;\n const param = op.parameters[0];\n const actual = convertParam(param);\n expect(actual).toBeDefined();\n const expected =\n api.paths['/query_tasks/multi_results'].get.parameters[0];\n expect(actual).toEqual(expected);\n });\n\n it('converts all definitions', () => {\n const defs = fullSwagger.definitions;\n const actual = convertDefs(defs);\n expect(actual).toBeDefined();\n const keys = Object.keys(actual);\n expect(keys).toHaveLength(Object.keys(defs).length);\n });\n\n it.skip('matches a reference OpenAPI conversion', () => {\n // TODO There is a different branch to address this\n const spec = upgradeSpec(swaggerSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n\n it('passes through an existing OpenAPI spec', () => {\n const spec = upgradeSpec(apiSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n });\n\n describe('getSpecsFromVersions', () => {\n const versions = {\n looker_release_version: '21.3.0',\n current_version: {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n supported_versions: [\n {\n version: '2.99',\n full_version: '2.99.0',\n status: 'internal_test',\n swagger_url: 'http://localhost:19999/api/2.99/swagger.json',\n },\n {\n version: '3.0',\n full_version: '3.0.0',\n status: 'legacy',\n swagger_url: 'http://localhost:19999/api/3.0/swagger.json',\n },\n {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n {\n version: '4.0',\n full_version: '4.0.21.3',\n status: 'experimental',\n swagger_url: 'http://localhost:19999/api/4.0/swagger.json',\n },\n ],\n api_server_url: 'http://localhost:19999',\n };\n\n it('only gets supported specifications', async () => {\n const actual = await getSpecsFromVersions(versions);\n expect(Object.keys(actual)).toEqual(['3.1', '4.0']);\n });\n\n it('current is the default spec', async () => {\n const specs = await getSpecsFromVersions(versions);\n const actual = Object.entries(specs).find(\n ([_, a]) => a.status === 'current'\n );\n expect(actual).toBeDefined();\n if (actual) {\n const [, current] = actual;\n expect(current).toBeDefined();\n expect(current.status).toEqual('current');\n expect(current.isDefault).toEqual(true);\n }\n });\n\n it('specs have unique keys', async () => {\n const moar = cloneDeep(versions);\n moar.supported_versions.push(\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/u.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un3.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un4.json',\n }\n );\n const actual = await getSpecsFromVersions(moar);\n expect(Object.keys(actual)).toEqual([\n '3.1',\n '4.0',\n '4.0u',\n '4.0un',\n '4.0un3',\n '4.0un4',\n ]);\n });\n });\n});\n"],"mappings":";;AA0BA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAEA,IAAAO,WAAA,GAAAP,OAAA;AAeA,IAAAQ,gBAAA,GAAAR,OAAA;AAAiE,SAAAI,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,IAAA,IAAAT,OAAA,CAAAO,KAAA,YAAAG,OAAA,CAAAV,OAAA,CAAAO,KAAA,EAAAI,IAAA,CAAAT,KAAA,EAAAC,MAAA;AAAA,SAAAS,kBAAAC,EAAA,6BAAAC,IAAA,SAAAC,IAAA,GAAAC,SAAA,aAAAN,OAAA,WAAAV,OAAA,EAAAC,MAAA,QAAAF,GAAA,GAAAc,EAAA,CAAAI,KAAA,CAAAH,IAAA,EAAAC,IAAA,YAAAb,MAAAK,KAAA,IAAAT,kBAAA,CAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAA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,EAAE;MACf,CAAC,EACD;QACEzC,OAAO,EAAE,KAAK;QACdwC,YAAY,EAAE,MAAM;QACpB7C,MAAM,EAAE,IAAI;QACZ8C,WAAW,EAAE;MACf,CACF,CAAC;MACD,IAAM9D,MAAM,SAAS,IAAAgE,gCAAoB,EAACM,IAAI,CAAC;MAC/C,IAAApE,cAAM,EAACiD,MAAM,CAACD,IAAI,CAAClD,MAAM,CAAC,CAAC,CAACM,OAAO,CAAC,CAClC,KAAK,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,CACT,CAAC;IACJ,CAAC,EAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"convert.apispec.js","names":["_fs","require","_nodeTest","_expect","_cloneDeep","_interopRequireDefault","_isEmpty","_sdkNode","_sdkCodegen","_sdkCodegenUtils","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","swaggerFrag","openApiFrag","specFrag","swagger","JSON","parse","api","config","TestConfig","specToModel","swaggerFile","testFile","apiFile","swaggerSource","readFileSync","fullSwagger","apiSource","settings","NodeSettingsIniFile","localIni","sdk","LookerNodeSDK","init40","baseUrl","authSession","base_url","describe","it","actual","swapXLookerTags","expect","toContain","not","openApiStyle","toEqual","toBeUndefined","fixConversion","spec","fixes","toHaveLength","onlyPublic","specs","filter","v","status","toBeDefined","getLookerSpecs","looker_release_version","current_version","version","supported","supported_versions","versions","getSpecLinks","forEach","name","url","isEmpty","current","find","s","links","link","replace","substring","indexOf","loadSpecs","description","op","paths","get","param","parameters","convertParam","expected","defs","definitions","convertDefs","keys","Object","length","skip","upgradeSpec","left","ApiModel","fromString","right","diff","compareSpecs","full_version","swagger_url","api_server_url","getSpecsFromVersions","entries","_ref6","_","a","isDefault","moar","cloneDeep","push"],"sources":["../src/convert.apispec.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 { readFileSync } from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport { LookerNodeSDK, NodeSettingsIniFile } from '@looker/sdk-node';\nimport type { ISpecItem } from '@looker/sdk-codegen';\nimport {\n ApiModel,\n compareSpecs,\n convertDefs,\n convertParam,\n fixConversion,\n getLookerSpecs,\n getSpecLinks,\n getSpecsFromVersions,\n loadSpecs,\n openApiStyle,\n specToModel,\n swapXLookerTags,\n upgradeSpec,\n} from '@looker/sdk-codegen';\nimport { TestConfig, testFile } from '@looker/sdk-codegen-utils';\n\nconst swaggerFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"collectionFormat\": \"csv\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"body\",\n \"in\": \"body\",\n \"description\": \"Dashboard\",\n \"required\": false,\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"type\": \"boolean\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"schema\": {\n \"$ref\": \"#/definitions/ValidationError\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst openApiFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"style\": \"simple\",\n \"explode\": false,\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n },\n \"description\": \"Dashboard\"\n },\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationError\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst specFrag = `\n\"can\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"boolean\"\n },\n \"readOnly\": true,\n \"description\": \"Operations the current user is able to perform on this object\",\n \"x-looker-nullable\": false\n},\n\"content_favorite_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Content Favorite Id\",\n \"x-looker-nullable\": true\n},\n\"content_metadata_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Id of content metadata\",\n \"x-looker-nullable\": true\n},\n\"description\": {\n \"type\": \"string\",\n \"readOnly\": true,\n \"description\": \"Description\",\n \"x-looker-nullable\": true\n},\n\"hidden\": {\n \"type\": \"boolean\",\n \"readOnly\": true,\n \"description\": \"Is Hidden\",\n \"x-looker-nullable\": false,\n \"x-looker-deprecated\": true,\n},\n\"supported_formats\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"readOnly\": true,\n \"x-looker-values\": [\n \"txt\",\n \"csv\",\n \"inline_json\",\n \"json\",\n \"json_label\",\n \"json_detail\",\n \"json_detail_lite_stream\",\n \"xlsx\",\n \"html\",\n \"wysiwyg_pdf\",\n \"assembled_pdf\",\n \"wysiwyg_png\",\n \"csv_zip\"\n ],\n \"description\": \"A list of data formats the integration supports. If unspecified, the default is all data formats. Valid values are: \\\\\"txt\\\\\", \\\\\"csv\\\\\", \\\\\"inline_json\\\\\", \\\\\"json\\\\\", \\\\\"json_label\\\\\", \\\\\"json_detail\\\\\", \\\\\"json_detail_lite_stream\\\\\", \\\\\"xlsx\\\\\", \\\\\"html\\\\\", \\\\\"wysiwyg_pdf\\\\\", \\\\\"assembled_pdf\\\\\", \\\\\"wysiwyg_png\\\\\", \\\\\"csv_zip\\\\\".\",\n \"nullable\": false\n},\n`;\n\nconst swagger = JSON.parse(swaggerFrag);\nconst api = JSON.parse(openApiFrag);\n\nconst config = TestConfig(specToModel);\nconst swaggerFile = testFile('Looker.4.0.json');\nconst apiFile = testFile('Looker.4.0.oas.json');\nconst swaggerSource = readFileSync(swaggerFile, 'utf-8');\nconst fullSwagger = JSON.parse(swaggerSource);\nconst apiSource = readFileSync(apiFile, 'utf-8');\nconst settings = new NodeSettingsIniFile(\n 'LOOKERSDK',\n config.localIni,\n 'Looker'\n);\nconst sdk = LookerNodeSDK.init40(settings);\nconst baseUrl = sdk.authSession.settings.base_url;\n\ndescribe('spec conversion', () => {\n it('swaps out x-looker-tags', () => {\n const actual = swapXLookerTags(specFrag);\n expect(actual).toContain('\"nullable\": true');\n expect(actual).not.toContain('\"x-looker-nullable\": true');\n expect(actual).toContain('\"enum\": [');\n expect(actual).not.toContain('\"x-looker-values\": [');\n expect(actual).toContain('\"deprecated\": true');\n expect(actual).not.toContain('\"x-looker-deprecated\"');\n });\n\n it('collectionFormat to style', () => {\n expect(openApiStyle('csv')).toEqual('simple');\n expect(openApiStyle('ssv')).toEqual('spaceDelimited');\n expect(openApiStyle('pipes')).toEqual('pipeDelimited');\n expect(openApiStyle('tabs')).toBeUndefined();\n });\n\n it('fixes missing conversion items', () => {\n const actual = fixConversion(openApiFrag, swaggerFrag);\n expect(actual.spec).toContain(`\"style\":\"simple\"`);\n expect(actual.fixes).not.toHaveLength(0);\n });\n\n describe('spec retrieval', () => {\n const onlyPublic = (specs: ISpecItem[]) => {\n return specs.filter(v => v.status !== 'undocumented');\n };\n\n it('gets looker specs', async () => {\n expect(baseUrl).toBeDefined();\n const actual = await getLookerSpecs(sdk, baseUrl);\n expect(actual).toBeDefined();\n expect(actual.looker_release_version).not.toEqual('');\n expect(actual.current_version.version).not.toEqual('');\n const supported = onlyPublic(actual.supported_versions);\n expect(supported).toHaveLength(1);\n });\n\n it('gets spec links', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const actual = getSpecLinks(versions);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(spec.name).not.toEqual('');\n expect(spec.version).not.toEqual('');\n expect(spec.status).not.toEqual('');\n expect(spec.url).not.toEqual('');\n expect(isEmpty(spec.api)).toEqual(true);\n });\n const current = actual.find(s => s.status === 'current');\n expect(current).toBeDefined();\n actual.forEach(spec => expect(isEmpty(spec.api)).toEqual(true));\n });\n\n it('fetches and parses all specs', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const links = getSpecLinks(versions);\n links.forEach(\n link =>\n (link.url = link.url.replace(\n link.url.substring(0, link.url.indexOf('/api/')),\n baseUrl\n ))\n );\n const actual = await loadSpecs(sdk, links);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(isEmpty(spec.api)).toEqual(false);\n expect(spec.api.version).not.toEqual('');\n expect(spec.api.description).not.toEqual('');\n });\n });\n });\n\n describe('spec upgrade', () => {\n it('converts a swagger array param', () => {\n const op = swagger.paths['/query_tasks/multi_results'].get;\n const param = op.parameters[0];\n const actual = convertParam(param);\n expect(actual).toBeDefined();\n const expected =\n api.paths['/query_tasks/multi_results'].get.parameters[0];\n expect(actual).toEqual(expected);\n });\n\n it('converts all definitions', () => {\n const defs = fullSwagger.definitions;\n const actual = convertDefs(defs);\n expect(actual).toBeDefined();\n const keys = Object.keys(actual);\n expect(keys).toHaveLength(Object.keys(defs).length);\n });\n\n it.skip('matches a reference OpenAPI conversion', () => {\n // TODO There is a different branch to address this\n const spec = upgradeSpec(swaggerSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n\n it('passes through an existing OpenAPI spec', () => {\n const spec = upgradeSpec(apiSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n });\n\n describe('getSpecsFromVersions', () => {\n const versions = {\n looker_release_version: '21.3.0',\n current_version: {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n supported_versions: [\n {\n version: '2.99',\n full_version: '2.99.0',\n status: 'internal_test',\n swagger_url: 'http://localhost:19999/api/2.99/swagger.json',\n },\n {\n version: '3.0',\n full_version: '3.0.0',\n status: 'legacy',\n swagger_url: 'http://localhost:19999/api/3.0/swagger.json',\n },\n {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n {\n version: '4.0',\n full_version: '4.0.21.3',\n status: 'experimental',\n swagger_url: 'http://localhost:19999/api/4.0/swagger.json',\n },\n ],\n api_server_url: 'http://localhost:19999',\n };\n\n it('only gets supported specifications', async () => {\n const actual = await getSpecsFromVersions(versions);\n expect(Object.keys(actual)).toEqual(['3.1', '4.0']);\n });\n\n it('current is the default spec', async () => {\n const specs = await getSpecsFromVersions(versions);\n const actual = Object.entries(specs).find(\n ([_, a]) => a.status === 'current'\n );\n expect(actual).toBeDefined();\n if (actual) {\n const [, current] = actual;\n expect(current).toBeDefined();\n expect(current.status).toEqual('current');\n expect(current.isDefault).toEqual(true);\n }\n });\n\n it('specs have unique keys', async () => {\n const moar = cloneDeep(versions);\n moar.supported_versions.push(\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/u.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un3.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un4.json',\n }\n );\n const actual = await getSpecsFromVersions(moar);\n expect(Object.keys(actual)).toEqual([\n '3.1',\n '4.0',\n '4.0u',\n '4.0un',\n '4.0un3',\n '4.0un4',\n ]);\n });\n });\n});\n"],"mappings":";;AA0BA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UA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ACN,OAAO,EACP,QAAQ,EACR,QAAQ,CACT,CAAC;IACJ,CAAC,EAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -199,4 +199,4 @@ describe('spec conversion', () => {
199
199
  }));
200
200
  });
201
201
  });
202
- //# sourceMappingURL=convert.apitest.js.map
202
+ //# sourceMappingURL=convert.apispec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"convert.apitest.js","names":["readFileSync","describe","it","expect","cloneDeep","isEmpty","LookerNodeSDK","NodeSettingsIniFile","ApiModel","compareSpecs","convertDefs","convertParam","fixConversion","getLookerSpecs","getSpecLinks","getSpecsFromVersions","loadSpecs","openApiStyle","specToModel","swapXLookerTags","upgradeSpec","TestConfig","testFile","swaggerFrag","openApiFrag","specFrag","swagger","JSON","parse","api","config","swaggerFile","apiFile","swaggerSource","fullSwagger","apiSource","settings","localIni","sdk","init40","baseUrl","authSession","base_url","actual","toContain","not","toEqual","toBeUndefined","spec","fixes","toHaveLength","onlyPublic","specs","filter","v","status","_asyncToGenerator","toBeDefined","looker_release_version","current_version","version","supported","supported_versions","versions","forEach","name","url","current","find","s","links","link","replace","substring","indexOf","description","op","paths","get","param","parameters","expected","defs","definitions","keys","Object","length","skip","left","fromString","right","diff","full_version","swagger_url","api_server_url","entries","_ref6","_","a","isDefault","moar","push"],"sources":["../../src/convert.apitest.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 { readFileSync } from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport { LookerNodeSDK, NodeSettingsIniFile } from '@looker/sdk-node';\nimport type { ISpecItem } from '@looker/sdk-codegen';\nimport {\n ApiModel,\n compareSpecs,\n convertDefs,\n convertParam,\n fixConversion,\n getLookerSpecs,\n getSpecLinks,\n getSpecsFromVersions,\n loadSpecs,\n openApiStyle,\n specToModel,\n swapXLookerTags,\n upgradeSpec,\n} from '@looker/sdk-codegen';\nimport { TestConfig, testFile } from '@looker/sdk-codegen-utils';\n\nconst swaggerFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"collectionFormat\": \"csv\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"body\",\n \"in\": \"body\",\n \"description\": \"Dashboard\",\n \"required\": false,\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"type\": \"boolean\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"schema\": {\n \"$ref\": \"#/definitions/ValidationError\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst openApiFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"style\": \"simple\",\n \"explode\": false,\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n },\n \"description\": \"Dashboard\"\n },\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationError\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst specFrag = `\n\"can\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"boolean\"\n },\n \"readOnly\": true,\n \"description\": \"Operations the current user is able to perform on this object\",\n \"x-looker-nullable\": false\n},\n\"content_favorite_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Content Favorite Id\",\n \"x-looker-nullable\": true\n},\n\"content_metadata_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Id of content metadata\",\n \"x-looker-nullable\": true\n},\n\"description\": {\n \"type\": \"string\",\n \"readOnly\": true,\n \"description\": \"Description\",\n \"x-looker-nullable\": true\n},\n\"hidden\": {\n \"type\": \"boolean\",\n \"readOnly\": true,\n \"description\": \"Is Hidden\",\n \"x-looker-nullable\": false,\n \"x-looker-deprecated\": true,\n},\n\"supported_formats\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"readOnly\": true,\n \"x-looker-values\": [\n \"txt\",\n \"csv\",\n \"inline_json\",\n \"json\",\n \"json_label\",\n \"json_detail\",\n \"json_detail_lite_stream\",\n \"xlsx\",\n \"html\",\n \"wysiwyg_pdf\",\n \"assembled_pdf\",\n \"wysiwyg_png\",\n \"csv_zip\"\n ],\n \"description\": \"A list of data formats the integration supports. If unspecified, the default is all data formats. Valid values are: \\\\\"txt\\\\\", \\\\\"csv\\\\\", \\\\\"inline_json\\\\\", \\\\\"json\\\\\", \\\\\"json_label\\\\\", \\\\\"json_detail\\\\\", \\\\\"json_detail_lite_stream\\\\\", \\\\\"xlsx\\\\\", \\\\\"html\\\\\", \\\\\"wysiwyg_pdf\\\\\", \\\\\"assembled_pdf\\\\\", \\\\\"wysiwyg_png\\\\\", \\\\\"csv_zip\\\\\".\",\n \"nullable\": false\n},\n`;\n\nconst swagger = JSON.parse(swaggerFrag);\nconst api = JSON.parse(openApiFrag);\n\nconst config = TestConfig(specToModel);\nconst swaggerFile = testFile('Looker.4.0.json');\nconst apiFile = testFile('Looker.4.0.oas.json');\nconst swaggerSource = readFileSync(swaggerFile, 'utf-8');\nconst fullSwagger = JSON.parse(swaggerSource);\nconst apiSource = readFileSync(apiFile, 'utf-8');\nconst settings = new NodeSettingsIniFile(\n 'LOOKERSDK',\n config.localIni,\n 'Looker'\n);\nconst sdk = LookerNodeSDK.init40(settings);\nconst baseUrl = sdk.authSession.settings.base_url;\n\ndescribe('spec conversion', () => {\n it('swaps out x-looker-tags', () => {\n const actual = swapXLookerTags(specFrag);\n expect(actual).toContain('\"nullable\": true');\n expect(actual).not.toContain('\"x-looker-nullable\": true');\n expect(actual).toContain('\"enum\": [');\n expect(actual).not.toContain('\"x-looker-values\": [');\n expect(actual).toContain('\"deprecated\": true');\n expect(actual).not.toContain('\"x-looker-deprecated\"');\n });\n\n it('collectionFormat to style', () => {\n expect(openApiStyle('csv')).toEqual('simple');\n expect(openApiStyle('ssv')).toEqual('spaceDelimited');\n expect(openApiStyle('pipes')).toEqual('pipeDelimited');\n expect(openApiStyle('tabs')).toBeUndefined();\n });\n\n it('fixes missing conversion items', () => {\n const actual = fixConversion(openApiFrag, swaggerFrag);\n expect(actual.spec).toContain(`\"style\":\"simple\"`);\n expect(actual.fixes).not.toHaveLength(0);\n });\n\n describe('spec retrieval', () => {\n const onlyPublic = (specs: ISpecItem[]) => {\n return specs.filter(v => v.status !== 'undocumented');\n };\n\n it('gets looker specs', async () => {\n expect(baseUrl).toBeDefined();\n const actual = await getLookerSpecs(sdk, baseUrl);\n expect(actual).toBeDefined();\n expect(actual.looker_release_version).not.toEqual('');\n expect(actual.current_version.version).not.toEqual('');\n const supported = onlyPublic(actual.supported_versions);\n expect(supported).toHaveLength(1);\n });\n\n it('gets spec links', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const actual = getSpecLinks(versions);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(spec.name).not.toEqual('');\n expect(spec.version).not.toEqual('');\n expect(spec.status).not.toEqual('');\n expect(spec.url).not.toEqual('');\n expect(isEmpty(spec.api)).toEqual(true);\n });\n const current = actual.find(s => s.status === 'current');\n expect(current).toBeDefined();\n actual.forEach(spec => expect(isEmpty(spec.api)).toEqual(true));\n });\n\n it('fetches and parses all specs', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const links = getSpecLinks(versions);\n links.forEach(\n link =>\n (link.url = link.url.replace(\n link.url.substring(0, link.url.indexOf('/api/')),\n baseUrl\n ))\n );\n const actual = await loadSpecs(sdk, links);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(isEmpty(spec.api)).toEqual(false);\n expect(spec.api.version).not.toEqual('');\n expect(spec.api.description).not.toEqual('');\n });\n });\n });\n\n describe('spec upgrade', () => {\n it('converts a swagger array param', () => {\n const op = swagger.paths['/query_tasks/multi_results'].get;\n const param = op.parameters[0];\n const actual = convertParam(param);\n expect(actual).toBeDefined();\n const expected =\n api.paths['/query_tasks/multi_results'].get.parameters[0];\n expect(actual).toEqual(expected);\n });\n\n it('converts all definitions', () => {\n const defs = fullSwagger.definitions;\n const actual = convertDefs(defs);\n expect(actual).toBeDefined();\n const keys = Object.keys(actual);\n expect(keys).toHaveLength(Object.keys(defs).length);\n });\n\n it.skip('matches a reference OpenAPI conversion', () => {\n // TODO There is a different branch to address this\n const spec = upgradeSpec(swaggerSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n\n it('passes through an existing OpenAPI spec', () => {\n const spec = upgradeSpec(apiSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n });\n\n describe('getSpecsFromVersions', () => {\n const versions = {\n looker_release_version: '21.3.0',\n current_version: {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n supported_versions: [\n {\n version: '2.99',\n full_version: '2.99.0',\n status: 'internal_test',\n swagger_url: 'http://localhost:19999/api/2.99/swagger.json',\n },\n {\n version: '3.0',\n full_version: '3.0.0',\n status: 'legacy',\n swagger_url: 'http://localhost:19999/api/3.0/swagger.json',\n },\n {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n {\n version: '4.0',\n full_version: '4.0.21.3',\n status: 'experimental',\n swagger_url: 'http://localhost:19999/api/4.0/swagger.json',\n },\n ],\n api_server_url: 'http://localhost:19999',\n };\n\n it('only gets supported specifications', async () => {\n const actual = await getSpecsFromVersions(versions);\n expect(Object.keys(actual)).toEqual(['3.1', '4.0']);\n });\n\n it('current is the default spec', async () => {\n const specs = await getSpecsFromVersions(versions);\n const actual = Object.entries(specs).find(\n ([_, a]) => a.status === 'current'\n );\n expect(actual).toBeDefined();\n if (actual) {\n const [, current] = actual;\n expect(current).toBeDefined();\n expect(current.status).toEqual('current');\n expect(current.isDefault).toEqual(true);\n }\n });\n\n it('specs have unique keys', async () => {\n const moar = cloneDeep(versions);\n moar.supported_versions.push(\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/u.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un3.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un4.json',\n }\n );\n const actual = await getSpecsFromVersions(moar);\n expect(Object.keys(actual)).toEqual([\n '3.1',\n '4.0',\n '4.0u',\n '4.0un',\n '4.0un3',\n '4.0un4',\n ]);\n });\n });\n});\n"],"mappings":";;AA0BA,SAASA,YAAY,QAAQ,IAAI;AACjC,SAASC,QAAQ,EAAEC,EAAE,QAAQ,WAAW;AACxC,SAASC,MAAM,QAAQ,QAAQ;AAC/B,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,OAAO,MAAM,gBAAgB;AACpC,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,kBAAkB;AAErE,SACEC,QAAQ,EACRC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,oBAAoB,EACpBC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,WAAW,QACN,qBAAqB;AAC5B,SAASC,UAAU,EAAEC,QAAQ,QAAQ,2BAA2B;AAEhE,IAAM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CAAC,IAAI,CAAC;MACzC;IACF,CAAC,EAAC;IAEF5C,EAAE,CAAC,wBAAwB,EAAAsD,iBAAA,CAAE,aAAY;MACvC,IAAM4C,IAAI,GAAGhG,SAAS,CAAC2D,QAAQ,CAAC;MAChCqC,IAAI,CAACtC,kBAAkB,CAACuC,IAAI,CAC1B;QACEzC,OAAO,EAAE,KAAK;QACdgC,YAAY,EAAE,MAAM;QACpBrC,MAAM,EAAE,IAAI;QACZsC,WAAW,EAAE;MACf,CAAC,EACD;QACEjC,OAAO,EAAE,KAAK;QACdgC,YAAY,EAAE,MAAM;QACpBrC,MAAM,EAAE,IAAI;QACZsC,WAAW,EAAE;MACf,CAAC,EACD;QACEjC,OAAO,EAAE,KAAK;QACdgC,YAAY,EAAE,MAAM;QACpBrC,MAAM,EAAE,IAAI;QACZsC,WAAW,EAAE;MACf,CAAC,EACD;QACEjC,OAAO,EAAE,KAAK;QACdgC,YAAY,EAAE,MAAM;QACpBrC,MAAM,EAAE,IAAI;QACZsC,WAAW,EAAE;MACf,CACF,CAAC;MACD,IAAMlD,MAAM,SAAS5B,oBAAoB,CAACqF,IAAI,CAAC;MAC/CjG,MAAM,CAACkF,MAAM,CAACD,IAAI,CAACzC,MAAM,CAAC,CAAC,CAACG,OAAO,CAAC,CAClC,KAAK,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,CACT,CAAC;IACJ,CAAC,EAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"convert.apispec.js","names":["readFileSync","describe","it","expect","cloneDeep","isEmpty","LookerNodeSDK","NodeSettingsIniFile","ApiModel","compareSpecs","convertDefs","convertParam","fixConversion","getLookerSpecs","getSpecLinks","getSpecsFromVersions","loadSpecs","openApiStyle","specToModel","swapXLookerTags","upgradeSpec","TestConfig","testFile","swaggerFrag","openApiFrag","specFrag","swagger","JSON","parse","api","config","swaggerFile","apiFile","swaggerSource","fullSwagger","apiSource","settings","localIni","sdk","init40","baseUrl","authSession","base_url","actual","toContain","not","toEqual","toBeUndefined","spec","fixes","toHaveLength","onlyPublic","specs","filter","v","status","_asyncToGenerator","toBeDefined","looker_release_version","current_version","version","supported","supported_versions","versions","forEach","name","url","current","find","s","links","link","replace","substring","indexOf","description","op","paths","get","param","parameters","expected","defs","definitions","keys","Object","length","skip","left","fromString","right","diff","full_version","swagger_url","api_server_url","entries","_ref6","_","a","isDefault","moar","push"],"sources":["../../src/convert.apispec.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 { readFileSync } from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport { LookerNodeSDK, NodeSettingsIniFile } from '@looker/sdk-node';\nimport type { ISpecItem } from '@looker/sdk-codegen';\nimport {\n ApiModel,\n compareSpecs,\n convertDefs,\n convertParam,\n fixConversion,\n getLookerSpecs,\n getSpecLinks,\n getSpecsFromVersions,\n loadSpecs,\n openApiStyle,\n specToModel,\n swapXLookerTags,\n upgradeSpec,\n} from '@looker/sdk-codegen';\nimport { TestConfig, testFile } from '@looker/sdk-codegen-utils';\n\nconst swaggerFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"collectionFormat\": \"csv\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"type\": \"string\"\n },\n {\n \"name\": \"body\",\n \"in\": \"body\",\n \"description\": \"Dashboard\",\n \"required\": false,\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"type\": \"boolean\"\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"schema\": {\n \"$ref\": \"#/definitions/Dashboard\"\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"schema\": {\n \"$ref\": \"#/definitions/Error\"\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"schema\": {\n \"$ref\": \"#/definitions/ValidationError\"\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst openApiFrag = `\n{\n \"paths\": {\n \"/query_tasks/multi_results\": {\n \"get\": {\n \"tags\": [\"Query\"],\n \"operationId\": \"query_task_multi_results\",\n \"summary\": \"Get Multiple Async Query Results\",\n \"description\": \"### Fetch results of multiple async queries\\\\n\\\\nReturns the results of multiple async queries in one request.\\\\n\\\\nFor Query Tasks that are not completed, the response will include the execution status of the Query Task but will not include query results.\\\\nQuery Tasks whose results have expired will have a status of 'expired'.\\\\nIf the user making the API request does not have sufficient privileges to view a Query Task result, the result will have a status of 'missing'\\\\n\",\n \"parameters\": [\n {\n \"name\": \"query_task_ids\",\n \"in\": \"query\",\n \"description\": \"List of Query Task IDs\",\n \"required\": true,\n \"style\": \"simple\",\n \"explode\": false,\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"Multiple query results\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"db_query\"\n }\n },\n\n \"/dashboards/{lookml_dashboard_id}/import/{space_id}\": {\n \"post\": {\n \"tags\": [\"Dashboard\"],\n \"operationId\": \"import_lookml_dashboard\",\n \"summary\": \"Import LookML Dashboard\",\n \"description\": \"### Import a LookML dashboard to a space as a UDD\\\\nCreates a UDD (a dashboard which exists in the Looker database rather than as a LookML file) from the LookML dashboard\\\\nand puts it in the space specified. The created UDD will have a lookml_link_id which links to the original LookML dashboard.\\\\n\\\\nTo give the imported dashboard specify a (e.g. title: \\\\\"my title\\\\\") in the body of your request, otherwise the imported\\\\ndashboard will have the same title as the original LookML dashboard.\\\\n\\\\nFor this operation to succeed the user must have permission to see the LookML dashboard in question, and have permission to\\\\ncreate content in the space the dashboard is being imported to.\\\\n\\\\n**Sync** a linked UDD with [sync_lookml_dashboard()](#!/Dashboard/sync_lookml_dashboard)\\\\n**Unlink** a linked UDD by setting lookml_link_id to null with [update_dashboard()](#!/Dashboard/update_dashboard)\\\\n\",\n \"parameters\": [\n {\n \"name\": \"lookml_dashboard_id\",\n \"in\": \"path\",\n \"description\": \"Id of LookML dashboard\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"space_id\",\n \"in\": \"path\",\n \"description\": \"Id of space to import the dashboard to\",\n \"required\": true,\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"raw_locale\",\n \"in\": \"query\",\n \"description\": \"If true, and this dashboard is localized, export it with the raw keys, not localized.\",\n \"required\": false,\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"requestBody\": {\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n },\n \"description\": \"Dashboard\"\n },\n \"responses\": {\n \"200\": {\n \"description\": \"Dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"201\": {\n \"description\": \"dashboard\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Dashboard\"\n }\n }\n }\n },\n \"400\": {\n \"description\": \"Bad Request\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"Not Found\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/Error\"\n }\n }\n }\n },\n \"422\": {\n \"description\": \"Validation Error\",\n \"content\": {\n \"application/json\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationError\"\n }\n }\n }\n }\n },\n \"x-looker-status\": \"beta\",\n \"x-looker-activity-type\": \"non_query\"\n }\n }\n }\n}\n`;\nconst specFrag = `\n\"can\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"boolean\"\n },\n \"readOnly\": true,\n \"description\": \"Operations the current user is able to perform on this object\",\n \"x-looker-nullable\": false\n},\n\"content_favorite_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Content Favorite Id\",\n \"x-looker-nullable\": true\n},\n\"content_metadata_id\": {\n \"type\": \"integer\",\n \"format\": \"int64\",\n \"readOnly\": true,\n \"description\": \"Id of content metadata\",\n \"x-looker-nullable\": true\n},\n\"description\": {\n \"type\": \"string\",\n \"readOnly\": true,\n \"description\": \"Description\",\n \"x-looker-nullable\": true\n},\n\"hidden\": {\n \"type\": \"boolean\",\n \"readOnly\": true,\n \"description\": \"Is Hidden\",\n \"x-looker-nullable\": false,\n \"x-looker-deprecated\": true,\n},\n\"supported_formats\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"readOnly\": true,\n \"x-looker-values\": [\n \"txt\",\n \"csv\",\n \"inline_json\",\n \"json\",\n \"json_label\",\n \"json_detail\",\n \"json_detail_lite_stream\",\n \"xlsx\",\n \"html\",\n \"wysiwyg_pdf\",\n \"assembled_pdf\",\n \"wysiwyg_png\",\n \"csv_zip\"\n ],\n \"description\": \"A list of data formats the integration supports. If unspecified, the default is all data formats. Valid values are: \\\\\"txt\\\\\", \\\\\"csv\\\\\", \\\\\"inline_json\\\\\", \\\\\"json\\\\\", \\\\\"json_label\\\\\", \\\\\"json_detail\\\\\", \\\\\"json_detail_lite_stream\\\\\", \\\\\"xlsx\\\\\", \\\\\"html\\\\\", \\\\\"wysiwyg_pdf\\\\\", \\\\\"assembled_pdf\\\\\", \\\\\"wysiwyg_png\\\\\", \\\\\"csv_zip\\\\\".\",\n \"nullable\": false\n},\n`;\n\nconst swagger = JSON.parse(swaggerFrag);\nconst api = JSON.parse(openApiFrag);\n\nconst config = TestConfig(specToModel);\nconst swaggerFile = testFile('Looker.4.0.json');\nconst apiFile = testFile('Looker.4.0.oas.json');\nconst swaggerSource = readFileSync(swaggerFile, 'utf-8');\nconst fullSwagger = JSON.parse(swaggerSource);\nconst apiSource = readFileSync(apiFile, 'utf-8');\nconst settings = new NodeSettingsIniFile(\n 'LOOKERSDK',\n config.localIni,\n 'Looker'\n);\nconst sdk = LookerNodeSDK.init40(settings);\nconst baseUrl = sdk.authSession.settings.base_url;\n\ndescribe('spec conversion', () => {\n it('swaps out x-looker-tags', () => {\n const actual = swapXLookerTags(specFrag);\n expect(actual).toContain('\"nullable\": true');\n expect(actual).not.toContain('\"x-looker-nullable\": true');\n expect(actual).toContain('\"enum\": [');\n expect(actual).not.toContain('\"x-looker-values\": [');\n expect(actual).toContain('\"deprecated\": true');\n expect(actual).not.toContain('\"x-looker-deprecated\"');\n });\n\n it('collectionFormat to style', () => {\n expect(openApiStyle('csv')).toEqual('simple');\n expect(openApiStyle('ssv')).toEqual('spaceDelimited');\n expect(openApiStyle('pipes')).toEqual('pipeDelimited');\n expect(openApiStyle('tabs')).toBeUndefined();\n });\n\n it('fixes missing conversion items', () => {\n const actual = fixConversion(openApiFrag, swaggerFrag);\n expect(actual.spec).toContain(`\"style\":\"simple\"`);\n expect(actual.fixes).not.toHaveLength(0);\n });\n\n describe('spec retrieval', () => {\n const onlyPublic = (specs: ISpecItem[]) => {\n return specs.filter(v => v.status !== 'undocumented');\n };\n\n it('gets looker specs', async () => {\n expect(baseUrl).toBeDefined();\n const actual = await getLookerSpecs(sdk, baseUrl);\n expect(actual).toBeDefined();\n expect(actual.looker_release_version).not.toEqual('');\n expect(actual.current_version.version).not.toEqual('');\n const supported = onlyPublic(actual.supported_versions);\n expect(supported).toHaveLength(1);\n });\n\n it('gets spec links', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const actual = getSpecLinks(versions);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(spec.name).not.toEqual('');\n expect(spec.version).not.toEqual('');\n expect(spec.status).not.toEqual('');\n expect(spec.url).not.toEqual('');\n expect(isEmpty(spec.api)).toEqual(true);\n });\n const current = actual.find(s => s.status === 'current');\n expect(current).toBeDefined();\n actual.forEach(spec => expect(isEmpty(spec.api)).toEqual(true));\n });\n\n it('fetches and parses all specs', async () => {\n const versions = await getLookerSpecs(sdk, baseUrl);\n expect(versions).toBeDefined();\n versions.supported_versions = onlyPublic(versions.supported_versions);\n const links = getSpecLinks(versions);\n links.forEach(\n link =>\n (link.url = link.url.replace(\n link.url.substring(0, link.url.indexOf('/api/')),\n baseUrl\n ))\n );\n const actual = await loadSpecs(sdk, links);\n expect(actual).toBeDefined();\n /*\n * 23.18 and later only has one API defined\n * expect(actual).toHaveLength(3)\n */\n actual.forEach(spec => {\n expect(isEmpty(spec.api)).toEqual(false);\n expect(spec.api.version).not.toEqual('');\n expect(spec.api.description).not.toEqual('');\n });\n });\n });\n\n describe('spec upgrade', () => {\n it('converts a swagger array param', () => {\n const op = swagger.paths['/query_tasks/multi_results'].get;\n const param = op.parameters[0];\n const actual = convertParam(param);\n expect(actual).toBeDefined();\n const expected =\n api.paths['/query_tasks/multi_results'].get.parameters[0];\n expect(actual).toEqual(expected);\n });\n\n it('converts all definitions', () => {\n const defs = fullSwagger.definitions;\n const actual = convertDefs(defs);\n expect(actual).toBeDefined();\n const keys = Object.keys(actual);\n expect(keys).toHaveLength(Object.keys(defs).length);\n });\n\n it.skip('matches a reference OpenAPI conversion', () => {\n // TODO There is a different branch to address this\n const spec = upgradeSpec(swaggerSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n\n it('passes through an existing OpenAPI spec', () => {\n const spec = upgradeSpec(apiSource);\n expect(spec).toBeDefined();\n const left = ApiModel.fromString(apiSource);\n const right = ApiModel.fromString(spec);\n const diff = compareSpecs(left, right);\n expect(diff).toHaveLength(0);\n });\n });\n\n describe('getSpecsFromVersions', () => {\n const versions = {\n looker_release_version: '21.3.0',\n current_version: {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n supported_versions: [\n {\n version: '2.99',\n full_version: '2.99.0',\n status: 'internal_test',\n swagger_url: 'http://localhost:19999/api/2.99/swagger.json',\n },\n {\n version: '3.0',\n full_version: '3.0.0',\n status: 'legacy',\n swagger_url: 'http://localhost:19999/api/3.0/swagger.json',\n },\n {\n version: '3.1',\n full_version: '3.1.0',\n status: 'current',\n swagger_url: 'http://localhost:19999/api/3.1/swagger.json',\n },\n {\n version: '4.0',\n full_version: '4.0.21.3',\n status: 'experimental',\n swagger_url: 'http://localhost:19999/api/4.0/swagger.json',\n },\n ],\n api_server_url: 'http://localhost:19999',\n };\n\n it('only gets supported specifications', async () => {\n const actual = await getSpecsFromVersions(versions);\n expect(Object.keys(actual)).toEqual(['3.1', '4.0']);\n });\n\n it('current is the default spec', async () => {\n const specs = await getSpecsFromVersions(versions);\n const actual = Object.entries(specs).find(\n ([_, a]) => a.status === 'current'\n );\n expect(actual).toBeDefined();\n if (actual) {\n const [, current] = actual;\n expect(current).toBeDefined();\n expect(current.status).toEqual('current');\n expect(current.isDefault).toEqual(true);\n }\n });\n\n it('specs have unique keys', async () => {\n const moar = cloneDeep(versions);\n moar.supported_versions.push(\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/u.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un3.json',\n },\n {\n version: '4.0',\n full_version: 'full',\n status: 'un',\n swagger_url: 'http://localhost:19999/api/4.0/un4.json',\n }\n );\n const actual = await getSpecsFromVersions(moar);\n expect(Object.keys(actual)).toEqual([\n '3.1',\n '4.0',\n '4.0u',\n '4.0un',\n '4.0un3',\n '4.0un4',\n ]);\n });\n });\n});\n"],"mappings":";;AA0BA,SAASA,YAAY,QAAQ,IAAI;AACjC,SAASC,QAAQ,EAAEC,EAAE,QAAQ,WAAW;AACxC,SAASC,MAAM,QAAQ,QAAQ;AAC/B,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,OAAO,MAAM,gBAAgB;AACpC,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,kBAAkB;AAErE,SACEC,QAAQ,EACRC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,oBAAoB,EACpBC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,eAAe,EACfC,WAAW,QACN,qBAAqB;AAC5B,SAASC,UAAU,EAAEC,QAAQ,QAAQ,2BAA2B;AAEhE,IAAMC,WAAW,4hKA6HhB;AACD,IAAMC,WAAW,mrMAwKhB;AACD,IAAMC,QAAQ,otDA2Db;AAED,IAAMC,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACL,WAAW,CAAC;AACvC,IAAMM,GAAG,GAAGF,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC;AAEnC,IAAMM,MAAM,GAAGT,UAAU,CAACH,WAAW,CAAC;AACtC,IAAMa,WAAW,GAAGT,QAAQ,CAAC,iBAAiB,CAAC;AAC/C,IAAMU,OAAO,GAAGV,QAAQ,CAAC,qBAAqB,CAAC;AAC/C,IAAMW,aAAa,GAAGjC,YAAY,CAAC+B,WAAW,EAAE,OAAO,CAAC;AACxD,IAAMG,WAAW,GAAGP,IAAI,CAACC,KAAK,CAACK,aAAa,CAAC;AAC7C,IAAME,SAAS,GAAGnC,YAAY,CAACgC,OAAO,EA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ACEjC,OAAO,EAAE,KAAK;QACdgC,YAAY,EAAE,MAAM;QACpBrC,MAAM,EAAE,IAAI;QACZsC,WAAW,EAAE;MACf,CACF,CAAC;MACD,IAAMlD,MAAM,SAAS5B,oBAAoB,CAACqF,IAAI,CAAC;MAC/CjG,MAAM,CAACkF,MAAM,CAACD,IAAI,CAACzC,MAAM,CAAC,CAAC,CAACG,OAAO,CAAC,CAClC,KAAK,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,CACT,CAAC;IACJ,CAAC,EAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -64,4 +64,4 @@ describe('fetch operations', () => {
64
64
  expect(actual.length).toBeGreaterThan(0);
65
65
  }));
66
66
  });
67
- //# sourceMappingURL=fetchSpec.apitest.js.map
67
+ //# sourceMappingURL=fetchSpec.apispec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchSpec.apitest.js","names":["fs","describe","it","expect","getSpecsFromVersions","specToModel","TestConfig","fetchLookerVersion","fetchLookerVersions","getVersionInfo","logConvertSpec","login","supportedVersion","ApiConfigSection","config","props","readFileSync","localIni","api_version","_asyncToGenerator","testProps","JSON","parse","stringify","base_url","actual","undefined","timeout","toEqual","not","looker_release_version","toBeDefined","version","lookerVersion","spec","token","swagger_url","name","lookerVersions","specs","length","toBeGreaterThan"],"sources":["../../src/fetchSpec.apitest.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 fs from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport { getSpecsFromVersions, specToModel } from '@looker/sdk-codegen';\nimport { TestConfig } from '@looker/sdk-codegen-utils';\nimport {\n fetchLookerVersion,\n fetchLookerVersions,\n getVersionInfo,\n logConvertSpec,\n login,\n supportedVersion,\n} from './fetchSpec';\nimport type { ISDKConfigProps } from './sdkConfig';\nimport { ApiConfigSection } from '@looker/sdk-node';\n\nconst config = TestConfig(specToModel);\nconst props = ApiConfigSection(\n fs.readFileSync(config.localIni, 'utf8')\n) as unknown as ISDKConfigProps;\n// api_version is no longer part of the INI, now set by sdkGen iterator\nprops.api_version = '4.0';\n\ndescribe('fetch operations', () => {\n it('defaults lookerVersion when server is not responding', async () => {\n const testProps = JSON.parse(JSON.stringify(props));\n testProps.base_url = 'https://bogus-server.looker.com:99';\n const actual = await fetchLookerVersion(testProps, undefined, {\n timeout: 3,\n });\n expect(actual).toEqual('');\n });\n\n it('gets lookerVersion with good server', async () => {\n const actual = await fetchLookerVersion(props);\n expect(actual).not.toEqual('');\n });\n\n it('gets lookerVersion with supplied versions', async () => {\n const actual = await fetchLookerVersion(props, {\n looker_release_version: '7.10.0',\n });\n expect(actual).toEqual('7.10');\n });\n\n it('gets version info', async () => {\n expect(props).toBeDefined();\n const version = await getVersionInfo(props);\n expect(version).toBeDefined();\n if (version) {\n expect(version.lookerVersion).toBeDefined();\n expect(version.spec).toBeDefined();\n }\n });\n\n it('can login', async () => {\n expect(props).toBeDefined();\n const token = await login(props);\n expect(token).toBeDefined();\n });\n\n it('get versions', async () => {\n expect(props).toBeDefined();\n const actual = await fetchLookerVersions(props);\n expect(actual).toBeDefined();\n const version: any = supportedVersion('4.0', actual);\n expect(version).toBeDefined();\n if (version) {\n expect(version.version).toEqual('4.0');\n expect(version.swagger_url).toBeDefined();\n // TODO enable when these values are surfaced in Looker\n // expect(version.swagger_min_url).toBeDefined()\n // expect(version.openapi_url).toBeDefined()\n // expect(version.openapi_min_url).toBeDefined()\n }\n });\n\n it('logConvertSpec', async () => {\n expect(props).toBeDefined();\n const name = 'Looker';\n const lookerVersions = await fetchLookerVersions(props);\n const specs = await getSpecsFromVersions(lookerVersions);\n const actual = await logConvertSpec(\n name,\n specs[props.api_version],\n lookerVersions,\n true\n );\n expect(actual).toBeDefined();\n expect(actual.length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;AA0BA,OAAOA,EAAE,MAAM,IAAI;AACnB,SAASC,QAAQ,EAAEC,EAAE,QAAQ,WAAW;AACxC,SAASC,MAAM,QAAQ,QAAQ;AAC/B,SAASC,oBAAoB,EAAEC,WAAW,QAAQ,qBAAqB;AACvE,SAASC,UAAU,QAAQ,2BAA2B;AACtD,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,cAAc,EACdC,KAAK,EACLC,gBAAgB,QACX,aAAa;AAEpB,SAASC,gBAAgB,QAAQ,kBAAkB;AAEnD,IAAMC,MAAM,GAAGR,UAAU,CAACD,WAAW,CAAC;AACtC,IAAMU,KAAK,GAAGF,gBAAgB,CAC5Bb,EAAE,CAACgB,YAAY,CAACF,MAAM,CAACG,QAAQ,EAAE,MAAM,CACzC,CAA+B;AAE/BF,KAAK,CAACG,WAAW,GAAG,KAAK;AAEzBjB,QAAQ,CAAC,kBAAkB,EAAE,MAAM;EACjCC,EAAE,CAAC,sDAAsD,EAAAiB,iBAAA,CAAE,aAAY;IACrE,IAAMC,SAAS,GAAGC,IAAI,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EAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"fetchSpec.apispec.js","names":["fs","describe","it","expect","getSpecsFromVersions","specToModel","TestConfig","fetchLookerVersion","fetchLookerVersions","getVersionInfo","logConvertSpec","login","supportedVersion","ApiConfigSection","config","props","readFileSync","localIni","api_version","_asyncToGenerator","testProps","JSON","parse","stringify","base_url","actual","undefined","timeout","toEqual","not","looker_release_version","toBeDefined","version","lookerVersion","spec","token","swagger_url","name","lookerVersions","specs","length","toBeGreaterThan"],"sources":["../../src/fetchSpec.apispec.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 fs from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport { getSpecsFromVersions, specToModel } from '@looker/sdk-codegen';\nimport { TestConfig } from '@looker/sdk-codegen-utils';\nimport {\n fetchLookerVersion,\n fetchLookerVersions,\n getVersionInfo,\n logConvertSpec,\n login,\n supportedVersion,\n} from './fetchSpec';\nimport type { ISDKConfigProps } from './sdkConfig';\nimport { ApiConfigSection } from '@looker/sdk-node';\n\nconst config = TestConfig(specToModel);\nconst props = ApiConfigSection(\n fs.readFileSync(config.localIni, 'utf8')\n) as unknown as ISDKConfigProps;\n// api_version is no longer part of the INI, now set by sdkGen iterator\nprops.api_version = '4.0';\n\ndescribe('fetch operations', () => {\n it('defaults lookerVersion when server is not responding', async () => {\n const testProps = JSON.parse(JSON.stringify(props));\n testProps.base_url = 'https://bogus-server.looker.com:99';\n const actual = await fetchLookerVersion(testProps, undefined, {\n timeout: 3,\n });\n expect(actual).toEqual('');\n });\n\n it('gets lookerVersion with good server', async () => {\n const actual = await fetchLookerVersion(props);\n expect(actual).not.toEqual('');\n });\n\n it('gets lookerVersion with supplied versions', async () => {\n const actual = await fetchLookerVersion(props, {\n looker_release_version: '7.10.0',\n });\n expect(actual).toEqual('7.10');\n });\n\n it('gets version info', async () => {\n expect(props).toBeDefined();\n const version = await getVersionInfo(props);\n expect(version).toBeDefined();\n if (version) {\n expect(version.lookerVersion).toBeDefined();\n expect(version.spec).toBeDefined();\n }\n });\n\n it('can login', async () => {\n expect(props).toBeDefined();\n const token = await login(props);\n expect(token).toBeDefined();\n });\n\n it('get versions', async () => {\n expect(props).toBeDefined();\n const actual = await fetchLookerVersions(props);\n expect(actual).toBeDefined();\n const version: any = supportedVersion('4.0', actual);\n expect(version).toBeDefined();\n if (version) {\n expect(version.version).toEqual('4.0');\n expect(version.swagger_url).toBeDefined();\n // TODO enable when these values are surfaced in Looker\n // expect(version.swagger_min_url).toBeDefined()\n // expect(version.openapi_url).toBeDefined()\n // expect(version.openapi_min_url).toBeDefined()\n }\n });\n\n it('logConvertSpec', async () => {\n expect(props).toBeDefined();\n const name = 'Looker';\n const lookerVersions = await fetchLookerVersions(props);\n const specs = await getSpecsFromVersions(lookerVersions);\n const actual = await logConvertSpec(\n name,\n specs[props.api_version],\n lookerVersions,\n true\n );\n expect(actual).toBeDefined();\n expect(actual.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,EAAE;MACX7B,MAAM,CAAC6B,OAAO,CAACA,OAAO,CAAC,CAACJ,OAAO,CAAC,KAAK,CAAC;MACtCzB,MAAM,CAAC6B,OAAO,CAACI,WAAW,CAAC,CAACL,WAAW,CAAC,CAAC;IAK3C;EACF,CAAC,EAAC;EAEF7B,EAAE,CAAC,gBAAgB,EAAAiB,iBAAA,CAAE,aAAY;IAC/BhB,MAAM,CAACY,KAAK,CAAC,CAACgB,WAAW,CAAC,CAAC;IAC3B,IAAMM,IAAI,GAAG,QAAQ;IACrB,IAAMC,cAAc,SAAS9B,mBAAmB,CAACO,KAAK,CAAC;IACvD,IAAMwB,KAAK,SAASnC,oBAAoB,CAACkC,cAAc,CAAC;IACxD,IAAMb,MAAM,SAASf,cAAc,CACjC2B,IAAI,EACJE,KAAK,CAACxB,KAAK,CAACG,WAAW,CAAC,EACxBoB,cAAc,EACd,IACF,CAAC;IACDnC,MAAM,CAACsB,MAAM,CAAC,CAACM,WAAW,CAAC,CAAC;IAC5B5B,MAAM,CAACsB,MAAM,CAACe,MAAM,CAAC,CAACC,eAAe,CAAC,CAAC,CAAC;EAC1C,CAAC,EAAC;AACJ,CAAC,CAAC"}
@@ -67,4 +67,4 @@ props.api_version = '4.0';
67
67
  (0, _expect.expect)(actual.length).toBeGreaterThan(0);
68
68
  }));
69
69
  });
70
- //# sourceMappingURL=fetchSpec.apitest.js.map
70
+ //# sourceMappingURL=fetchSpec.apispec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchSpec.apitest.js","names":["_fs","_interopRequireDefault","require","_nodeTest","_expect","_sdkCodegen","_sdkCodegenUtils","_fetchSpec","_sdkNode","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","config","TestConfig","specToModel","props","ApiConfigSection","fs","readFileSync","localIni","api_version","describe","it","testProps","JSON","parse","stringify","base_url","actual","fetchLookerVersion","timeout","expect","toEqual","not","looker_release_version","toBeDefined","version","getVersionInfo","lookerVersion","spec","token","login","fetchLookerVersions","supportedVersion","swagger_url","name","lookerVersions","specs","getSpecsFromVersions","logConvertSpec","length","toBeGreaterThan"],"sources":["../src/fetchSpec.apitest.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 fs from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport { getSpecsFromVersions, specToModel } from '@looker/sdk-codegen';\nimport { TestConfig } from '@looker/sdk-codegen-utils';\nimport {\n fetchLookerVersion,\n fetchLookerVersions,\n getVersionInfo,\n logConvertSpec,\n login,\n supportedVersion,\n} from './fetchSpec';\nimport type { ISDKConfigProps } from './sdkConfig';\nimport { ApiConfigSection } from '@looker/sdk-node';\n\nconst config = TestConfig(specToModel);\nconst props = ApiConfigSection(\n fs.readFileSync(config.localIni, 'utf8')\n) as unknown as ISDKConfigProps;\n// api_version is no longer part of the INI, now set by sdkGen iterator\nprops.api_version = '4.0';\n\ndescribe('fetch operations', () => {\n it('defaults lookerVersion when server is not responding', async () => {\n const testProps = JSON.parse(JSON.stringify(props));\n testProps.base_url = 'https://bogus-server.looker.com:99';\n const actual = await fetchLookerVersion(testProps, undefined, {\n timeout: 3,\n });\n expect(actual).toEqual('');\n });\n\n it('gets lookerVersion with good server', async () => {\n const actual = await fetchLookerVersion(props);\n expect(actual).not.toEqual('');\n });\n\n it('gets lookerVersion with supplied versions', async () => {\n const actual = await fetchLookerVersion(props, {\n looker_release_version: '7.10.0',\n });\n expect(actual).toEqual('7.10');\n });\n\n it('gets version info', async () => {\n expect(props).toBeDefined();\n const version = await getVersionInfo(props);\n expect(version).toBeDefined();\n if (version) {\n expect(version.lookerVersion).toBeDefined();\n expect(version.spec).toBeDefined();\n }\n });\n\n it('can login', async () => {\n expect(props).toBeDefined();\n const token = await login(props);\n expect(token).toBeDefined();\n });\n\n it('get versions', async () => {\n expect(props).toBeDefined();\n const actual = await fetchLookerVersions(props);\n expect(actual).toBeDefined();\n const version: any = supportedVersion('4.0', actual);\n expect(version).toBeDefined();\n if (version) {\n expect(version.version).toEqual('4.0');\n expect(version.swagger_url).toBeDefined();\n // TODO enable when these values are surfaced in Looker\n // expect(version.swagger_min_url).toBeDefined()\n // expect(version.openapi_url).toBeDefined()\n // expect(version.openapi_min_url).toBeDefined()\n }\n });\n\n it('logConvertSpec', async () => {\n expect(props).toBeDefined();\n const name = 'Looker';\n const lookerVersions = await fetchLookerVersions(props);\n const specs = await getSpecsFromVersions(lookerVersions);\n const actual = await logConvertSpec(\n name,\n specs[props.api_version],\n lookerVersions,\n true\n );\n expect(actual).toBeDefined();\n expect(actual.length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;AA0BA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAA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AAC,gCAAoB,EAACF,cAAc,CAAC;IACxD,IAAMlB,MAAM,SAAS,IAAAqB,yBAAc,EACjCJ,IAAI,EACJE,KAAK,CAAChC,KAAK,CAACK,WAAW,CAAC,EACxB0B,cAAc,EACd,IACF,CAAC;IACD,IAAAf,cAAM,EAACH,MAAM,CAAC,CAACO,WAAW,CAAC,CAAC;IAC5B,IAAAJ,cAAM,EAACH,MAAM,CAACsB,MAAM,CAAC,CAACC,eAAe,CAAC,CAAC,CAAC;EAC1C,CAAC,EAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"fetchSpec.apispec.js","names":["_fs","_interopRequireDefault","require","_nodeTest","_expect","_sdkCodegen","_sdkCodegenUtils","_fetchSpec","_sdkNode","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","config","TestConfig","specToModel","props","ApiConfigSection","fs","readFileSync","localIni","api_version","describe","it","testProps","JSON","parse","stringify","base_url","actual","fetchLookerVersion","timeout","expect","toEqual","not","looker_release_version","toBeDefined","version","getVersionInfo","lookerVersion","spec","token","login","fetchLookerVersions","supportedVersion","swagger_url","name","lookerVersions","specs","getSpecsFromVersions","logConvertSpec","length","toBeGreaterThan"],"sources":["../src/fetchSpec.apispec.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 fs from 'fs';\nimport { describe, it } from 'node:test';\nimport { expect } from 'expect';\nimport { getSpecsFromVersions, specToModel } from '@looker/sdk-codegen';\nimport { TestConfig } from '@looker/sdk-codegen-utils';\nimport {\n fetchLookerVersion,\n fetchLookerVersions,\n getVersionInfo,\n logConvertSpec,\n login,\n supportedVersion,\n} from './fetchSpec';\nimport type { ISDKConfigProps } from './sdkConfig';\nimport { ApiConfigSection } from '@looker/sdk-node';\n\nconst config = TestConfig(specToModel);\nconst props = ApiConfigSection(\n fs.readFileSync(config.localIni, 'utf8')\n) as unknown as ISDKConfigProps;\n// api_version is no longer part of the INI, now set by sdkGen iterator\nprops.api_version = '4.0';\n\ndescribe('fetch operations', () => {\n it('defaults lookerVersion when server is not responding', async () => {\n const testProps = JSON.parse(JSON.stringify(props));\n testProps.base_url = 'https://bogus-server.looker.com:99';\n const actual = await fetchLookerVersion(testProps, undefined, {\n timeout: 3,\n });\n expect(actual).toEqual('');\n });\n\n it('gets lookerVersion with good server', async () => {\n const actual = await fetchLookerVersion(props);\n expect(actual).not.toEqual('');\n });\n\n it('gets lookerVersion with supplied versions', async () => {\n const actual = await fetchLookerVersion(props, {\n looker_release_version: '7.10.0',\n });\n expect(actual).toEqual('7.10');\n });\n\n it('gets version info', async () => {\n expect(props).toBeDefined();\n const version = await getVersionInfo(props);\n expect(version).toBeDefined();\n if (version) {\n expect(version.lookerVersion).toBeDefined();\n expect(version.spec).toBeDefined();\n }\n });\n\n it('can login', async () => {\n expect(props).toBeDefined();\n const token = await login(props);\n expect(token).toBeDefined();\n });\n\n it('get versions', async () => {\n expect(props).toBeDefined();\n const actual = await fetchLookerVersions(props);\n expect(actual).toBeDefined();\n const version: any = supportedVersion('4.0', actual);\n expect(version).toBeDefined();\n if (version) {\n expect(version.version).toEqual('4.0');\n expect(version.swagger_url).toBeDefined();\n // TODO enable when these values are surfaced in Looker\n // expect(version.swagger_min_url).toBeDefined()\n // expect(version.openapi_url).toBeDefined()\n // expect(version.openapi_min_url).toBeDefined()\n }\n });\n\n it('logConvertSpec', async () => {\n expect(props).toBeDefined();\n const name = 'Looker';\n const lookerVersions = await fetchLookerVersions(props);\n const specs = await getSpecsFromVersions(lookerVersions);\n const actual = await logConvertSpec(\n name,\n specs[props.api_version],\n lookerVersions,\n true\n );\n expect(actual).toBeDefined();\n expect(actual.length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;AA0BA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AASA,IAAAM,QAAA,GAAAN,OAAA;AAAoD,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,IAAA,IAAAT,OAAA,CAAAO,KAAA,YAAAG,OAAA,CAAAV,OAAA,CAAAO,KAAA,EAAAI,IAAA,CAAAT,KAAA,EAAAC,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,KAAK,CAAC;IAC/C,IAAAgB,cAAM,EAACH,MAAM,CAAC,CAACO,WAAW,CAAC,CAAC;IAC5B,IAAMC,OAAY,GAAG,IAAAO,2BAAgB,EAAC,KAAK,EAAEf,MAAM,CAAC;IACpD,IAAAG,cAAM,EAACK,OAAO,CAAC,CAACD,WAAW,CAAC,CAAC;IAC7B,IAAIC,OAAO,EAAE;MACX,IAAAL,cAAM,EAACK,OAAO,CAACA,OAAO,CAAC,CAACJ,OAAO,CAAC,KAAK,CAAC;MACtC,IAAAD,cAAM,EAACK,OAAO,CAACQ,WAAW,CAAC,CAACT,WAAW,CAAC,CAAC;IAK3C;EACF,CAAC,EAAC;EAEF,IAAAb,YAAE,EAAC,gBAAgB,EAAAlB,iBAAA,CAAE,aAAY;IAC/B,IAAA2B,cAAM,EAAChB,KAAK,CAAC,CAACoB,WAAW,CAAC,CAAC;IAC3B,IAAMU,IAAI,GAAG,QAAQ;IACrB,IAAMC,cAAc,SAAS,IAAAJ,8BAAmB,EAAC3B,KAAK,CAAC;IACvD,IAAMgC,KAAK,SAAS,IAAAC,gCAAoB,EAACF,cAAc,CAAC;IACxD,IAAMlB,MAAM,SAAS,IAAAqB,yBAAc,EACjCJ,IAAI,EACJE,KAAK,CAAChC,KAAK,CAACK,WAAW,CAAC,EACxB0B,cAAc,EACd,IACF,CAAC;IACD,IAAAf,cAAM,EAACH,MAAM,CAAC,CAACO,WAAW,CAAC,CAAC;IAC5B,IAAAJ,cAAM,EAACH,MAAM,CAACsB,MAAM,CAAC,CAACC,eAAe,CAAC,CAAC,CAAC;EAC1C,CAAC,EAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@looker/sdk-codegen-scripts",
3
- "version": "21.5.24",
3
+ "version": "21.5.25",
4
4
  "description": "Looker SDK Codegen scripts",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -27,10 +27,10 @@
27
27
  "watch:cjs": "yarn lerna exec --scope @looker/sdk-codegen-scripts --stream 'BABEL_ENV=build_cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --no-comments --watch'"
28
28
  },
29
29
  "dependencies": {
30
- "@looker/sdk": "24.16.2",
31
- "@looker/sdk-codegen": "21.9.3",
32
- "@looker/sdk-codegen-utils": "21.0.14",
33
- "@looker/sdk-node": "24.16.2",
30
+ "@looker/sdk": "24.18.0",
31
+ "@looker/sdk-codegen": "21.9.4",
32
+ "@looker/sdk-codegen-utils": "21.0.15",
33
+ "@looker/sdk-node": "24.18.0",
34
34
  "@looker/sdk-rtl": "21.6.3",
35
35
  "config": "^3.3.1",
36
36
  "cross-env": "^7.0.2"
@@ -49,5 +49,5 @@
49
49
  "prettier": "2.8.8",
50
50
  "swagger2openapi": "7.0.8"
51
51
  },
52
- "gitHead": "e7e30025690483553a16231c9218cd6f7e65a59b"
52
+ "gitHead": "87b09765f6bbf98d6a0c7295a31cabef3eaa250c"
53
53
  }