@looker/sdk-codegen-utils 21.0.32 → 21.0.34

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
@@ -127,6 +127,20 @@
127
127
  * @looker/sdk bumped from 26.6.0 to 26.6.1
128
128
  * @looker/sdk-node bumped from 26.6.0 to 26.6.1
129
129
 
130
+ ### Dependencies
131
+
132
+ * The following workspace dependencies were updated
133
+ * devDependencies
134
+ * @looker/sdk bumped from 26.6.1 to 26.8.0
135
+ * @looker/sdk-node bumped from 26.6.1 to 26.8.0
136
+
137
+ ### Dependencies
138
+
139
+ * The following workspace dependencies were updated
140
+ * devDependencies
141
+ * @looker/sdk bumped from 26.8.0 to 26.10.0
142
+ * @looker/sdk-node bumped from 26.8.0 to 26.10.0
143
+
130
144
  ## [21.0.21](https://github.com/looker-open-source/sdk-codegen/compare/sdk-codegen-utils-v21.0.20...sdk-codegen-utils-v21.0.21) (2025-03-11)
131
145
 
132
146
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/index.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\nexport * from './utils';\nexport * from './mocks';\nexport * from './testUtils';\n"],"mappings":"AA0BA,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,aAAa"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.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\nexport * from './utils';\nexport * from './mocks';\nexport * from './testUtils';\n"],"mappings":"AA0BA,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"mocks.js","names":["MockCrypto","secureRandom","_byteCount","sha256Hash","_message","Promise","resolve"],"sources":["../../src/mocks.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ICryptoHash } from '@looker/sdk-rtl';\n\nexport class MockCrypto implements ICryptoHash {\n secureRandom(_byteCount: number): string {\n return 'feedface';\n }\n\n sha256Hash(_message: string): Promise<string> {\n return Promise.resolve('baadf00d');\n }\n}\n"],"mappings":"AA4BA,OAAO,MAAMA,UAAU,CAAwB;EAC7CC,YAAYA,CAACC,UAAkB,EAAU;IACvC,OAAO,UAAU;EACnB;EAEAC,UAAUA,CAACC,QAAgB,EAAmB;IAC5C,OAAOC,OAAO,CAACC,OAAO,CAAC,UAAU,CAAC;EACpC;AACF"}
1
+ {"version":3,"file":"mocks.js","names":["MockCrypto","secureRandom","_byteCount","sha256Hash","_message","Promise","resolve"],"sources":["../../src/mocks.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ICryptoHash } from '@looker/sdk-rtl';\n\nexport class MockCrypto implements ICryptoHash {\n secureRandom(_byteCount: number): string {\n return 'feedface';\n }\n\n sha256Hash(_message: string): Promise<string> {\n return Promise.resolve('baadf00d');\n }\n}\n"],"mappings":"AA4BA,OAAO,MAAMA,UAAU,CAAwB;EAC7CC,YAAYA,CAACC,UAAkB,EAAU;IACvC,OAAO,UAAU;EACnB;EAEAC,UAAUA,CAACC,QAAgB,EAAmB;IAC5C,OAAOC,OAAO,CAACC,OAAO,CAAC,UAAU,CAAC;EACpC;AACF","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
2
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  import * as fs from 'fs';
7
7
  import path from 'path';
@@ -1 +1 @@
1
- {"version":3,"file":"testUtils.js","names":["fs","path","yaml","isEmpty","findRootSync","ApiConfigSection","NodeSession","readEnvConfig","readIniConfig","ApiSettings","Looker40SDK","functionalSdk40","utf8","specFromFile","specFile","loader","specContent","readFileSync","encoding","rootPath","getRootPath","__dirname","rootDir","rootFile","fileName","arguments","length","undefined","join","_mockSpec","mockApiSpec","spec","existsSync","Error","concat","obj","JSON","parse","testFile","filename","MeldSettings","constructor","settings","readConfig","_section","client_id","client_secret","lookUp","root","dir","f","getCypressSettings","cypressFile","config","cypress","Object","keys","forEach","k","toLowerCase","env","_objectSpread","loadApiSettings","_rootPath","localIni","cypressSettings","local","verify_ssl","base_url","result","creds","randomize","Math","round","random","entitle","rando","title","trim","createFunSdk","process","LOOKERSDK_INI","session","TestConfig","testDataFile","envPrefix","sectionName","sdk","testPath","dataFile","testData","load","apiTestModel","testIni","iniFile","section","baseUrl","timeout","parseInt","testSection"],"sources":["../../src/testUtils.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 * as fs from 'fs';\nimport path from 'path';\nimport * as yaml from 'js-yaml';\nimport isEmpty from 'lodash/isEmpty';\nimport { findRootSync } from '@manypkg/find-root';\nimport type { IApiConfig } from '@looker/sdk-node';\nimport {\n ApiConfigSection,\n NodeSession,\n readEnvConfig,\n readIniConfig,\n} from '@looker/sdk-node';\nimport type {\n IAPIMethods,\n IApiSection,\n IApiSettings,\n IAuthSession,\n} from '@looker/sdk-rtl';\nimport { ApiSettings } from '@looker/sdk-rtl';\n/* eslint-disable no-restricted-imports */\nimport { Looker40SDK, functionalSdk40 } from '@looker/sdk';\n\nconst utf8 = 'utf-8';\nexport type SpecLoader = (content: any) => any;\n\n/**\n * Convert a spec file into an APIModel\n * @param specFile name of spec file\n * @param loader callback to load spec as APIModel\n */\nexport const specFromFile = (specFile: string, loader: SpecLoader): any => {\n const specContent = fs.readFileSync(specFile, { encoding: utf8 });\n return loader(specContent);\n};\n\n/**\n * Properties used for various typescript-based tests\n */\nexport interface ITestConfig {\n /** the openApi.json snapshot in the test/ dir */\n apiTestModel: any;\n /** root dir of this repository */\n rootPath: string;\n /** <rootPath>/test dir */\n testPath: string;\n /** test/data.yml file */\n dataFile: string;\n /** root looker.ini file or LOOKERSDK_INI value */\n localIni: string;\n /** contents of test/data.yml */\n testData: any;\n /** ini file configured in testData */\n testIni: string;\n /* melded API config settings */\n settings: IApiSettings;\n /** melded sdk configuration session */\n session: IAuthSession;\n /** initialized typescript SDK from melded configuration */\n sdk: IAPIMethods;\n /** configured API base url */\n baseUrl: string;\n /** configured default INI section */\n section: any;\n /** configured timeout value */\n timeout: number;\n /** test INI section */\n testSection: any;\n}\n\nlet rootPath = '';\n/** fully resolved root dir of the repository */\nexport const getRootPath = (): string => {\n if (!rootPath) {\n rootPath = findRootSync(__dirname).rootDir;\n }\n return rootPath;\n};\n\n/**\n * Fully resolved path to a file based from the root path\n * @param fileName to path. It can start with folders\n */\nexport const rootFile = (fileName = ''): string =>\n path.join(getRootPath(), fileName);\n\nlet _mockSpec: any;\n/**\n * Returns the entire \"undocumented\" API specification as the model to use for mocking\n * because it includes everything from our current API\n * @param loader callback to load spec as APIModel\n */\nexport const mockApiSpec = (loader: SpecLoader) => {\n if (!_mockSpec) {\n const spec = rootFile('test/core/undoc_api_4.0.json');\n if (!fs.existsSync(spec)) {\n throw new Error(\n `run 'bin/sdk_gen -f' to generate the API spec file '${spec}'`\n );\n }\n const obj = JSON.parse(fs.readFileSync(spec, utf8));\n _mockSpec = loader(obj);\n }\n return _mockSpec;\n};\n\n/**\n * Fully resolved path to a file in the codegen test data folder\n * @param filename to path. It can start with folders\n */\nexport const testFile = (filename = ''): string =>\n path.join(rootFile('/packages/sdk-codegen-utils/data/'), filename);\n\nexport class MeldSettings extends ApiSettings {\n constructor(private settings: Partial<IApiSettings>) {\n super(settings);\n }\n\n readConfig(_section?: string): IApiSection {\n return {\n client_id: (this.settings as any).client_id,\n client_secret: (this.settings as any).client_secret,\n };\n }\n}\n\n/**\n * Find a file from the current directory up to the root of the repository\n * @param fileName to find from current directory\n */\nexport const lookUp = (fileName: string) => {\n const root = getRootPath();\n let dir = __dirname;\n while (dir >= root) {\n const f = path.join(dir, fileName);\n if (fs.existsSync(f)) {\n return f;\n } else {\n dir = path.join(dir, '../');\n }\n }\n return '';\n};\n\n/**\n * Gets the cypress settings\n */\nexport const getCypressSettings = (): Record<string, string> => {\n const cypressFile = lookUp('cypress.env.json');\n const config: any = fs.existsSync(cypressFile)\n ? JSON.parse(fs.readFileSync(cypressFile, utf8))\n : {};\n const cypress: Record<string, string> = {};\n Object.keys(config).forEach(k => (cypress[k.toLowerCase()] = config[k]));\n const env = readEnvConfig('CYPRESS');\n return {\n ...cypress,\n ...env,\n };\n};\n\n/**\n * Melds CYPRESS environment variables with cypress.env.json and optional looker.ini and returns the settings collection\n * @param rootPath root location of repository\n * @param localIni full name of default looker.ini. Needs to be passed in, but doesn't need to exist\n */\nexport const loadApiSettings = (\n _rootPath: string,\n localIni: string\n): IApiSettings => {\n const cypressSettings = getCypressSettings();\n const local: IApiConfig = fs.existsSync(localIni)\n ? ApiConfigSection(fs.readFileSync(localIni, utf8))\n : {};\n const settings = {\n verify_ssl: false,\n base_url: 'https://localhost:19999',\n ...local,\n ...cypressSettings,\n };\n const result = new MeldSettings(settings);\n const creds = result.readConfig();\n if (isEmpty(creds)) {\n throw new Error(\n `Test SDK not initialized. Configure environment variables, 'cypress.env.json', or '${localIni}'`\n );\n }\n return result;\n};\n\n/**\n * get a random value use for entity name constraints\n */\nexport const randomize = () => {\n return Math.round(Math.random() * 100000);\n};\n\n/**\n * Create a uniquely named title\n * @param rando value to use for unique name combo\n * @param title of entity to name\n */\nexport const entitle = (rando: string | number, title?: string) => {\n return `${rando} ${title ?? ''}`.trim();\n};\n\nexport const createFunSdk = (): IAPIMethods => {\n const root = getRootPath();\n const localIni = process.env.LOOKERSDK_INI || `${root}looker.ini`;\n const settings = loadApiSettings(root, localIni);\n const session = new NodeSession(settings);\n return functionalSdk40(session);\n};\n\n/**\n * Reads configuration information, returning various test values\n * @param loader callback to load spec as APIModel\n * @param rootPath root file path location for relative path resolution\n */\nexport const TestConfig = (\n loader: SpecLoader,\n rootPath = getRootPath()\n): ITestConfig => {\n const testDataFile = 'data.yml';\n const envPrefix = 'LOOKERSDK';\n const sectionName = 'Looker';\n const localIni =\n process.env.LOOKERSDK_INI || path.join(rootPath, 'looker.ini');\n const settings = loadApiSettings(rootPath, localIni);\n const session = new NodeSession(settings);\n const sdk: IAPIMethods = new Looker40SDK(session);\n const testPath = path.join(rootPath, '/packages/sdk-codegen-utils/data/');\n const dataFile = testFile(testDataFile);\n const testData: any = fs.existsSync(dataFile)\n ? yaml.load(fs.readFileSync(dataFile, utf8))\n : {};\n const apiTestModel = specFromFile(testFile('openApiRef.json'), loader);\n const testIni = path.join(rootPath, testData.iniFile);\n const section = readIniConfig(localIni, envPrefix, sectionName);\n const baseUrl = section.base_url;\n const timeout = parseInt(section.timeout, 10);\n const testSection = readIniConfig(localIni, envPrefix, sectionName);\n return {\n apiTestModel,\n dataFile,\n localIni,\n rootPath,\n testData,\n testIni,\n testPath,\n settings,\n session,\n sdk,\n baseUrl,\n section,\n timeout,\n testSection,\n };\n};\n"],"mappings":";;;;;AA0BA,OAAO,KAAKA,EAAE,MAAM,IAAI;AACxB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAO,KAAKC,IAAI,MAAM,SAAS;AAC/B,OAAOC,OAAO,MAAM,gBAAgB;AACpC,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,SACEC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,aAAa,QACR,kBAAkB;AAOzB,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,SAASC,WAAW,EAAEC,eAAe,QAAQ,aAAa;AAE1D,IAAMC,IAAI,GAAG,OAAO;AAQ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,GAAG1F,EAAE,CAACgC,UAAU,CAACyD,QAAQ,CAAC,GACzCvF,IAAI,CAACyF,IAAI,CAAC3F,EAAE,CAACiB,YAAY,CAACwE,QAAQ,EAAE7E,IAAI,CAAC,CAAC,GAC1C,CAAC,CAAC;EACN,IAAMgF,YAAY,GAAG/E,YAAY,CAACyB,QAAQ,CAAC,iBAAiB,CAAC,EAAEvB,MAAM,CAAC;EACtE,IAAM8E,OAAO,GAAG5F,IAAI,CAAC2B,IAAI,CAACT,QAAQ,EAAEuE,QAAQ,CAACI,OAAO,CAAC;EACrD,IAAMC,OAAO,GAAGvF,aAAa,CAACwD,QAAQ,EAAEqB,SAAS,EAAEC,WAAW,CAAC;EAC/D,IAAMU,OAAO,GAAGD,OAAO,CAAC3B,QAAQ;EAChC,IAAM6B,OAAO,GAAGC,QAAQ,CAACH,OAAO,CAACE,OAAO,EAAE,EAAE,CAAC;EAC7C,IAAME,WAAW,GAAG3F,aAAa,CAACwD,QAAQ,EAAEqB,SAAS,EAAEC,WAAW,CAAC;EACnE,OAAO;IACLM,YAAY;IACZH,QAAQ;IACRzB,QAAQ;IACR7C,QAAQ;IACRuE,QAAQ;IACRG,OAAO;IACPL,QAAQ;IACR9C,QAAQ;IACRwC,OAAO;IACPK,GAAG;IACHS,OAAO;IACPD,OAAO;IACPE,OAAO;IACPE;EACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"testUtils.js","names":["fs","path","yaml","isEmpty","findRootSync","ApiConfigSection","NodeSession","readEnvConfig","readIniConfig","ApiSettings","Looker40SDK","functionalSdk40","utf8","specFromFile","specFile","loader","specContent","readFileSync","encoding","rootPath","getRootPath","__dirname","rootDir","rootFile","fileName","arguments","length","undefined","join","_mockSpec","mockApiSpec","spec","existsSync","Error","concat","obj","JSON","parse","testFile","filename","MeldSettings","constructor","settings","readConfig","_section","client_id","client_secret","lookUp","root","dir","f","getCypressSettings","cypressFile","config","cypress","Object","keys","forEach","k","toLowerCase","env","_objectSpread","loadApiSettings","_rootPath","localIni","cypressSettings","local","verify_ssl","base_url","result","creds","randomize","Math","round","random","entitle","rando","title","trim","createFunSdk","process","LOOKERSDK_INI","session","TestConfig","testDataFile","envPrefix","sectionName","sdk","testPath","dataFile","testData","load","apiTestModel","testIni","iniFile","section","baseUrl","timeout","parseInt","testSection"],"sources":["../../src/testUtils.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 * as fs from 'fs';\nimport path from 'path';\nimport * as yaml from 'js-yaml';\nimport isEmpty from 'lodash/isEmpty';\nimport { findRootSync } from '@manypkg/find-root';\nimport type { IApiConfig } from '@looker/sdk-node';\nimport {\n ApiConfigSection,\n NodeSession,\n readEnvConfig,\n readIniConfig,\n} from '@looker/sdk-node';\nimport type {\n IAPIMethods,\n IApiSection,\n IApiSettings,\n IAuthSession,\n} from '@looker/sdk-rtl';\nimport { ApiSettings } from '@looker/sdk-rtl';\n/* eslint-disable no-restricted-imports */\nimport { Looker40SDK, functionalSdk40 } from '@looker/sdk';\n\nconst utf8 = 'utf-8';\nexport type SpecLoader = (content: any) => any;\n\n/**\n * Convert a spec file into an APIModel\n * @param specFile name of spec file\n * @param loader callback to load spec as APIModel\n */\nexport const specFromFile = (specFile: string, loader: SpecLoader): any => {\n const specContent = fs.readFileSync(specFile, { encoding: utf8 });\n return loader(specContent);\n};\n\n/**\n * Properties used for various typescript-based tests\n */\nexport interface ITestConfig {\n /** the openApi.json snapshot in the test/ dir */\n apiTestModel: any;\n /** root dir of this repository */\n rootPath: string;\n /** <rootPath>/test dir */\n testPath: string;\n /** test/data.yml file */\n dataFile: string;\n /** root looker.ini file or LOOKERSDK_INI value */\n localIni: string;\n /** contents of test/data.yml */\n testData: any;\n /** ini file configured in testData */\n testIni: string;\n /* melded API config settings */\n settings: IApiSettings;\n /** melded sdk configuration session */\n session: IAuthSession;\n /** initialized typescript SDK from melded configuration */\n sdk: IAPIMethods;\n /** configured API base url */\n baseUrl: string;\n /** configured default INI section */\n section: any;\n /** configured timeout value */\n timeout: number;\n /** test INI section */\n testSection: any;\n}\n\nlet rootPath = '';\n/** fully resolved root dir of the repository */\nexport const getRootPath = (): string => {\n if (!rootPath) {\n rootPath = findRootSync(__dirname).rootDir;\n }\n return rootPath;\n};\n\n/**\n * Fully resolved path to a file based from the root path\n * @param fileName to path. It can start with folders\n */\nexport const rootFile = (fileName = ''): string =>\n path.join(getRootPath(), fileName);\n\nlet _mockSpec: any;\n/**\n * Returns the entire \"undocumented\" API specification as the model to use for mocking\n * because it includes everything from our current API\n * @param loader callback to load spec as APIModel\n */\nexport const mockApiSpec = (loader: SpecLoader) => {\n if (!_mockSpec) {\n const spec = rootFile('test/core/undoc_api_4.0.json');\n if (!fs.existsSync(spec)) {\n throw new Error(\n `run 'bin/sdk_gen -f' to generate the API spec file '${spec}'`\n );\n }\n const obj = JSON.parse(fs.readFileSync(spec, utf8));\n _mockSpec = loader(obj);\n }\n return _mockSpec;\n};\n\n/**\n * Fully resolved path to a file in the codegen test data folder\n * @param filename to path. It can start with folders\n */\nexport const testFile = (filename = ''): string =>\n path.join(rootFile('/packages/sdk-codegen-utils/data/'), filename);\n\nexport class MeldSettings extends ApiSettings {\n constructor(private settings: Partial<IApiSettings>) {\n super(settings);\n }\n\n readConfig(_section?: string): IApiSection {\n return {\n client_id: (this.settings as any).client_id,\n client_secret: (this.settings as any).client_secret,\n };\n }\n}\n\n/**\n * Find a file from the current directory up to the root of the repository\n * @param fileName to find from current directory\n */\nexport const lookUp = (fileName: string) => {\n const root = getRootPath();\n let dir = __dirname;\n while (dir >= root) {\n const f = path.join(dir, fileName);\n if (fs.existsSync(f)) {\n return f;\n } else {\n dir = path.join(dir, '../');\n }\n }\n return '';\n};\n\n/**\n * Gets the cypress settings\n */\nexport const getCypressSettings = (): Record<string, string> => {\n const cypressFile = lookUp('cypress.env.json');\n const config: any = fs.existsSync(cypressFile)\n ? JSON.parse(fs.readFileSync(cypressFile, utf8))\n : {};\n const cypress: Record<string, string> = {};\n Object.keys(config).forEach(k => (cypress[k.toLowerCase()] = config[k]));\n const env = readEnvConfig('CYPRESS');\n return {\n ...cypress,\n ...env,\n };\n};\n\n/**\n * Melds CYPRESS environment variables with cypress.env.json and optional looker.ini and returns the settings collection\n * @param rootPath root location of repository\n * @param localIni full name of default looker.ini. Needs to be passed in, but doesn't need to exist\n */\nexport const loadApiSettings = (\n _rootPath: string,\n localIni: string\n): IApiSettings => {\n const cypressSettings = getCypressSettings();\n const local: IApiConfig = fs.existsSync(localIni)\n ? ApiConfigSection(fs.readFileSync(localIni, utf8))\n : {};\n const settings = {\n verify_ssl: false,\n base_url: 'https://localhost:19999',\n ...local,\n ...cypressSettings,\n };\n const result = new MeldSettings(settings);\n const creds = result.readConfig();\n if (isEmpty(creds)) {\n throw new Error(\n `Test SDK not initialized. Configure environment variables, 'cypress.env.json', or '${localIni}'`\n );\n }\n return result;\n};\n\n/**\n * get a random value use for entity name constraints\n */\nexport const randomize = () => {\n return Math.round(Math.random() * 100000);\n};\n\n/**\n * Create a uniquely named title\n * @param rando value to use for unique name combo\n * @param title of entity to name\n */\nexport const entitle = (rando: string | number, title?: string) => {\n return `${rando} ${title ?? ''}`.trim();\n};\n\nexport const createFunSdk = (): IAPIMethods => {\n const root = getRootPath();\n const localIni = process.env.LOOKERSDK_INI || `${root}looker.ini`;\n const settings = loadApiSettings(root, localIni);\n const session = new NodeSession(settings);\n return functionalSdk40(session);\n};\n\n/**\n * Reads configuration information, returning various test values\n * @param loader callback to load spec as APIModel\n * @param rootPath root file path location for relative path resolution\n */\nexport const TestConfig = (\n loader: SpecLoader,\n rootPath = getRootPath()\n): ITestConfig => {\n const testDataFile = 'data.yml';\n const envPrefix = 'LOOKERSDK';\n const sectionName = 'Looker';\n const localIni =\n process.env.LOOKERSDK_INI || path.join(rootPath, 'looker.ini');\n const settings = loadApiSettings(rootPath, localIni);\n const session = new NodeSession(settings);\n const sdk: IAPIMethods = new Looker40SDK(session);\n const testPath = path.join(rootPath, '/packages/sdk-codegen-utils/data/');\n const dataFile = testFile(testDataFile);\n const testData: any = fs.existsSync(dataFile)\n ? yaml.load(fs.readFileSync(dataFile, utf8))\n : {};\n const apiTestModel = specFromFile(testFile('openApiRef.json'), loader);\n const testIni = path.join(rootPath, testData.iniFile);\n const section = readIniConfig(localIni, envPrefix, sectionName);\n const baseUrl = section.base_url;\n const timeout = parseInt(section.timeout, 10);\n const testSection = readIniConfig(localIni, envPrefix, sectionName);\n return {\n apiTestModel,\n dataFile,\n localIni,\n rootPath,\n testData,\n testIni,\n testPath,\n settings,\n session,\n sdk,\n baseUrl,\n section,\n timeout,\n testSection,\n };\n};\n"],"mappings":";;;;;AA0BA,OAAO,KAAKA,EAAE,MAAM,IAAI;AACxB,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAO,KAAKC,IAAI,MAAM,SAAS;AAC/B,OAAOC,OAAO,MAAM,gBAAgB;AACpC,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,SACEC,gBAAgB,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O,CAAC;EACjD,IAAMM,QAAQ,GAAGvF,IAAI,CAAC2B,IAAI,CAACT,QAAQ,EAAE,mCAAmC,CAAC;EACzE,IAAMsE,QAAQ,GAAGnD,QAAQ,CAAC8C,YAAY,CAAC;EACvC,IAAMM,QAAa,GAAG1F,EAAE,CAACgC,UAAU,CAACyD,QAAQ,CAAC,GACzCvF,IAAI,CAACyF,IAAI,CAAC3F,EAAE,CAACiB,YAAY,CAACwE,QAAQ,EAAE7E,IAAI,CAAC,CAAC,GAC1C,CAAC,CAAC;EACN,IAAMgF,YAAY,GAAG/E,YAAY,CAACyB,QAAQ,CAAC,iBAAiB,CAAC,EAAEvB,MAAM,CAAC;EACtE,IAAM8E,OAAO,GAAG5F,IAAI,CAAC2B,IAAI,CAACT,QAAQ,EAAEuE,QAAQ,CAACI,OAAO,CAAC;EACrD,IAAMC,OAAO,GAAGvF,aAAa,CAACwD,QAAQ,EAAEqB,SAAS,EAAEC,WAAW,CAAC;EAC/D,IAAMU,OAAO,GAAGD,OAAO,CAAC3B,QAAQ;EAChC,IAAM6B,OAAO,GAAGC,QAAQ,CAACH,OAAO,CAACE,OAAO,EAAE,EAAE,CAAC;EAC7C,IAAME,WAAW,GAAG3F,aAAa,CAACwD,QAAQ,EAAEqB,SAAS,EAAEC,WAAW,CAAC;EACnE,OAAO;IACLM,YAAY;IACZH,QAAQ;IACRzB,QAAQ;IACR7C,QAAQ;IACRuE,QAAQ;IACRG,OAAO;IACPL,QAAQ;IACR9C,QAAQ;IACRwC,OAAO;IACPK,GAAG;IACHS,OAAO;IACPD,OAAO;IACPE,OAAO;IACPE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["Reset","FgRed","FgGreen","FgYellow","FgCyan","log","message","console","reset","concat","info","warn","danger","success","debug","value","undefined","JSON","stringify","dump"],"sources":["../../src/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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\n/* eslint no-console: 0 */\nconst Reset = '\\x1b[0m';\n// const Bright = \"\\x1b[1m\"\n// const Dim = \"\\x1b[2m\"\n// const Underscore = \"\\x1b[4m\"\n// const Blink = \"\\x1b[5m\"\n// const Reverse = \"\\x1b[7m\"\n// const Hidden = \"\\x1b[8m\"\n//\n// const FgBlack = \"\\x1b[30m\"\nconst FgRed = '\\x1b[31m';\nconst FgGreen = '\\x1b[32m';\nconst FgYellow = '\\x1b[33m';\n// const FgBlue = \"\\x1b[34m\"\n// const FgMagenta = \"\\x1b[35m\"\nconst FgCyan = '\\x1b[36m';\n// const FgWhite = \"\\x1b[37m\"\n//\n// const BgBlack = \"\\x1b[40m\"\n// const BgRed = \"\\x1b[41m\"\n// const BgGreen = \"\\x1b[42m\"\n// const BgYellow = \"\\x1b[43m\"\n// const BgBlue = \"\\x1b[44m\"\n// const BgMagenta = \"\\x1b[45m\"\n// const BgCyan = \"\\x1b[46m\"\n// const BgWhite = \"\\x1b[47m\"\n\n// Abstraction of log so it can be skipped when quiet mode is enabled\nexport const log = (message?: any) => {\n console.log(message);\n return message;\n};\n\nconst reset = (message: any) => `${message}${Reset}`;\n\nexport const info = (message: any) => log(reset(`${FgCyan}${message}`));\n\nexport const warn = (message: any) => log(reset(`${FgYellow}${message}`));\n\nexport const danger = (message: any) => {\n return log(reset(`${FgRed}${message}`));\n};\n\nexport const success = (message: any) => {\n return log(reset(`${FgGreen}${message}`));\n};\n\nexport const debug = (message: any, value?: any) => {\n if (value !== undefined)\n console.log(message, '=>', JSON.stringify(value, null, 2));\n else return log(message);\n};\n\nexport const dump = (value: any) => log(JSON.stringify(value, null, 2));\n"],"mappings":"AA2BA,IAAMA,KAAK,GAAG,SAAS;AASvB,IAAMC,KAAK,GAAG,UAAU;AACxB,IAAMC,OAAO,GAAG,UAAU;AAC1B,IAAMC,QAAQ,GAAG,UAAU;AAG3B,IAAMC,MAAM,GAAG,UAAU;AAazB,OAAO,IAAMC,GAAG,GAAIC,OAAa,IAAK;EACpCC,OAAO,CAACF,GAAG,CAACC,OAAO,CAAC;EACpB,OAAOA,OAAO;AAChB,CAAC;AAED,IAAME,KAAK,GAAIF,OAAY,OAAAG,MAAA,CAAQH,OAAO,EAAAG,MAAA,CAAGT,KAAK,CAAE;AAEpD,OAAO,IAAMU,IAAI,GAAIJ,OAAY,IAAKD,GAAG,CAACG,KAAK,IAAAC,MAAA,CAAIL,MAAM,EAAAK,MAAA,CAAGH,OAAO,CAAE,CAAC,CAAC;AAEvE,OAAO,IAAMK,IAAI,GAAIL,OAAY,IAAKD,GAAG,CAACG,KAAK,IAAAC,MAAA,CAAIN,QAAQ,EAAAM,MAAA,CAAGH,OAAO,CAAE,CAAC,CAAC;AAEzE,OAAO,IAAMM,MAAM,GAAIN,OAAY,IAAK;EACtC,OAAOD,GAAG,CAACG,KAAK,IAAAC,MAAA,CAAIR,KAAK,EAAAQ,MAAA,CAAGH,OAAO,CAAE,CAAC,CAAC;AACzC,CAAC;AAED,OAAO,IAAMO,OAAO,GAAIP,OAAY,IAAK;EACvC,OAAOD,GAAG,CAACG,KAAK,IAAAC,MAAA,CAAIP,OAAO,EAAAO,MAAA,CAAGH,OAAO,CAAE,CAAC,CAAC;AAC3C,CAAC;AAED,OAAO,IAAMQ,KAAK,GAAGA,CAACR,OAAY,EAAES,KAAW,KAAK;EAClD,IAAIA,KAAK,KAAKC,SAAS,EACrBT,OAAO,CAACF,GAAG,CAACC,OAAO,EAAE,IAAI,EAAEW,IAAI,CAACC,SAAS,CAACH,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KACxD,OAAOV,GAAG,CAACC,OAAO,CAAC;AAC1B,CAAC;AAED,OAAO,IAAMa,IAAI,GAAIJ,KAAU,IAAKV,GAAG,CAACY,IAAI,CAACC,SAAS,CAACH,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"utils.js","names":["Reset","FgRed","FgGreen","FgYellow","FgCyan","log","message","console","reset","concat","info","warn","danger","success","debug","value","undefined","JSON","stringify","dump"],"sources":["../../src/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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\n/* eslint no-console: 0 */\nconst Reset = '\\x1b[0m';\n// const Bright = \"\\x1b[1m\"\n// const Dim = \"\\x1b[2m\"\n// const Underscore = \"\\x1b[4m\"\n// const Blink = \"\\x1b[5m\"\n// const Reverse = \"\\x1b[7m\"\n// const Hidden = \"\\x1b[8m\"\n//\n// const FgBlack = \"\\x1b[30m\"\nconst FgRed = '\\x1b[31m';\nconst FgGreen = '\\x1b[32m';\nconst FgYellow = '\\x1b[33m';\n// const FgBlue = \"\\x1b[34m\"\n// const FgMagenta = \"\\x1b[35m\"\nconst FgCyan = '\\x1b[36m';\n// const FgWhite = \"\\x1b[37m\"\n//\n// const BgBlack = \"\\x1b[40m\"\n// const BgRed = \"\\x1b[41m\"\n// const BgGreen = \"\\x1b[42m\"\n// const BgYellow = \"\\x1b[43m\"\n// const BgBlue = \"\\x1b[44m\"\n// const BgMagenta = \"\\x1b[45m\"\n// const BgCyan = \"\\x1b[46m\"\n// const BgWhite = \"\\x1b[47m\"\n\n// Abstraction of log so it can be skipped when quiet mode is enabled\nexport const log = (message?: any) => {\n console.log(message);\n return message;\n};\n\nconst reset = (message: any) => `${message}${Reset}`;\n\nexport const info = (message: any) => log(reset(`${FgCyan}${message}`));\n\nexport const warn = (message: any) => log(reset(`${FgYellow}${message}`));\n\nexport const danger = (message: any) => {\n return log(reset(`${FgRed}${message}`));\n};\n\nexport const success = (message: any) => {\n return log(reset(`${FgGreen}${message}`));\n};\n\nexport const debug = (message: any, value?: any) => {\n if (value !== undefined)\n console.log(message, '=>', JSON.stringify(value, null, 2));\n else return log(message);\n};\n\nexport const dump = (value: any) => log(JSON.stringify(value, null, 2));\n"],"mappings":"AA2BA,IAAMA,KAAK,GAAG,SAAS;AASvB,IAAMC,KAAK,GAAG,UAAU;AACxB,IAAMC,OAAO,G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ACH,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC","ignoreList":[]}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_utils","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_mocks","_testUtils"],"sources":["../src/index.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\nexport * from './utils';\nexport * from './mocks';\nexport * from './testUtils';\n"],"mappings":";;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,UAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,UAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,UAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,UAAA,CAAAN,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_utils","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_mocks","_testUtils"],"sources":["../src/index.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\nexport * from './utils';\nexport * from './mocks';\nexport * from './testUtils';\n"],"mappings":";;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,UAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,UAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,UAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,UAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
package/lib/mocks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mocks.js","names":["MockCrypto","secureRandom","_byteCount","sha256Hash","_message","Promise","resolve","exports"],"sources":["../src/mocks.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ICryptoHash } from '@looker/sdk-rtl';\n\nexport class MockCrypto implements ICryptoHash {\n secureRandom(_byteCount: number): string {\n return 'feedface';\n }\n\n sha256Hash(_message: string): Promise<string> {\n return Promise.resolve('baadf00d');\n }\n}\n"],"mappings":";;;;;;AA4BO,MAAMA,UAAU,CAAwB;EAC7CC,YAAYA,CAACC,UAAkB,EAAU;IACvC,OAAO,UAAU;EACnB;EAEAC,UAAUA,CAACC,QAAgB,EAAmB;IAC5C,OAAOC,OAAO,CAACC,OAAO,CAAC,UAAU,CAAC;EACpC;AACF;AAACC,OAAA,CAAAP,UAAA,GAAAA,UAAA"}
1
+ {"version":3,"file":"mocks.js","names":["MockCrypto","secureRandom","_byteCount","sha256Hash","_message","Promise","resolve","exports"],"sources":["../src/mocks.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ICryptoHash } from '@looker/sdk-rtl';\n\nexport class MockCrypto implements ICryptoHash {\n secureRandom(_byteCount: number): string {\n return 'feedface';\n }\n\n sha256Hash(_message: string): Promise<string> {\n return Promise.resolve('baadf00d');\n }\n}\n"],"mappings":";;;;;;AA4BO,MAAMA,UAAU,CAAwB;EAC7CC,YAAYA,CAACC,UAAkB,EAAU;IACvC,OAAO,UAAU;EACnB;EAEAC,UAAUA,CAACC,QAAgB,EAAmB;IAC5C,OAAOC,OAAO,CAACC,OAAO,CAAC,UAAU,CAAC;EACpC;AACF;AAACC,OAAA,CAAAP,UAAA,GAAAA,UAAA","ignoreList":[]}
package/lib/testUtils.js CHANGED
@@ -12,13 +12,12 @@ var _findRoot = require("@manypkg/find-root");
12
12
  var _sdkNode = require("@looker/sdk-node");
13
13
  var _sdkRtl = require("@looker/sdk-rtl");
14
14
  var _sdk = require("@looker/sdk");
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
18
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
19
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
21
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
22
  var utf8 = 'utf-8';
24
23
  var specFromFile = (specFile, loader) => {
@@ -1 +1 @@
1
- {"version":3,"file":"testUtils.js","names":["fs","_interopRequireWildcard","require","_path","_interopRequireDefault","yaml","_isEmpty","_findRoot","_sdkNode","_sdkRtl","_sdk","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","utf8","specFromFile","specFile","loader","specContent","readFileSync","encoding","exports","rootPath","getRootPath","findRootSync","__dirname","rootDir","rootFile","fileName","undefined","path","join","_mockSpec","mockApiSpec","spec","existsSync","Error","concat","JSON","parse","testFile","filename","MeldSettings","ApiSettings","constructor","settings","readConfig","_section","client_id","client_secret","lookUp","root","dir","f","getCypressSettings","cypressFile","config","cypress","k","toLowerCase","env","readEnvConfig","loadApiSettings","_rootPath","localIni","cypressSettings","local","ApiConfigSection","verify_ssl","base_url","result","creds","isEmpty","randomize","Math","round","random","entitle","rando","title","trim","createFunSdk","process","LOOKERSDK_INI","session","NodeSession","functionalSdk40","TestConfig","testDataFile","envPrefix","sectionName","sdk","Looker40SDK","testPath","dataFile","testData","load","apiTestModel","testIni","iniFile","section","readIniConfig","baseUrl","timeout","parseInt","testSection"],"sources":["../src/testUtils.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 * as fs from 'fs';\nimport path from 'path';\nimport * as yaml from 'js-yaml';\nimport isEmpty from 'lodash/isEmpty';\nimport { findRootSync } from '@manypkg/find-root';\nimport type { IApiConfig } from '@looker/sdk-node';\nimport {\n ApiConfigSection,\n NodeSession,\n readEnvConfig,\n readIniConfig,\n} from '@looker/sdk-node';\nimport type {\n IAPIMethods,\n IApiSection,\n IApiSettings,\n IAuthSession,\n} from '@looker/sdk-rtl';\nimport { ApiSettings } from '@looker/sdk-rtl';\n/* eslint-disable no-restricted-imports */\nimport { Looker40SDK, functionalSdk40 } from '@looker/sdk';\n\nconst utf8 = 'utf-8';\nexport type SpecLoader = (content: any) => any;\n\n/**\n * Convert a spec file into an APIModel\n * @param specFile name of spec file\n * @param loader callback to load spec as APIModel\n */\nexport const specFromFile = (specFile: string, loader: SpecLoader): any => {\n const specContent = fs.readFileSync(specFile, { encoding: utf8 });\n return loader(specContent);\n};\n\n/**\n * Properties used for various typescript-based tests\n */\nexport interface ITestConfig {\n /** the openApi.json snapshot in the test/ dir */\n apiTestModel: any;\n /** root dir of this repository */\n rootPath: string;\n /** <rootPath>/test dir */\n testPath: string;\n /** test/data.yml file */\n dataFile: string;\n /** root looker.ini file or LOOKERSDK_INI value */\n localIni: string;\n /** contents of test/data.yml */\n testData: any;\n /** ini file configured in testData */\n testIni: string;\n /* melded API config settings */\n settings: IApiSettings;\n /** melded sdk configuration session */\n session: IAuthSession;\n /** initialized typescript SDK from melded configuration */\n sdk: IAPIMethods;\n /** configured API base url */\n baseUrl: string;\n /** configured default INI section */\n section: any;\n /** configured timeout value */\n timeout: number;\n /** test INI section */\n testSection: any;\n}\n\nlet rootPath = '';\n/** fully resolved root dir of the repository */\nexport const getRootPath = (): string => {\n if (!rootPath) {\n rootPath = findRootSync(__dirname).rootDir;\n }\n return rootPath;\n};\n\n/**\n * Fully resolved path to a file based from the root path\n * @param fileName to path. It can start with folders\n */\nexport const rootFile = (fileName = ''): string =>\n path.join(getRootPath(), fileName);\n\nlet _mockSpec: any;\n/**\n * Returns the entire \"undocumented\" API specification as the model to use for mocking\n * because it includes everything from our current API\n * @param loader callback to load spec as APIModel\n */\nexport const mockApiSpec = (loader: SpecLoader) => {\n if (!_mockSpec) {\n const spec = rootFile('test/core/undoc_api_4.0.json');\n if (!fs.existsSync(spec)) {\n throw new Error(\n `run 'bin/sdk_gen -f' to generate the API spec file '${spec}'`\n );\n }\n const obj = JSON.parse(fs.readFileSync(spec, utf8));\n _mockSpec = loader(obj);\n }\n return _mockSpec;\n};\n\n/**\n * Fully resolved path to a file in the codegen test data folder\n * @param filename to path. It can start with folders\n */\nexport const testFile = (filename = ''): string =>\n path.join(rootFile('/packages/sdk-codegen-utils/data/'), filename);\n\nexport class MeldSettings extends ApiSettings {\n constructor(private settings: Partial<IApiSettings>) {\n super(settings);\n }\n\n readConfig(_section?: string): IApiSection {\n return {\n client_id: (this.settings as any).client_id,\n client_secret: (this.settings as any).client_secret,\n };\n }\n}\n\n/**\n * Find a file from the current directory up to the root of the repository\n * @param fileName to find from current directory\n */\nexport const lookUp = (fileName: string) => {\n const root = getRootPath();\n let dir = __dirname;\n while (dir >= root) {\n const f = path.join(dir, fileName);\n if (fs.existsSync(f)) {\n return f;\n } else {\n dir = path.join(dir, '../');\n }\n }\n return '';\n};\n\n/**\n * Gets the cypress settings\n */\nexport const getCypressSettings = (): Record<string, string> => {\n const cypressFile = lookUp('cypress.env.json');\n const config: any = fs.existsSync(cypressFile)\n ? JSON.parse(fs.readFileSync(cypressFile, utf8))\n : {};\n const cypress: Record<string, string> = {};\n Object.keys(config).forEach(k => (cypress[k.toLowerCase()] = config[k]));\n const env = readEnvConfig('CYPRESS');\n return {\n ...cypress,\n ...env,\n };\n};\n\n/**\n * Melds CYPRESS environment variables with cypress.env.json and optional looker.ini and returns the settings collection\n * @param rootPath root location of repository\n * @param localIni full name of default looker.ini. Needs to be passed in, but doesn't need to exist\n */\nexport const loadApiSettings = (\n _rootPath: string,\n localIni: string\n): IApiSettings => {\n const cypressSettings = getCypressSettings();\n const local: IApiConfig = fs.existsSync(localIni)\n ? ApiConfigSection(fs.readFileSync(localIni, utf8))\n : {};\n const settings = {\n verify_ssl: false,\n base_url: 'https://localhost:19999',\n ...local,\n ...cypressSettings,\n };\n const result = new MeldSettings(settings);\n const creds = result.readConfig();\n if (isEmpty(creds)) {\n throw new Error(\n `Test SDK not initialized. Configure environment variables, 'cypress.env.json', or '${localIni}'`\n );\n }\n return result;\n};\n\n/**\n * get a random value use for entity name constraints\n */\nexport const randomize = () => {\n return Math.round(Math.random() * 100000);\n};\n\n/**\n * Create a uniquely named title\n * @param rando value to use for unique name combo\n * @param title of entity to name\n */\nexport const entitle = (rando: string | number, title?: string) => {\n return `${rando} ${title ?? ''}`.trim();\n};\n\nexport const createFunSdk = (): IAPIMethods => {\n const root = getRootPath();\n const localIni = process.env.LOOKERSDK_INI || `${root}looker.ini`;\n const settings = loadApiSettings(root, localIni);\n const session = new NodeSession(settings);\n return functionalSdk40(session);\n};\n\n/**\n * Reads configuration information, returning various test values\n * @param loader callback to load spec as APIModel\n * @param rootPath root file path location for relative path resolution\n */\nexport const TestConfig = (\n loader: SpecLoader,\n rootPath = getRootPath()\n): ITestConfig => {\n const testDataFile = 'data.yml';\n const envPrefix = 'LOOKERSDK';\n const sectionName = 'Looker';\n const localIni =\n process.env.LOOKERSDK_INI || path.join(rootPath, 'looker.ini');\n const settings = loadApiSettings(rootPath, localIni);\n const session = new NodeSession(settings);\n const sdk: IAPIMethods = new Looker40SDK(session);\n const testPath = path.join(rootPath, '/packages/sdk-codegen-utils/data/');\n const dataFile = testFile(testDataFile);\n const testData: any = fs.existsSync(dataFile)\n ? yaml.load(fs.readFileSync(dataFile, utf8))\n : {};\n const apiTestModel = specFromFile(testFile('openApiRef.json'), loader);\n const testIni = path.join(rootPath, testData.iniFile);\n const section = readIniConfig(localIni, envPrefix, sectionName);\n const baseUrl = section.base_url;\n const timeout = parseInt(section.timeout, 10);\n const testSection = readIniConfig(localIni, envPrefix, sectionName);\n return {\n apiTestModel,\n dataFile,\n localIni,\n rootPath,\n testData,\n testIni,\n testPath,\n settings,\n session,\n sdk,\n baseUrl,\n section,\n timeout,\n testSection,\n };\n};\n"],"mappings":";;;;;;AA0BA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AAYA,IAAAO,OAAA,GAAAP,OAAA;AAEA,IAAAQ,IAAA,GAAAR,OAAA;AAA2D,SAAAE,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,C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}
1
+ {"version":3,"file":"testUtils.js","names":["fs","_interopRequireWildcard","require","_path","_interopRequireDefault","yaml","_isEmpty","_findRoot","_sdkNode","_sdkRtl","_sdk","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","utf8","specFromFile","specFile","loader","specContent","readFileSync","encoding","exports","rootPath","getRootPath","findRootSync","__dirname","rootDir","rootFile","fileName","undefined","path","join","_mockSpec","mockApiSpec","spec","existsSync","Error","concat","obj","JSON","parse","testFile","filename","MeldSettings","ApiSettings","constructor","settings","readConfig","_section","client_id","client_secret","lookUp","root","dir","getCypressSettings","cypressFile","config","cypress","k","toLowerCase","env","readEnvConfig","loadApiSettings","_rootPath","localIni","cypressSettings","local","ApiConfigSection","verify_ssl","base_url","result","creds","isEmpty","randomize","Math","round","random","entitle","rando","title","trim","createFunSdk","process","LOOKERSDK_INI","session","NodeSession","functionalSdk40","TestConfig","testDataFile","envPrefix","sectionName","sdk","Looker40SDK","testPath","dataFile","testData","load","apiTestModel","testIni","iniFile","section","readIniConfig","baseUrl","timeout","parseInt","testSection"],"sources":["../src/testUtils.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 * as fs from 'fs';\nimport path from 'path';\nimport * as yaml from 'js-yaml';\nimport isEmpty from 'lodash/isEmpty';\nimport { findRootSync } from '@manypkg/find-root';\nimport type { IApiConfig } from '@looker/sdk-node';\nimport {\n ApiConfigSection,\n NodeSession,\n readEnvConfig,\n readIniConfig,\n} from '@looker/sdk-node';\nimport type {\n IAPIMethods,\n IApiSection,\n IApiSettings,\n IAuthSession,\n} from '@looker/sdk-rtl';\nimport { ApiSettings } from '@looker/sdk-rtl';\n/* eslint-disable no-restricted-imports */\nimport { Looker40SDK, functionalSdk40 } from '@looker/sdk';\n\nconst utf8 = 'utf-8';\nexport type SpecLoader = (content: any) => any;\n\n/**\n * Convert a spec file into an APIModel\n * @param specFile name of spec file\n * @param loader callback to load spec as APIModel\n */\nexport const specFromFile = (specFile: string, loader: SpecLoader): any => {\n const specContent = fs.readFileSync(specFile, { encoding: utf8 });\n return loader(specContent);\n};\n\n/**\n * Properties used for various typescript-based tests\n */\nexport interface ITestConfig {\n /** the openApi.json snapshot in the test/ dir */\n apiTestModel: any;\n /** root dir of this repository */\n rootPath: string;\n /** <rootPath>/test dir */\n testPath: string;\n /** test/data.yml file */\n dataFile: string;\n /** root looker.ini file or LOOKERSDK_INI value */\n localIni: string;\n /** contents of test/data.yml */\n testData: any;\n /** ini file configured in testData */\n testIni: string;\n /* melded API config settings */\n settings: IApiSettings;\n /** melded sdk configuration session */\n session: IAuthSession;\n /** initialized typescript SDK from melded configuration */\n sdk: IAPIMethods;\n /** configured API base url */\n baseUrl: string;\n /** configured default INI section */\n section: any;\n /** configured timeout value */\n timeout: number;\n /** test INI section */\n testSection: any;\n}\n\nlet rootPath = '';\n/** fully resolved root dir of the repository */\nexport const getRootPath = (): string => {\n if (!rootPath) {\n rootPath = findRootSync(__dirname).rootDir;\n }\n return rootPath;\n};\n\n/**\n * Fully resolved path to a file based from the root path\n * @param fileName to path. It can start with folders\n */\nexport const rootFile = (fileName = ''): string =>\n path.join(getRootPath(), fileName);\n\nlet _mockSpec: any;\n/**\n * Returns the entire \"undocumented\" API specification as the model to use for mocking\n * because it includes everything from our current API\n * @param loader callback to load spec as APIModel\n */\nexport const mockApiSpec = (loader: SpecLoader) => {\n if (!_mockSpec) {\n const spec = rootFile('test/core/undoc_api_4.0.json');\n if (!fs.existsSync(spec)) {\n throw new Error(\n `run 'bin/sdk_gen -f' to generate the API spec file '${spec}'`\n );\n }\n const obj = JSON.parse(fs.readFileSync(spec, utf8));\n _mockSpec = loader(obj);\n }\n return _mockSpec;\n};\n\n/**\n * Fully resolved path to a file in the codegen test data folder\n * @param filename to path. It can start with folders\n */\nexport const testFile = (filename = ''): string =>\n path.join(rootFile('/packages/sdk-codegen-utils/data/'), filename);\n\nexport class MeldSettings extends ApiSettings {\n constructor(private settings: Partial<IApiSettings>) {\n super(settings);\n }\n\n readConfig(_section?: string): IApiSection {\n return {\n client_id: (this.settings as any).client_id,\n client_secret: (this.settings as any).client_secret,\n };\n }\n}\n\n/**\n * Find a file from the current directory up to the root of the repository\n * @param fileName to find from current directory\n */\nexport const lookUp = (fileName: string) => {\n const root = getRootPath();\n let dir = __dirname;\n while (dir >= root) {\n const f = path.join(dir, fileName);\n if (fs.existsSync(f)) {\n return f;\n } else {\n dir = path.join(dir, '../');\n }\n }\n return '';\n};\n\n/**\n * Gets the cypress settings\n */\nexport const getCypressSettings = (): Record<string, string> => {\n const cypressFile = lookUp('cypress.env.json');\n const config: any = fs.existsSync(cypressFile)\n ? JSON.parse(fs.readFileSync(cypressFile, utf8))\n : {};\n const cypress: Record<string, string> = {};\n Object.keys(config).forEach(k => (cypress[k.toLowerCase()] = config[k]));\n const env = readEnvConfig('CYPRESS');\n return {\n ...cypress,\n ...env,\n };\n};\n\n/**\n * Melds CYPRESS environment variables with cypress.env.json and optional looker.ini and returns the settings collection\n * @param rootPath root location of repository\n * @param localIni full name of default looker.ini. Needs to be passed in, but doesn't need to exist\n */\nexport const loadApiSettings = (\n _rootPath: string,\n localIni: string\n): IApiSettings => {\n const cypressSettings = getCypressSettings();\n const local: IApiConfig = fs.existsSync(localIni)\n ? ApiConfigSection(fs.readFileSync(localIni, utf8))\n : {};\n const settings = {\n verify_ssl: false,\n base_url: 'https://localhost:19999',\n ...local,\n ...cypressSettings,\n };\n const result = new MeldSettings(settings);\n const creds = result.readConfig();\n if (isEmpty(creds)) {\n throw new Error(\n `Test SDK not initialized. Configure environment variables, 'cypress.env.json', or '${localIni}'`\n );\n }\n return result;\n};\n\n/**\n * get a random value use for entity name constraints\n */\nexport const randomize = () => {\n return Math.round(Math.random() * 100000);\n};\n\n/**\n * Create a uniquely named title\n * @param rando value to use for unique name combo\n * @param title of entity to name\n */\nexport const entitle = (rando: string | number, title?: string) => {\n return `${rando} ${title ?? ''}`.trim();\n};\n\nexport const createFunSdk = (): IAPIMethods => {\n const root = getRootPath();\n const localIni = process.env.LOOKERSDK_INI || `${root}looker.ini`;\n const settings = loadApiSettings(root, localIni);\n const session = new NodeSession(settings);\n return functionalSdk40(session);\n};\n\n/**\n * Reads configuration information, returning various test values\n * @param loader callback to load spec as APIModel\n * @param rootPath root file path location for relative path resolution\n */\nexport const TestConfig = (\n loader: SpecLoader,\n rootPath = getRootPath()\n): ITestConfig => {\n const testDataFile = 'data.yml';\n const envPrefix = 'LOOKERSDK';\n const sectionName = 'Looker';\n const localIni =\n process.env.LOOKERSDK_INI || path.join(rootPath, 'looker.ini');\n const settings = loadApiSettings(rootPath, localIni);\n const session = new NodeSession(settings);\n const sdk: IAPIMethods = new Looker40SDK(session);\n const testPath = path.join(rootPath, '/packages/sdk-codegen-utils/data/');\n const dataFile = testFile(testDataFile);\n const testData: any = fs.existsSync(dataFile)\n ? yaml.load(fs.readFileSync(dataFile, utf8))\n : {};\n const apiTestModel = specFromFile(testFile('openApiRef.json'), loader);\n const testIni = path.join(rootPath, testData.iniFile);\n const section = readIniConfig(localIni, envPrefix, sectionName);\n const baseUrl = section.base_url;\n const timeout = parseInt(section.timeout, 10);\n const testSection = readIniConfig(localIni, envPrefix, sectionName);\n return {\n apiTestModel,\n dataFile,\n localIni,\n rootPath,\n testData,\n testIni,\n testPath,\n settings,\n session,\n sdk,\n baseUrl,\n section,\n timeout,\n testSection,\n };\n};\n"],"mappings":";;;;;;AA0BA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AAYA,IAAAO,OAAA,GAAAP,OAAA;AAEA,IAAAQ,IAAA,GAAAR,OAAA;AAA2D,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,wBAAAU,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBA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O;IACPE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
package/lib/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["Reset","FgRed","FgGreen","FgYellow","FgCyan","log","message","console","exports","reset","concat","info","warn","danger","success","debug","value","undefined","JSON","stringify","dump"],"sources":["../src/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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\n/* eslint no-console: 0 */\nconst Reset = '\\x1b[0m';\n// const Bright = \"\\x1b[1m\"\n// const Dim = \"\\x1b[2m\"\n// const Underscore = \"\\x1b[4m\"\n// const Blink = \"\\x1b[5m\"\n// const Reverse = \"\\x1b[7m\"\n// const Hidden = \"\\x1b[8m\"\n//\n// const FgBlack = \"\\x1b[30m\"\nconst FgRed = '\\x1b[31m';\nconst FgGreen = '\\x1b[32m';\nconst FgYellow = '\\x1b[33m';\n// const FgBlue = \"\\x1b[34m\"\n// const FgMagenta = \"\\x1b[35m\"\nconst FgCyan = '\\x1b[36m';\n// const FgWhite = \"\\x1b[37m\"\n//\n// const BgBlack = \"\\x1b[40m\"\n// const BgRed = \"\\x1b[41m\"\n// const BgGreen = \"\\x1b[42m\"\n// const BgYellow = \"\\x1b[43m\"\n// const BgBlue = \"\\x1b[44m\"\n// const BgMagenta = \"\\x1b[45m\"\n// const BgCyan = \"\\x1b[46m\"\n// const BgWhite = \"\\x1b[47m\"\n\n// Abstraction of log so it can be skipped when quiet mode is enabled\nexport const log = (message?: any) => {\n console.log(message);\n return message;\n};\n\nconst reset = (message: any) => `${message}${Reset}`;\n\nexport const info = (message: any) => log(reset(`${FgCyan}${message}`));\n\nexport const warn = (message: any) => log(reset(`${FgYellow}${message}`));\n\nexport const danger = (message: any) => {\n return log(reset(`${FgRed}${message}`));\n};\n\nexport const success = (message: any) => {\n return log(reset(`${FgGreen}${message}`));\n};\n\nexport const debug = (message: any, value?: any) => {\n if (value !== undefined)\n console.log(message, '=>', JSON.stringify(value, null, 2));\n else return log(message);\n};\n\nexport const dump = (value: any) => log(JSON.stringify(value, null, 2));\n"],"mappings":";;;;;;AA2BA,IAAMA,KAAK,GAAG,SAAS;AASvB,IAAMC,KAAK,GAAG,UAAU;AACxB,IAAMC,OAAO,GAAG,UAAU;AAC1B,IAAMC,QAAQ,GAAG,UAAU;AAG3B,IAAMC,MAAM,GAAG,UAAU;AAalB,IAAMC,GAAG,GAAIC,OAAa,IAAK;EACpCC,OAAO,CAACF,GAAG,CAACC,OAAO,CAAC;EACpB,OAAOA,OAAO;AAChB,CAAC;AAACE,OAAA,CAAAH,GAAA,GAAAA,GAAA;AAEF,IAAMI,KAAK,GAAIH,OAAY,OAAAI,MAAA,CAAQJ,OAAO,EAAAI,MAAA,CAAGV,KAAK,CAAE;AAE7C,IAAMW,IAAI,GAAIL,OAAY,IAAKD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIN,MAAM,EAAAM,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AAACE,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAEjE,IAAMC,IAAI,GAAIN,OAAY,IAAKD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIP,QAAQ,EAAAO,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AAACE,OAAA,CAAAI,IAAA,GAAAA,IAAA;AAEnE,IAAMC,MAAM,GAAIP,OAAY,IAAK;EACtC,OAAOD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIT,KAAK,EAAAS,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AACzC,CAAC;AAACE,OAAA,CAAAK,MAAA,GAAAA,MAAA;AAEK,IAAMC,OAAO,GAAIR,OAAY,IAAK;EACvC,OAAOD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIR,OAAO,EAAAQ,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AAC3C,CAAC;AAACE,OAAA,CAAAM,OAAA,GAAAA,OAAA;AAEK,IAAMC,KAAK,GAAGA,CAACT,OAAY,EAAEU,KAAW,KAAK;EAClD,IAAIA,KAAK,KAAKC,SAAS,EACrBV,OAAO,CAACF,GAAG,CAACC,OAAO,EAAE,IAAI,EAAEY,IAAI,CAACC,SAAS,CAACH,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KACxD,OAAOX,GAAG,CAACC,OAAO,CAAC;AAC1B,CAAC;AAACE,OAAA,CAAAO,KAAA,GAAAA,KAAA;AAEK,IAAMK,IAAI,GAAIJ,KAAU,IAAKX,GAAG,CAACa,IAAI,CAACC,SAAS,CAACH,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAACR,OAAA,CAAAY,IAAA,GAAAA,IAAA"}
1
+ {"version":3,"file":"utils.js","names":["Reset","FgRed","FgGreen","FgYellow","FgCyan","log","message","console","exports","reset","concat","info","warn","danger","success","debug","value","undefined","JSON","stringify","dump"],"sources":["../src/utils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2023 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\n/* eslint no-console: 0 */\nconst Reset = '\\x1b[0m';\n// const Bright = \"\\x1b[1m\"\n// const Dim = \"\\x1b[2m\"\n// const Underscore = \"\\x1b[4m\"\n// const Blink = \"\\x1b[5m\"\n// const Reverse = \"\\x1b[7m\"\n// const Hidden = \"\\x1b[8m\"\n//\n// const FgBlack = \"\\x1b[30m\"\nconst FgRed = '\\x1b[31m';\nconst FgGreen = '\\x1b[32m';\nconst FgYellow = '\\x1b[33m';\n// const FgBlue = \"\\x1b[34m\"\n// const FgMagenta = \"\\x1b[35m\"\nconst FgCyan = '\\x1b[36m';\n// const FgWhite = \"\\x1b[37m\"\n//\n// const BgBlack = \"\\x1b[40m\"\n// const BgRed = \"\\x1b[41m\"\n// const BgGreen = \"\\x1b[42m\"\n// const BgYellow = \"\\x1b[43m\"\n// const BgBlue = \"\\x1b[44m\"\n// const BgMagenta = \"\\x1b[45m\"\n// const BgCyan = \"\\x1b[46m\"\n// const BgWhite = \"\\x1b[47m\"\n\n// Abstraction of log so it can be skipped when quiet mode is enabled\nexport const log = (message?: any) => {\n console.log(message);\n return message;\n};\n\nconst reset = (message: any) => `${message}${Reset}`;\n\nexport const info = (message: any) => log(reset(`${FgCyan}${message}`));\n\nexport const warn = (message: any) => log(reset(`${FgYellow}${message}`));\n\nexport const danger = (message: any) => {\n return log(reset(`${FgRed}${message}`));\n};\n\nexport const success = (message: any) => {\n return log(reset(`${FgGreen}${message}`));\n};\n\nexport const debug = (message: any, value?: any) => {\n if (value !== undefined)\n console.log(message, '=>', JSON.stringify(value, null, 2));\n else return log(message);\n};\n\nexport const dump = (value: any) => log(JSON.stringify(value, null, 2));\n"],"mappings":";;;;;;AA2BA,IAAMA,KAAK,GAAG,SAAS;AASvB,IAAMC,KAAK,GAAG,UAAU;AACxB,IAAMC,OAAO,GAAG,UAAU;AAC1B,IAAMC,QAAQ,GAAG,UAAU;AAG3B,IAAMC,MAAM,GAAG,UAAU;AAalB,IAAMC,GAAG,GAAIC,OAAa,IAAK;EACpCC,OAAO,CAACF,GAAG,CAACC,OAAO,CAAC;EACpB,OAAOA,OAAO;AAChB,CAAC;AAACE,OAAA,CAAAH,GAAA,GAAAA,GAAA;AAEF,IAAMI,KAAK,GAAIH,OAAY,OAAAI,MAAA,CAAQJ,OAAO,EAAAI,MAAA,CAAGV,KAAK,CAAE;AAE7C,IAAMW,IAAI,GAAIL,OAAY,IAAKD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIN,MAAM,EAAAM,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AAACE,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAEjE,IAAMC,IAAI,GAAIN,OAAY,IAAKD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIP,QAAQ,EAAAO,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AAACE,OAAA,CAAAI,IAAA,GAAAA,IAAA;AAEnE,IAAMC,MAAM,GAAIP,OAAY,IAAK;EACtC,OAAOD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIT,KAAK,EAAAS,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AACzC,CAAC;AAACE,OAAA,CAAAK,MAAA,GAAAA,MAAA;AAEK,IAAMC,OAAO,GAAIR,OAAY,IAAK;EACvC,OAAOD,GAAG,CAACI,KAAK,IAAAC,MAAA,CAAIR,OAAO,EAAAQ,MAAA,CAAGJ,OAAO,CAAE,CAAC,CAAC;AAC3C,CAAC;AAACE,OAAA,CAAAM,OAAA,GAAAA,OAAA;AAEK,IAAMC,KAAK,GAAGA,CAACT,OAAY,EAAEU,KAAW,KAAK;EAClD,IAAIA,KAAK,KAAKC,SAAS,EACrBV,OAAO,CAACF,GAAG,CAACC,OAAO,EAAE,IAAI,EAAEY,IAAI,CAACC,SAAS,CAACH,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KACxD,OAAOX,GAAG,CAACC,OAAO,CAAC;AAC1B,CAAC;AAACE,OAAA,CAAAO,KAAA,GAAAA,KAAA;AAEK,IAAMK,IAAI,GAAIJ,KAAU,IAAKX,GAAG,CAACa,IAAI,CAACC,SAAS,CAACH,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAACR,OAAA,CAAAY,IAAA,GAAAA,IAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@looker/sdk-codegen-utils",
3
- "version": "21.0.32",
3
+ "version": "21.0.34",
4
4
  "description": "Looker SDK Codegen utils",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -31,13 +31,13 @@
31
31
  "watch:cjs": "yarn lerna exec --scope @looker/sdk-codegen-utils --stream 'BABEL_ENV=build_cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --no-comments --watch'"
32
32
  },
33
33
  "devDependencies": {
34
- "@looker/sdk": "26.6.1",
35
- "@looker/sdk-node": "26.6.1",
34
+ "@looker/sdk": "26.10.0",
35
+ "@looker/sdk-node": "26.10.0",
36
36
  "@looker/sdk-rtl": "21.6.5",
37
37
  "@manypkg/find-root": "2.2.1",
38
38
  "@types/js-yaml": "4.0.9",
39
39
  "js-yaml": "4.1.0",
40
40
  "lodash": "4.17.21"
41
41
  },
42
- "gitHead": "77fc3b4d67ce3c1f12a0a0670f3d04f4b07d9d63"
42
+ "gitHead": "f6ce5284341b7a0da6651f8f8122e69e96e28acc"
43
43
  }