diff --git a/base.tsconfig.json b/base.tsconfig.json new file mode 100644 index 0000000000..d080121851 --- /dev/null +++ b/base.tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "ES6", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "strict": true, + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "noLib": false, + "declaration": true, + "lib": ["ESNext"], + "outDir": "dist", + "typeRoots": ["node_modules/@types"], + "types": ["node"], + "resolveJsonModule": true + } +} diff --git a/clients/algoliasearch-client-javascript/client-abtesting/src/abtestingApi.ts b/clients/algoliasearch-client-javascript/client-abtesting/src/abtestingApi.ts index 1a89e077ac..87ad7188fa 100644 --- a/clients/algoliasearch-client-javascript/client-abtesting/src/abtestingApi.ts +++ b/clients/algoliasearch-client-javascript/client-abtesting/src/abtestingApi.ts @@ -52,18 +52,16 @@ export class AbtestingApi { constructor( appId: string, apiKey: string, - region: 'de' | 'us', + region?: 'de' | 'us', options?: { requester?: Requester; hosts?: Host[] } ) { if (!appId) { throw new Error('`appId` is missing.'); } + if (!apiKey) { throw new Error('`apiKey` is missing.'); } - if (!region) { - throw new Error('`region` is missing.'); - } this.setAuthentication({ appId, apiKey }); @@ -82,10 +80,12 @@ export class AbtestingApi { }); } - getDefaultHosts(region: 'de' | 'us'): Host[] { + getDefaultHosts(region?: 'de' | 'us'): Host[] { + const regionHost = region ? `.${region}.` : '.'; + return [ { - url: `analytics.${region}.algolia.com`, + url: `analytics${regionHost}algolia.com`, accept: 'readWrite', protocol: 'https', }, diff --git a/clients/algoliasearch-client-javascript/client-analytics/src/analyticsApi.ts b/clients/algoliasearch-client-javascript/client-analytics/src/analyticsApi.ts index c00490ab8d..0649d7e8f4 100644 --- a/clients/algoliasearch-client-javascript/client-analytics/src/analyticsApi.ts +++ b/clients/algoliasearch-client-javascript/client-analytics/src/analyticsApi.ts @@ -67,12 +67,13 @@ export class AnalyticsApi { constructor( appId: string, apiKey: string, - region: 'de' | 'us', + region?: 'de' | 'us', options?: { requester?: Requester; hosts?: Host[] } ) { if (!appId) { throw new Error('`appId` is missing.'); } + if (!apiKey) { throw new Error('`apiKey` is missing.'); } @@ -94,10 +95,12 @@ export class AnalyticsApi { }); } - getDefaultHosts(region: 'de' | 'us' = 'us'): Host[] { + getDefaultHosts(region?: 'de' | 'us'): Host[] { + const regionHost = region ? `.${region}.` : '.'; + return [ { - url: `analytics.${region}.algolia.com`, + url: `analytics${regionHost}algolia.com`, accept: 'readWrite', protocol: 'https', }, diff --git a/clients/algoliasearch-client-javascript/client-insights/src/insightsApi.ts b/clients/algoliasearch-client-javascript/client-insights/src/insightsApi.ts index 208fc062d6..e9a5fcc1ff 100644 --- a/clients/algoliasearch-client-javascript/client-insights/src/insightsApi.ts +++ b/clients/algoliasearch-client-javascript/client-insights/src/insightsApi.ts @@ -50,11 +50,13 @@ export class InsightsApi { constructor( appId: string, apiKey: string, + region?: 'de' | 'us', options?: { requester?: Requester; hosts?: Host[] } ) { if (!appId) { throw new Error('`appId` is missing.'); } + if (!apiKey) { throw new Error('`apiKey` is missing.'); } @@ -62,7 +64,7 @@ export class InsightsApi { this.setAuthentication({ appId, apiKey }); this.transporter = new Transporter({ - hosts: options?.hosts ?? this.getDefaultHosts(), + hosts: options?.hosts ?? this.getDefaultHosts(region), baseHeaders: { 'content-type': 'application/x-www-form-urlencoded', }, @@ -76,9 +78,15 @@ export class InsightsApi { }); } - getDefaultHosts(): Host[] { + getDefaultHosts(region?: 'de' | 'us'): Host[] { + const regionHost = region ? `.${region}.` : '.'; + return [ - { url: 'insights.algolia.io', accept: 'readWrite', protocol: 'https' }, + { + url: `insights${regionHost}algolia.io`, + accept: 'readWrite', + protocol: 'https', + }, ]; } diff --git a/clients/algoliasearch-client-javascript/client-personalization/src/personalizationApi.ts b/clients/algoliasearch-client-javascript/client-personalization/src/personalizationApi.ts index e7e9336553..4f9b848db1 100644 --- a/clients/algoliasearch-client-javascript/client-personalization/src/personalizationApi.ts +++ b/clients/algoliasearch-client-javascript/client-personalization/src/personalizationApi.ts @@ -58,9 +58,11 @@ export class PersonalizationApi { if (!appId) { throw new Error('`appId` is missing.'); } + if (!apiKey) { throw new Error('`apiKey` is missing.'); } + if (!region) { throw new Error('`region` is missing.'); } diff --git a/clients/algoliasearch-client-javascript/client-query-suggestions/src/querySuggestionsApi.ts b/clients/algoliasearch-client-javascript/client-query-suggestions/src/querySuggestionsApi.ts index c5cc944a96..00ac8685de 100644 --- a/clients/algoliasearch-client-javascript/client-query-suggestions/src/querySuggestionsApi.ts +++ b/clients/algoliasearch-client-javascript/client-query-suggestions/src/querySuggestionsApi.ts @@ -60,9 +60,11 @@ export class QuerySuggestionsApi { if (!appId) { throw new Error('`appId` is missing.'); } + if (!apiKey) { throw new Error('`apiKey` is missing.'); } + if (!region) { throw new Error('`region` is missing.'); } diff --git a/clients/algoliasearch-client-javascript/client-search/src/searchApi.ts b/clients/algoliasearch-client-javascript/client-search/src/searchApi.ts index 3232e89315..59b3e91ea9 100644 --- a/clients/algoliasearch-client-javascript/client-search/src/searchApi.ts +++ b/clients/algoliasearch-client-javascript/client-search/src/searchApi.ts @@ -109,6 +109,7 @@ export class SearchApi { if (!appId) { throw new Error('`appId` is missing.'); } + if (!apiKey) { throw new Error('`apiKey` is missing.'); } diff --git a/clients/algoliasearch-client-javascript/client-sources/src/sourcesApi.ts b/clients/algoliasearch-client-javascript/client-sources/src/sourcesApi.ts index 04f5d15f34..42516da5c6 100644 --- a/clients/algoliasearch-client-javascript/client-sources/src/sourcesApi.ts +++ b/clients/algoliasearch-client-javascript/client-sources/src/sourcesApi.ts @@ -53,6 +53,18 @@ export class SourcesApi { region: 'de' | 'us', options?: { requester?: Requester; hosts?: Host[] } ) { + if (!appId) { + throw new Error('`appId` is missing.'); + } + + if (!apiKey) { + throw new Error('`apiKey` is missing.'); + } + + if (!region) { + throw new Error('`region` is missing.'); + } + this.setAuthentication({ appId, apiKey }); this.transporter = new Transporter({ @@ -70,7 +82,7 @@ export class SourcesApi { }); } - getDefaultHosts(region: 'de' | 'us' = 'us'): Host[] { + getDefaultHosts(region: 'de' | 'us'): Host[] { return [ { url: `data.${region}.algolia.com`, diff --git a/clients/algoliasearch-client-javascript/recommend/src/recommendApi.ts b/clients/algoliasearch-client-javascript/recommend/src/recommendApi.ts index d52af3ceca..5a680f6242 100644 --- a/clients/algoliasearch-client-javascript/recommend/src/recommendApi.ts +++ b/clients/algoliasearch-client-javascript/recommend/src/recommendApi.ts @@ -55,6 +55,7 @@ export class RecommendApi { if (!appId) { throw new Error('`appId` is missing.'); } + if (!apiKey) { throw new Error('`apiKey` is missing.'); } diff --git a/openapitools.json b/openapitools.json index 4c4eba0dba..1e8f24dfc8 100644 --- a/openapitools.json +++ b/openapitools.json @@ -1,7 +1,7 @@ { "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "generator-cli": { - "version": "5.3.0", + "version": "5.4.0", "generators": { "javascript-search": { "generatorName": "typescript-node", @@ -19,9 +19,7 @@ "supportsES6": true, "npmName": "@algolia/client-search", "packageVersion": "5.0.0", - - "packageName": "@algolia/client-search", - "isSearchHost": true + "packageName": "@algolia/client-search" } }, "javascript-recommend": { @@ -40,9 +38,7 @@ "supportsES6": true, "npmName": "@algolia/recommend", "packageVersion": "5.0.0", - - "packageName": "@algolia/recommend", - "isSearchHost": true + "packageName": "@algolia/recommend" } }, "javascript-personalization": { @@ -60,11 +56,11 @@ "supportsES6": true, "npmName": "@algolia/client-personalization", "packageVersion": "5.0.0", - "packageName": "@algolia/client-personalization", "hasRegionalHost": true, "isEuHost": true, - "host": "personalization" + "host": "personalization", + "topLevelDomain": "com" } }, "javascript-analytics": { @@ -82,12 +78,12 @@ "supportsES6": true, "npmName": "@algolia/client-analytics", "packageVersion": "5.0.0", - "packageName": "@algolia/client-analytics", + "fallbackToAliasHost": true, "hasRegionalHost": true, "isDeHost": true, - "fallbackToUS": true, - "host": "analytics" + "host": "analytics", + "topLevelDomain": "com" } }, "javascript-insights": { @@ -105,9 +101,12 @@ "supportsES6": true, "npmName": "@algolia/client-insights", "packageVersion": "5.0.0", - "packageName": "@algolia/client-insights", - "host": "insights" + "fallbackToAliasHost": true, + "hasRegionalHost": true, + "isDeHost": true, + "host": "insights", + "topLevelDomain": "io" } }, "javascript-abtesting": { @@ -125,11 +124,12 @@ "supportsES6": true, "npmName": "@algolia/client-abtesting", "packageVersion": "5.0.0", - "packageName": "@algolia/client-abtesting", "hasRegionalHost": true, + "fallbackToAliasHost": true, "isDeHost": true, - "host": "analytics" + "host": "analytics", + "topLevelDomain": "com" } }, "javascript-query-suggestions": { @@ -147,11 +147,11 @@ "supportsES6": true, "npmName": "@algolia/client-query-suggestions", "packageVersion": "5.0.0", - "packageName": "@algolia/client-query-suggestions", "hasRegionalHost": true, "isEuHost": true, - "host": "query-suggestions" + "host": "query-suggestions", + "topLevelDomain": "com" } }, "javascript-sources": { @@ -169,11 +169,11 @@ "supportsES6": true, "npmName": "@algolia/client-sources", "packageVersion": "0.0.1", - "packageName": "@algolia/client-sources", "hasRegionalHost": true, "isDeHost": true, - "host": "data" + "host": "data", + "topLevelDomain": "com" } }, "java-search": { @@ -195,10 +195,9 @@ "sourceFolder": "algoliasearch-core", "java8": true, "dateLibrary": "java8", - "packageName": "algoliasearch-client-java-2" } } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 392c9e7c4a..f5c5573f43 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "workspaces": [ "clients/algoliasearch-client-javascript/*", "playground/javascript/", - "tests/" + "tests/", + "scripts/" ], "scripts": { "build:clients": "./scripts/multiplexer.sh ${2:-nonverbose} ./scripts/builds/clients.sh ${0:-all} ${1:-all}", @@ -29,7 +30,7 @@ "github-actions:lint": "eslint --ext=yml .github/" }, "devDependencies": { - "@openapitools/openapi-generator-cli": "2.4.18", + "@openapitools/openapi-generator-cli": "2.4.26", "@redocly/openapi-cli": "1.0.0-beta.79", "@typescript-eslint/eslint-plugin": "5.5.0", "@typescript-eslint/parser": "5.5.0", diff --git a/playground/javascript/tsconfig.json b/playground/javascript/tsconfig.json index a41048fa96..89cca43a96 100644 --- a/playground/javascript/tsconfig.json +++ b/playground/javascript/tsconfig.json @@ -1,20 +1,7 @@ { + "extends": "../base.tsconfig.json", "compilerOptions": { - "module": "commonjs", - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "target": "ES6", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "strict": true, - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "noLib": false, - "declaration": true, - "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"], - "outDir": "dist", - "typeRoots": ["node_modules/@types"] + "outDir": "dist" }, "include": ["*.ts"] } diff --git a/scripts/generate.sh b/scripts/generate.sh index cdf5a52056..2526f85123 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -44,11 +44,16 @@ run_pre_gen() { echo "> Running pre-gen script for $GENERATOR..." $pregen $CLIENT fi + + # Sets the hosts option to the `openapitools.json` config file + yarn workspace scripts setHostsOptions $LANGUAGE $CLIENT } generate_client() { echo "> Generating code for $GENERATOR..." + CMD="yarn openapi-generator-cli generate --generator-key $GENERATOR" + if [[ $VERBOSE == "true" ]]; then $CMD else diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000000..61fcdc1a56 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,14 @@ +{ + "name": "scripts", + "version": "1.0.0", + "scripts": { + "build": "tsc", + "setHostsOptions": "yarn build && node dist/setHostsOptions.js" + }, + "devDependencies": { + "@types/js-yaml": "4.0.5", + "@types/node": "16.11.11", + "js-yaml": "4.1.0", + "typescript": "4.5.4" + } +} diff --git a/scripts/pre-gen/setHostsOptions.ts b/scripts/pre-gen/setHostsOptions.ts new file mode 100644 index 0000000000..3578e8b275 --- /dev/null +++ b/scripts/pre-gen/setHostsOptions.ts @@ -0,0 +1,102 @@ +import { readFile, stat, writeFile } from 'fs/promises'; +import path from 'path'; +import { URL } from 'url'; + +import yaml from 'js-yaml'; + +type Server = { + url: string; + variables?: { + [k: string]: { + enum?: string[]; + default: string; + }; + }; +}; + +type Spec = { + servers: Server[]; +}; + +type AdditionalProperties = Partial<{ + hasRegionalHost: boolean; + fallbackToAliasHost: boolean; + isEuHost: boolean; + isDeHost: boolean; + host: string; + topLevelDomain: string; +}>; + +async function setHostsOptions(): Promise { + const openapitoolsPath = path.join(__dirname, '../../openapitools.json'); + const openapitools = JSON.parse(await readFile(openapitoolsPath, 'utf-8')); + + const [language, client] = process.argv.slice(2); + const generator = `${language}-${client}`; + const generatorOptions = openapitools['generator-cli'].generators[generator]; + + if (!generator || !generatorOptions) { + throw new Error(`Generator not found: ${generator}`); + } + + const specPath = path.join(__dirname, `../../specs/dist/${client}.yml`); + + if (!(await stat(specPath))) { + throw new Error(`File not found ${specPath}`); + } + + try { + const { servers } = yaml.load(await readFile(specPath, 'utf8')) as Spec; + const additionalProperties: AdditionalProperties = {}; + + for (const [index, { url, variables }] of servers.entries()) { + if (!url) { + throw new Error(`Invalid server: ${url}`); + } + + const { host } = new URL(url); + + if (!variables?.region || !variables?.region?.enum) { + continue; + } + + additionalProperties.hasRegionalHost = true; + + if (!additionalProperties.fallbackToAliasHost) { + // Determine if the current URL with `region` also have an alias without variables. + additionalProperties.fallbackToAliasHost = + servers.some((curr, i) => { + // we skip current item + if (i === index) { + return false; + } + + return curr.url === url.replace('.{region}', ''); + }) || undefined; + } + + if (variables.region.enum.includes('eu')) { + additionalProperties.isEuHost = true; + } + + if (variables.region.enum.includes('de')) { + additionalProperties.isDeHost = true; + } + + // This is used for hosts like `insights` that uses `.io` + additionalProperties.host = host.split('.')[0]; + additionalProperties.topLevelDomain = host.split('.').pop(); + } + + generatorOptions.additionalProperties = { + ...generatorOptions.additionalProperties, + ...additionalProperties, + }; + + await writeFile(openapitoolsPath, JSON.stringify(openapitools, null, 2)); + } catch (e) { + throw new Error(`Error reading yaml file ${generator}: ${e}`); + } +} + +setHostsOptions(); diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json new file mode 100644 index 0000000000..b3bc49dad5 --- /dev/null +++ b/scripts/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../base.tsconfig.json", + "compilerOptions": { + "typeRoots": ["../node_modules/@types"], + "outDir": "dist" + }, + "include": ["pre-gen/setHostsOptions.ts"], + "exclude": ["dist", "*.json"] +} diff --git a/specs/abtesting/spec.yml b/specs/abtesting/spec.yml index 48ddaeeda1..65e4cc902f 100644 --- a/specs/abtesting/spec.yml +++ b/specs/abtesting/spec.yml @@ -17,6 +17,7 @@ servers: - us - de default: us + - url: https://analytics.algolia.com security: - appId: [] apiKey: [] diff --git a/specs/analytics/spec.yml b/specs/analytics/spec.yml index 8e674f0baf..892b649b35 100644 --- a/specs/analytics/spec.yml +++ b/specs/analytics/spec.yml @@ -17,6 +17,7 @@ servers: - us - de default: us + - url: https://analytics.algolia.com security: - appId: [] apiKey: [] diff --git a/specs/insights/spec.yml b/specs/insights/spec.yml index cfef078fcf..da2e859914 100644 --- a/specs/insights/spec.yml +++ b/specs/insights/spec.yml @@ -10,6 +10,13 @@ components: apiKey: $ref: '../common/securitySchemes.yml#/apiKey' servers: + - url: https://insights.{region}.algolia.io + variables: + region: + enum: + - us + - de + default: us - url: https://insights.algolia.io security: - appId: [] diff --git a/templates/javascript/api-single.mustache b/templates/javascript/api-single.mustache index 23e55d62c6..3d4d1bb9b5 100644 --- a/templates/javascript/api-single.mustache +++ b/templates/javascript/api-single.mustache @@ -53,29 +53,31 @@ export class {{classname}} { appId: string, apiKey: string, {{#hasRegionalHost}} - region: {{#isDeHost}}'de'{{/isDeHost}}{{#isEuHost}}'eu'{{/isEuHost}} | 'us', + region{{#fallbackToAliasHost}}?{{/fallbackToAliasHost}}: {{#isDeHost}}'de'{{/isDeHost}}{{#isEuHost}}'eu'{{/isEuHost}} | 'us', {{/hasRegionalHost}} options?: {requester?: Requester, hosts?: Host[]} ) { if (!appId) { throw new Error("`appId` is missing."); } + if (!apiKey) { throw new Error("`apiKey` is missing."); } + {{#hasRegionalHost}} - {{^fallbackToUS}} + {{^fallbackToAliasHost}} if (!region) { throw new Error("`region` is missing."); } - {{/fallbackToUS}} + {{/fallbackToAliasHost}} {{/hasRegionalHost}} this.setAuthentication({ appId, apiKey }); this.transporter = new Transporter({ hosts: options?.hosts ?? this.getDefaultHosts( - {{#isSearchHost}}appId{{/isSearchHost}} + {{^hasRegionalHost}}appId{{/hasRegionalHost}} {{#hasRegionalHost}}region{{/hasRegionalHost}} ), baseHeaders: { @@ -91,7 +93,7 @@ export class {{classname}} { }); } - {{#isSearchHost}} + {{^hasRegionalHost}} public getDefaultHosts(appId: string): Host[] { return ( [ @@ -106,21 +108,15 @@ export class {{classname}} { ]) ); } - {{/isSearchHost}} + {{/hasRegionalHost}} - {{^isSearchHost}} - {{#hasRegionalHost}} - public getDefaultHosts(region: {{#isDeHost}}'de'{{/isDeHost}}{{#isEuHost}}'eu'{{/isEuHost}} | 'us'{{#fallbackToUS}} = 'us'{{/fallbackToUS}}): Host[] { - return [{ url: `{{{host}}}.${region}.algolia.com`, accept: 'readWrite', protocol: 'https' }]; - } - {{/hasRegionalHost}} + {{#hasRegionalHost}} + public getDefaultHosts(region{{#fallbackToAliasHost}}?{{/fallbackToAliasHost}}: {{#isDeHost}}'de'{{/isDeHost}}{{#isEuHost}}'eu'{{/isEuHost}} | 'us'): Host[] { + {{#fallbackToAliasHost}}const regionHost = region ? `.${region}.` : '.';{{/fallbackToAliasHost}} - {{^hasRegionalHost}} - public getDefaultHosts(): Host[] { - return [{ url: '{{{host}}}.algolia.io', accept: 'readWrite', protocol: 'https' }]; + return [{ url: `{{{host}}}{{#fallbackToAliasHost}}${regionHost}{{/fallbackToAliasHost}}{{^fallbackToAliasHost}}.${region}.{{/fallbackToAliasHost}}algolia.{{#topLevelDomain}}{{.}}{{/topLevelDomain}}{{^topLevelDomain}}com{{/topLevelDomain}}`, accept: 'readWrite', protocol: 'https' }]; } - {{/hasRegionalHost}} - {{/isSearchHost}} + {{/hasRegionalHost}} public setRequest(requester: Requester): void { this.transporter.setRequester(requester); diff --git a/tests/output/javascript/tests/methods/requests/insights.test.ts b/tests/output/javascript/tests/methods/requests/insights.test.ts index 9a9d144467..23a49b40f2 100644 --- a/tests/output/javascript/tests/methods/requests/insights.test.ts +++ b/tests/output/javascript/tests/methods/requests/insights.test.ts @@ -4,7 +4,7 @@ import type { EchoResponse } from '@algolia/client-insights'; const appId = process.env.ALGOLIA_APPLICATION_ID || 'test_app_id'; const apiKey = process.env.ALGOLIA_SEARCH_KEY || 'test_api_key'; -const client = new InsightsApi(appId, apiKey, { +const client = new InsightsApi(appId, apiKey, 'us', { requester: new EchoRequester(), }); diff --git a/tests/output/javascript/tsconfig.json b/tests/output/javascript/tsconfig.json index 4644e2624d..18385180d0 100644 --- a/tests/output/javascript/tsconfig.json +++ b/tests/output/javascript/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "typeRoots": [ - "../../../node_modules/@types" - ], + "typeRoots": ["../../../node_modules/@types"], "resolveJsonModule": true }, - "include": [ - "tests" - ] + "include": ["tests"], + "exclude": [] } diff --git a/tests/tsconfig.json b/tests/tsconfig.json index 88a003e504..a9efb8ab01 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,39 +1,11 @@ { + "extends": "../base.tsconfig.json", "compilerOptions": { - "module": "commonjs", - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "target": "ES6", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "strict": true, - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "noLib": false, - "declaration": true, - "lib": [ - "dom", - "es6", - "es5", - "dom.iterable", - "scripthost" - ], - "outDir": "dist", - "typeRoots": [ - "../node_modules/@types" - ], - "types": [ - "node", - "jest" - ], - "resolveJsonModule": true + "typeRoots": ["../node_modules/@types"], + "types": ["node", "jest"], + "lib": ["ESNext", "dom", "dom.iterable"], + "outDir": "dist" }, - "include": [ - "src" - ], - "exclude": [ - "dist", - "output" - ] + "include": ["src"], + "exclude": ["dist", "output"] } diff --git a/yarn.lock b/yarn.lock index dacd71a146..536a72b75b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,7 +9,7 @@ __metadata: version: 0.0.0-use.local resolution: "@algolia/api-client-automation@workspace:." dependencies: - "@openapitools/openapi-generator-cli": 2.4.18 + "@openapitools/openapi-generator-cli": 2.4.26 "@redocly/openapi-cli": 1.0.0-beta.79 "@typescript-eslint/eslint-plugin": 5.5.0 "@typescript-eslint/parser": 5.5.0 @@ -830,9 +830,9 @@ __metadata: languageName: node linkType: hard -"@nestjs/common@npm:8.2.3": - version: 8.2.3 - resolution: "@nestjs/common@npm:8.2.3" +"@nestjs/common@npm:8.2.6": + version: 8.2.6 + resolution: "@nestjs/common@npm:8.2.6" dependencies: axios: 0.24.0 iterare: 1.2.1 @@ -851,13 +851,13 @@ __metadata: optional: true class-validator: optional: true - checksum: 2a06ffaf58da0622727621db0b6574cad94f4a0d9b895bb8352f736207c7087fce477185b2cacd3b013b0386860e573b0d27b900783df6885e32fc943d5e87b8 + checksum: 3999376069a9adade0d5a60bdaabd05756195ee5a8621c0d3b9f77353446188e183dfe5ec6ccb5d696c96f24da48b7edaeb3e554d9d5c3e20946ba1b030c8f54 languageName: node linkType: hard -"@nestjs/core@npm:8.2.3": - version: 8.2.3 - resolution: "@nestjs/core@npm:8.2.3" +"@nestjs/core@npm:8.2.6": + version: 8.2.6 + resolution: "@nestjs/core@npm:8.2.6" dependencies: "@nuxtjs/opencollective": 0.3.2 fast-safe-stringify: 2.1.1 @@ -880,7 +880,7 @@ __metadata: optional: true "@nestjs/websockets": optional: true - checksum: 35da95f8c17ab5d44b7aecef91cc77bdf0ddc23df93854d4a2ac8f1db633bbe17f96434128d343aee17464e332f2c6431abad4e3ed18f6a8b5b63d5fedb57655 + checksum: abf275dbe309302a16fa77132e362d30ed275ffbca46e51a93bdafdd99daa12a970af3f903a09f9e034af9f4372fe436b7a68bd09c81e9ea7aab00d939482ff2 languageName: node linkType: hard @@ -944,28 +944,28 @@ __metadata: languageName: node linkType: hard -"@openapitools/openapi-generator-cli@npm:2.4.18": - version: 2.4.18 - resolution: "@openapitools/openapi-generator-cli@npm:2.4.18" +"@openapitools/openapi-generator-cli@npm:2.4.26": + version: 2.4.26 + resolution: "@openapitools/openapi-generator-cli@npm:2.4.26" dependencies: - "@nestjs/common": 8.2.3 - "@nestjs/core": 8.2.3 + "@nestjs/common": 8.2.6 + "@nestjs/core": 8.2.6 "@nuxtjs/opencollective": 0.3.2 chalk: 4.1.2 commander: 8.3.0 compare-versions: 3.6.0 - concurrently: 6.4.0 + concurrently: 6.5.1 console.table: 0.10.0 fs-extra: 10.0.0 glob: 7.1.6 inquirer: 8.2.0 lodash: 4.17.21 reflect-metadata: 0.1.13 - rxjs: 7.4.0 + rxjs: 7.5.2 tslib: 2.0.3 bin: openapi-generator-cli: main.js - checksum: b35fe3d5c5d514e70d7c1dea464606fbe93024b71996cb499d0e285ca0db751e2a26e01aac7f3aac3ec2751d483af9c45bac2685bce76fc111d0d0bde3d18cc0 + checksum: ff6f75e194c0df492c4f6951a922a1da5472e7c3ca09b7b8e02f9b910e1fcc49832ca19e18ee7fdd87fcf43ef1ed6443ef5d1954932137c759d87f8a51e276eb languageName: node linkType: hard @@ -1150,6 +1150,13 @@ __metadata: languageName: node linkType: hard +"@types/js-yaml@npm:4.0.5": + version: 4.0.5 + resolution: "@types/js-yaml@npm:4.0.5" + checksum: 7dcac8c50fec31643cc9d6444b5503239a861414cdfaa7ae9a38bc22597c4d850c4b8cec3d82d73b3fbca408348ce223b0408d598b32e094470dfffc6d486b4d + languageName: node + linkType: hard + "@types/json-schema@npm:^7.0.6, @types/json-schema@npm:^7.0.9": version: 7.0.9 resolution: "@types/json-schema@npm:7.0.9" @@ -2096,9 +2103,9 @@ __metadata: languageName: node linkType: hard -"concurrently@npm:6.4.0": - version: 6.4.0 - resolution: "concurrently@npm:6.4.0" +"concurrently@npm:6.5.1": + version: 6.5.1 + resolution: "concurrently@npm:6.5.1" dependencies: chalk: ^4.1.0 date-fns: ^2.16.1 @@ -2110,7 +2117,7 @@ __metadata: yargs: ^16.2.0 bin: concurrently: bin/concurrently.js - checksum: 902864cc853176cac406246fa367a1b24ebfcbea9ba43c164f9cb4e2c9c1a5f9d8be05ce98fe7ef13329ffd5cc340a052007a9c870863e2068425d95b3bf89d7 + checksum: 3f4d89b464fa5c9fb6f9489b46594c30ba54eff6ff10ab3cb5f30f64b74c83be664623a0f0cc731a3cb3f057a1f4a3292f7d3470c012a292c44aca31f214a3fa languageName: node linkType: hard @@ -4330,26 +4337,26 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^3.13.1": - version: 3.14.1 - resolution: "js-yaml@npm:3.14.1" +"js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": + version: 4.1.0 + resolution: "js-yaml@npm:4.1.0" dependencies: - argparse: ^1.0.7 - esprima: ^4.0.0 + argparse: ^2.0.1 bin: js-yaml: bin/js-yaml.js - checksum: bef146085f472d44dee30ec34e5cf36bf89164f5d585435a3d3da89e52622dff0b188a580e4ad091c3341889e14cb88cac6e4deb16dc5b1e9623bb0601fc255c + checksum: c7830dfd456c3ef2c6e355cc5a92e6700ceafa1d14bba54497b34a99f0376cecbb3e9ac14d3e5849b426d5a5140709a66237a8c991c675431271c4ce5504151a languageName: node linkType: hard -"js-yaml@npm:^4.1.0": - version: 4.1.0 - resolution: "js-yaml@npm:4.1.0" +"js-yaml@npm:^3.13.1": + version: 3.14.1 + resolution: "js-yaml@npm:3.14.1" dependencies: - argparse: ^2.0.1 + argparse: ^1.0.7 + esprima: ^4.0.0 bin: js-yaml: bin/js-yaml.js - checksum: c7830dfd456c3ef2c6e355cc5a92e6700ceafa1d14bba54497b34a99f0376cecbb3e9ac14d3e5849b426d5a5140709a66237a8c991c675431271c4ce5504151a + checksum: bef146085f472d44dee30ec34e5cf36bf89164f5d585435a3d3da89e52622dff0b188a580e4ad091c3341889e14cb88cac6e4deb16dc5b1e9623bb0601fc255c languageName: node linkType: hard @@ -5533,12 +5540,12 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:7.4.0": - version: 7.4.0 - resolution: "rxjs@npm:7.4.0" +"rxjs@npm:7.5.2, rxjs@npm:^7.2.0": + version: 7.5.2 + resolution: "rxjs@npm:7.5.2" dependencies: - tslib: ~2.1.0 - checksum: 6b33172a760dcad6882fdc836ee8cf1ebe160dd7eaad95c45a12338ffdaa96eb41e48e6c25bbd3d1fdf45075949ff447954bc17a9d01c688558a67967d09c114 + tslib: ^2.1.0 + checksum: daf1fe7289de500b25d822fd96cde3c138c7902e8bf0e6aa12a3e70847a5cabeeb4d677f10e19387e1db44b12c5b1be0ff5c79b8cd63ed6ce891d765e566cf4d languageName: node linkType: hard @@ -5551,15 +5558,6 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^7.2.0": - version: 7.5.2 - resolution: "rxjs@npm:7.5.2" - dependencies: - tslib: ^2.1.0 - checksum: daf1fe7289de500b25d822fd96cde3c138c7902e8bf0e6aa12a3e70847a5cabeeb4d677f10e19387e1db44b12c5b1be0ff5c79b8cd63ed6ce891d765e566cf4d - languageName: node - linkType: hard - "safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" @@ -5590,6 +5588,17 @@ __metadata: languageName: node linkType: hard +"scripts@workspace:scripts": + version: 0.0.0-use.local + resolution: "scripts@workspace:scripts" + dependencies: + "@types/js-yaml": 4.0.5 + "@types/node": 16.11.11 + js-yaml: 4.1.0 + typescript: 4.5.4 + languageName: unknown + linkType: soft + "semver@npm:7.x, semver@npm:^7.2.1, semver@npm:^7.3.2, semver@npm:^7.3.5": version: 7.3.5 resolution: "semver@npm:7.3.5" @@ -6182,13 +6191,6 @@ __metadata: languageName: node linkType: hard -"tslib@npm:~2.1.0": - version: 2.1.0 - resolution: "tslib@npm:2.1.0" - checksum: aa189c8179de0427b0906da30926fd53c59d96ec239dff87d6e6bc831f608df0cbd6f77c61dabc074408bd0aa0b9ae4ec35cb2c15f729e32f37274db5730cb78 - languageName: node - linkType: hard - "tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0"