diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1ef8c865350..55541a19ae4 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -88,14 +88,5 @@ module.exports = { }, extends: ["plugin:json/recommended-legacy"] }, - { - files: ['templates/**/*.mustache'], - - parser: 'eslint-plugin-automation-custom', - plugins: ['automation-custom'], - rules: { - 'automation-custom/no-new-line': 'error', - }, - }, ], }; diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Serializer/EnumConverter.cs b/clients/algoliasearch-client-csharp/algoliasearch/Serializer/EnumConverter.cs index 8c41dfea480..bcb0e4a9e20 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Serializer/EnumConverter.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Serializer/EnumConverter.cs @@ -91,21 +91,21 @@ JsonSerializerOptions options switch (type) { case JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null && _stringToEnum.TryGetValue(stringValue, out var enumValue)) { - var stringValue = reader.GetString(); - if (stringValue != null && _stringToEnum.TryGetValue(stringValue, out var enumValue)) - { - return enumValue; - } - - break; - } - case JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - _numberToEnum.TryGetValue(numValue, out var enumValue); return enumValue; } + + break; + } + case JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + _numberToEnum.TryGetValue(numValue, out var enumValue); + return enumValue; + } } return default; diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Utils/QueryStringHelper.cs b/clients/algoliasearch-client-csharp/algoliasearch/Utils/QueryStringHelper.cs index a890dda9b58..07decce4895 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Utils/QueryStringHelper.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Utils/QueryStringHelper.cs @@ -36,18 +36,18 @@ public static string ParameterToString(object obj) case bool boolean: return boolean ? "true" : "false"; case ICollection collection: - { - var entries = new List(); - foreach (var entry in collection) - entries.Add(ParameterToString(entry)); - return string.Join(",", entries); - } + { + var entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } case Enum when HasEnumMemberAttrValue(obj): return GetEnumMemberAttrValue(obj); case AbstractSchema schema when obj.GetType().IsClass: - { - return ParameterToString(schema.ActualInstance); - } + { + return ParameterToString(schema.ActualInstance); + } default: return Convert.ToString(obj, CultureInfo.InvariantCulture); } diff --git a/clients/algoliasearch-client-php/lib/FormDataProcessor.php b/clients/algoliasearch-client-php/lib/FormDataProcessor.php index bc221fd9856..1b2c68b66b7 100644 --- a/clients/algoliasearch-client-php/lib/FormDataProcessor.php +++ b/clients/algoliasearch-client-php/lib/FormDataProcessor.php @@ -18,7 +18,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.14.0 + * Generator version: 7.16.0 */ /** @@ -123,7 +123,11 @@ public static function flatten(array $source, string $start = ''): array $currentName .= $currentSuffix; } - $result[$currentName] = ObjectSerializer::toString($val); + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } } $currentName = $start; diff --git a/eslint/src/index.ts b/eslint/src/index.ts index 7fabf71ed69..d287d786862 100644 --- a/eslint/src/index.ts +++ b/eslint/src/index.ts @@ -2,7 +2,6 @@ import { endWithDot } from './rules/endWithDot.js'; import { hasType } from './rules/hasType.js'; import { noBigInt } from './rules/noBigInt.js'; import { noFinalDot } from './rules/noFinalDot.js'; -import { noNewLine } from './rules/noNewLine.js'; import { createOutOfLineRule } from './rules/outOfLineRule.js'; import { refCommon } from './rules/refCommon.js'; import { singleQuoteRef } from './rules/singleQuoteRef.js'; @@ -14,7 +13,6 @@ const rules = { 'has-type': hasType, 'no-big-int': noBigInt, 'no-final-dot': noFinalDot, - 'no-new-line': noNewLine, 'out-of-line-all-of': createOutOfLineRule({ property: 'allOf' }), 'out-of-line-any-of': createOutOfLineRule({ property: 'anyOf' }), 'out-of-line-enum': createOutOfLineRule({ property: 'enum' }), diff --git a/eslint/src/rules/noNewLine.ts b/eslint/src/rules/noNewLine.ts deleted file mode 100644 index 10229fe1621..00000000000 --- a/eslint/src/rules/noNewLine.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { Rule } from 'eslint'; - -export const noNewLine: Rule.RuleModule = { - meta: { - docs: { - description: 'the file should not end with a new line', - }, - messages: { - noNewLine: 'ends with a new line', - }, - fixable: 'code', - }, - create(context) { - if (!context.sourceCode.parserServices.isPlainText) { - return {}; - } - - const code = context.sourceCode; - - if (code.lines.length < 2 || code.lines[code.lines.length - 1].trim().length > 0) { - return {}; - } - - context.report({ - node: code.ast, - messageId: 'noNewLine', - fix(fixer) { - const toRemove = code.text.length - code.text.trimEnd().length; - return fixer.removeRange([code.text.length - toRemove, code.text.length]); - }, - }); - - return {}; - }, -}; diff --git a/eslint/tests/noNewLine.test.ts b/eslint/tests/noNewLine.test.ts deleted file mode 100644 index 1fe44aa74ed..00000000000 --- a/eslint/tests/noNewLine.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { runClassic } from 'eslint-vitest-rule-tester'; - -import { parseForESLint } from '../src/index.js'; -import { noNewLine } from '../src/rules/noNewLine.js'; - -runClassic( - 'no-new-line', - noNewLine, - { - valid: [ - `a simple file -with multiples lines.`, - 'single line.', - '', - ], - invalid: [ - { - code: `simple file with -multiple lines -`, - errors: [{ messageId: 'noNewLine' }], - output: `simple file with -multiple lines`, - }, - { - code: `single line - `, - errors: [{ messageId: 'noNewLine' }], - output: 'single line', - }, - { - code: `multiple new lines - - - `, - errors: [{ messageId: 'noNewLine' }], - output: 'multiple new lines', - }, - ], - }, - { - parser: { parseForESLint }, - }, -); diff --git a/generators/build.gradle b/generators/build.gradle index beaa60a04dc..b00e49c8ab1 100644 --- a/generators/build.gradle +++ b/generators/build.gradle @@ -11,7 +11,7 @@ repositories { } dependencies { - compileOnly 'org.openapitools:openapi-generator:7.14.0' + compileOnly 'org.openapitools:openapi-generator:7.16.0' } tasks.withType(JavaCompile) { diff --git a/package.json b/package.json index 2edbb3f5858..39c3890d483 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "cli": "yarn workspace scripts start", "docker:setup": "./scripts/docker/setup.sh", "fix:json": "eslint --ext=json . --fix", - "fix:mustache": "eslint --ext=mustache templates/**/tests/ --fix", "github-actions:lint": "eslint --ext=yml .github/", "postinstall": "husky && yarn workspace eslint-plugin-automation-custom build", "playground:browser": "yarn workspace javascript-browser-playground start", @@ -31,7 +30,7 @@ "website:build": "bash scripts/website/build.sh" }, "devDependencies": { - "@openapitools/openapi-generator-cli": "2.22.0", + "@openapitools/openapi-generator-cli": "2.24.0", "@redocly/cli": "1.29.0", "eslint": "8.57.1", "eslint-plugin-automation-custom": "1.0.0", diff --git a/scripts/cts/testServer/timeout.ts b/scripts/cts/testServer/timeout.ts index 7ac574e48b8..806f31fc9f7 100644 --- a/scripts/cts/testServer/timeout.ts +++ b/scripts/cts/testServer/timeout.ts @@ -34,7 +34,7 @@ export function assertValidTimeouts(expectedCount: number): void { switch (lang) { case 'csharp': case 'swift': - // csharp and swift clocks are worse than my childhood mickey mouse watch + // csharp and swift clocks are worse than my childhood mickey mouse watch expect(state.duration[3 * i]).to.be.closeTo(state.duration[3 * i + 1], 800); break; case 'javascript': diff --git a/scripts/pre-gen/generateOpenapitools.ts b/scripts/pre-gen/generateOpenapitools.ts index 4b45cf34027..d7460001fa8 100644 --- a/scripts/pre-gen/generateOpenapitools.ts +++ b/scripts/pre-gen/generateOpenapitools.ts @@ -35,6 +35,10 @@ export async function generateOpenapitools( mode, ...additionalProperties, }, + 'openapi-normalizer': { + // if this is set to true, it causes a breaking change on PlatformWithNone, this can be removed in the next major + SIMPLIFY_ONEOF_ANYOF_ENUM: false, + }, }; } @@ -43,7 +47,7 @@ export async function generateOpenapitools( JSON.stringify( { 'generator-cli': { - version: '7.14.0', + version: '7.16.0', generators, }, }, diff --git a/templates/csharp/snippets/import.mustache b/templates/csharp/snippets/import.mustache index 3a2887f5837..9f6ee5ac794 100644 --- a/templates/csharp/snippets/import.mustache +++ b/templates/csharp/snippets/import.mustache @@ -1,3 +1,3 @@ using Algolia.Search.Clients; using Algolia.Search.Http; -using Algolia.Search.Models.{{clientPrefix}}; \ No newline at end of file +using Algolia.Search.Models.{{clientPrefix}}; diff --git a/templates/csharp/snippets/init.mustache b/templates/csharp/snippets/init.mustache index e2dc17a3347..adfe771fda0 100644 --- a/templates/csharp/snippets/init.mustache +++ b/templates/csharp/snippets/init.mustache @@ -1 +1 @@ -var client = new {{client}}(new {{clientPrefix}}Config("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}},"ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}})); \ No newline at end of file +var client = new {{client}}(new {{clientPrefix}}Config("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}},"ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}})); diff --git a/templates/dart/snippets/import.mustache b/templates/dart/snippets/import.mustache index 6ddcdd79d23..abef8a05860 100644 --- a/templates/dart/snippets/import.mustache +++ b/templates/dart/snippets/import.mustache @@ -1 +1 @@ -import '{{{import}}}'; \ No newline at end of file +import '{{{import}}}'; diff --git a/templates/dart/snippets/init.mustache b/templates/dart/snippets/init.mustache index 249b821973c..c4fd9c63410 100644 --- a/templates/dart/snippets/init.mustache +++ b/templates/dart/snippets/init.mustache @@ -1 +1 @@ -final client = {{client}}(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'{{#hasRegionalHost}}, region: 'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}}); \ No newline at end of file +final client = {{client}}(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'{{#hasRegionalHost}}, region: 'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}}); diff --git a/templates/go/operation_description.mustache b/templates/go/operation_description.mustache index 14976120b3c..44166eec5e5 100644 --- a/templates/go/operation_description.mustache +++ b/templates/go/operation_description.mustache @@ -20,4 +20,4 @@ Request can be constructed by NewApi{{operationId}}Request with parameters below Deprecated {{/isDeprecated}} -*/ \ No newline at end of file +*/ diff --git a/templates/go/snippets/import.mustache b/templates/go/snippets/import.mustache index 799f01419b0..9e6ac952e51 100644 --- a/templates/go/snippets/import.mustache +++ b/templates/go/snippets/import.mustache @@ -1 +1 @@ -import "github.com/algolia/algoliasearch-client-go/v4/algolia/{{clientImport}}" \ No newline at end of file +import "github.com/algolia/algoliasearch-client-go/v4/algolia/{{clientImport}}" diff --git a/templates/go/snippets/init.mustache b/templates/go/snippets/init.mustache index e558a5a8723..d849fff3ec0 100644 --- a/templates/go/snippets/init.mustache +++ b/templates/go/snippets/init.mustache @@ -2,4 +2,4 @@ client, err := {{clientPrefix}}.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API if err != nil { // The client can fail to initialize if you pass an invalid parameter. panic(err) -} \ No newline at end of file +} diff --git a/templates/java/snippets/import.mustache b/templates/java/snippets/import.mustache index 8b787448638..8d1332a3bd9 100644 --- a/templates/java/snippets/import.mustache +++ b/templates/java/snippets/import.mustache @@ -1,3 +1,3 @@ import com.algolia.api.{{client}}; import com.algolia.model.{{import}}.*; -import com.algolia.config.*; \ No newline at end of file +import com.algolia.config.*; diff --git a/templates/java/snippets/init.mustache b/templates/java/snippets/init.mustache index 802903bd57a..adca40b5710 100644 --- a/templates/java/snippets/init.mustache +++ b/templates/java/snippets/init.mustache @@ -1 +1 @@ -{{client}} client = new {{client}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}); \ No newline at end of file +{{client}} client = new {{client}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}); diff --git a/templates/javascript/clients/algoliasearch/builds/definition.mustache b/templates/javascript/clients/algoliasearch/builds/definition.mustache index 36b9b9bf3cd..667622d70f3 100644 --- a/templates/javascript/clients/algoliasearch/builds/definition.mustache +++ b/templates/javascript/clients/algoliasearch/builds/definition.mustache @@ -234,4 +234,4 @@ export function algoliasearch( {{/dependencies}} } -} \ No newline at end of file +} diff --git a/templates/javascript/clients/algoliasearch/builds/models.mustache b/templates/javascript/clients/algoliasearch/builds/models.mustache index b8027eda8c4..24becc8f5f0 100644 --- a/templates/javascript/clients/algoliasearch/builds/models.mustache +++ b/templates/javascript/clients/algoliasearch/builds/models.mustache @@ -297,4 +297,4 @@ export type InitClientOptions = Partial<{ */ apiKey: string; options: ClientOptions; -}>; \ No newline at end of file +}>; diff --git a/templates/javascript/clients/client/api/helpers.mustache b/templates/javascript/clients/client/api/helpers.mustache index 9aef376e5c0..13f659412a2 100644 --- a/templates/javascript/clients/client/api/helpers.mustache +++ b/templates/javascript/clients/client/api/helpers.mustache @@ -513,4 +513,4 @@ searchForFacets( requestOptions?: RequestOptions | undefined ): Promise<{results: Array}> { return this.search(searchMethodParams, requestOptions) as Promise<{results: Array}>; -}, \ No newline at end of file +}, diff --git a/templates/javascript/clients/client/api/ingestionHelpers.mustache b/templates/javascript/clients/client/api/ingestionHelpers.mustache index 2d8102ae94d..360bff0084a 100644 --- a/templates/javascript/clients/client/api/ingestionHelpers.mustache +++ b/templates/javascript/clients/client/api/ingestionHelpers.mustache @@ -73,4 +73,4 @@ async chunkedPush( } return responses; -}, \ No newline at end of file +}, diff --git a/templates/javascript/clients/client/api/nodeHelpers.mustache b/templates/javascript/clients/client/api/nodeHelpers.mustache index 23545fdc444..4c4030c1fb1 100644 --- a/templates/javascript/clients/client/api/nodeHelpers.mustache +++ b/templates/javascript/clients/client/api/nodeHelpers.mustache @@ -133,4 +133,4 @@ async accountCopyIndex( for (const response of responses) { await destinationClient.waitForTask({ indexName: destinationIndexName, taskID: response.taskID }); } -}, \ No newline at end of file +}, diff --git a/templates/javascript/clients/client/api/operation/jsdoc.mustache b/templates/javascript/clients/client/api/operation/jsdoc.mustache index 3cbe26fd156..f1352592bc0 100644 --- a/templates/javascript/clients/client/api/operation/jsdoc.mustache +++ b/templates/javascript/clients/client/api/operation/jsdoc.mustache @@ -23,4 +23,4 @@ {{/x-is-single-body-param}} {{/vendorExtensions}} * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. -*/ \ No newline at end of file +*/ diff --git a/templates/javascript/clients/client/api/operation/legacySearchCompatible/model.mustache b/templates/javascript/clients/client/api/operation/legacySearchCompatible/model.mustache index e43f042a3e6..e846854d428 100644 --- a/templates/javascript/clients/client/api/operation/legacySearchCompatible/model.mustache +++ b/templates/javascript/clients/client/api/operation/legacySearchCompatible/model.mustache @@ -28,4 +28,4 @@ type LegacySearchQuery = LegacySearchForFacets | LegacySearchForHits; * * @deprecated This signature will be removed from the next major version, we recommend using the `SearchMethodParams` type for performances and future proof reasons. */ -export type LegacySearchMethodProps = LegacySearchQuery[]; \ No newline at end of file +export type LegacySearchMethodProps = LegacySearchQuery[]; diff --git a/templates/javascript/clients/client/api/searchHelpers.mustache b/templates/javascript/clients/client/api/searchHelpers.mustache index d5579511fec..4a46875ca3f 100644 --- a/templates/javascript/clients/client/api/searchHelpers.mustache +++ b/templates/javascript/clients/client/api/searchHelpers.mustache @@ -17,4 +17,4 @@ getSecuredApiKeyRemainingValidity: ({ } return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000); -}, \ No newline at end of file +}, diff --git a/templates/javascript/clients/client/api/workerHelpers.mustache b/templates/javascript/clients/client/api/workerHelpers.mustache index 7400e35ef14..16f5126c79a 100644 --- a/templates/javascript/clients/client/api/workerHelpers.mustache +++ b/templates/javascript/clients/client/api/workerHelpers.mustache @@ -33,4 +33,4 @@ generateSecuredApiKey: async ({ const queryParameters = serializeQueryParameters(mergedRestrictions); return await generateBase64Hmac(parentApiKey, queryParameters); -}, \ No newline at end of file +}, diff --git a/templates/javascript/clients/client/builds/browser.mustache b/templates/javascript/clients/client/builds/browser.mustache index 3717af4a893..539a3823c28 100644 --- a/templates/javascript/clients/client/builds/browser.mustache +++ b/templates/javascript/clients/client/builds/browser.mustache @@ -25,4 +25,4 @@ }); } -export type {{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}} = ReturnType; \ No newline at end of file +export type {{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}} = ReturnType; diff --git a/templates/javascript/clients/client/builds/definition.mustache b/templates/javascript/clients/client/builds/definition.mustache index 4897c68c0e2..214db74e9cb 100644 --- a/templates/javascript/clients/client/builds/definition.mustache +++ b/templates/javascript/clients/client/builds/definition.mustache @@ -69,4 +69,5 @@ export function {{clientName}}( if ({{^fallbackToAliasHost}}!region || {{/fallbackToAliasHost}}(region && (typeof region !== 'string' || !REGIONS.includes(region)))) { throw new Error(`\`region\` {{^fallbackToAliasHost}}is required and {{/fallbackToAliasHost}}must be one of the following: ${REGIONS.join(', ')}`); } - {{/hasRegionalHost}} \ No newline at end of file + + {{/hasRegionalHost}} diff --git a/templates/javascript/clients/client/builds/node.mustache b/templates/javascript/clients/client/builds/node.mustache index deff77e0589..dcb7432dd79 100644 --- a/templates/javascript/clients/client/builds/node.mustache +++ b/templates/javascript/clients/client/builds/node.mustache @@ -29,4 +29,4 @@ import { createHmac } from 'node:crypto'; {{> client/api/searchHelpers}} {{/searchHelpers}} } -} \ No newline at end of file +} diff --git a/templates/javascript/clients/client/builds/worker.mustache b/templates/javascript/clients/client/builds/worker.mustache index 29dfe502c65..c2034a58722 100644 --- a/templates/javascript/clients/client/builds/worker.mustache +++ b/templates/javascript/clients/client/builds/worker.mustache @@ -55,4 +55,4 @@ async function generateBase64Hmac(parentApiKey: string, queryParameters: string) const combined = hmacHex + queryParameters; return btoa(combined); } -{{/searchHelpers}} \ No newline at end of file +{{/searchHelpers}} diff --git a/templates/javascript/snippets/import.mustache b/templates/javascript/snippets/import.mustache index 84f922bc73f..7625c5e9d74 100644 --- a/templates/javascript/snippets/import.mustache +++ b/templates/javascript/snippets/import.mustache @@ -1 +1 @@ -import { {{clientName}} } from '{{{importPackage}}}'; \ No newline at end of file +import { {{clientName}} } from '{{{importPackage}}}'; diff --git a/templates/javascript/snippets/init.mustache b/templates/javascript/snippets/init.mustache index 9ae6c58d8ae..cb4d6a14e45 100644 --- a/templates/javascript/snippets/init.mustache +++ b/templates/javascript/snippets/init.mustache @@ -1 +1 @@ -const client = {{{clientName}}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#isStandaloneClient}}{{#hasRegionalHost}}, '{{defaultRegion}}' {{/hasRegionalHost}}{{/isStandaloneClient}}){{^isStandaloneClient}}.{{{initMethod}}}({{#hasRegionalHost}} {region: '{{defaultRegion}}'} {{/hasRegionalHost}}){{/isStandaloneClient}}; \ No newline at end of file +const client = {{{clientName}}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#isStandaloneClient}}{{#hasRegionalHost}}, '{{defaultRegion}}' {{/hasRegionalHost}}{{/isStandaloneClient}}){{^isStandaloneClient}}.{{{initMethod}}}({{#hasRegionalHost}} {region: '{{defaultRegion}}'} {{/hasRegionalHost}}){{/isStandaloneClient}}; diff --git a/templates/javascript/tests/client/tests.mustache b/templates/javascript/tests/client/tests.mustache index c71bd4c68f2..f60f33da496 100644 --- a/templates/javascript/tests/client/tests.mustache +++ b/templates/javascript/tests/client/tests.mustache @@ -58,4 +58,4 @@ describe('{{testType}}', () => { }, 25000); {{/tests}} -}); \ No newline at end of file +}); diff --git a/templates/kotlin/snippets/import.mustache b/templates/kotlin/snippets/import.mustache index e4463c2719b..7186ecce6f8 100644 --- a/templates/kotlin/snippets/import.mustache +++ b/templates/kotlin/snippets/import.mustache @@ -6,4 +6,4 @@ import com.algolia.client.extensions.* {{/isSearchClient}} {{#isCompositionClient}} import com.algolia.client.model.{{import}}.RequestBody -{{/isCompositionClient}} \ No newline at end of file +{{/isCompositionClient}} diff --git a/templates/kotlin/snippets/init.mustache b/templates/kotlin/snippets/init.mustache index e98aa7b50bd..57a1a3d531d 100644 --- a/templates/kotlin/snippets/init.mustache +++ b/templates/kotlin/snippets/init.mustache @@ -1 +1 @@ -val client = {{client}}(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY"{{#hasRegionalHost}}, region = "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}) \ No newline at end of file +val client = {{client}}(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY"{{#hasRegionalHost}}, region = "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}) diff --git a/templates/kotlin/tests/client/tests.mustache b/templates/kotlin/tests/client/tests.mustache index 021df0e9c0c..f6891df7da7 100644 --- a/templates/kotlin/tests/client/tests.mustache +++ b/templates/kotlin/tests/client/tests.mustache @@ -6,9 +6,11 @@ fun `{{#lambda.replaceBacktick}}{{{testName}}}{{/lambda.replaceBacktick}}`() = r {{/autoCreateClient}} {{#steps}} {{#times}} + for (i in 1..{{.}}) { {{/times}} {{#isError}} + assertFails { {{#dynamicTemplate}}{{/dynamicTemplate}} }.let { error -> assertError(error, "{{{expectedError}}}".replace("%localhost%", if (System.getenv("CI") == "true") "localhost" else "host.docker.internal")) } @@ -18,6 +20,7 @@ fun `{{#lambda.replaceBacktick}}{{{testName}}}{{/lambda.replaceBacktick}}`() = r {{> tests/client/createClient}} {{/isCreateClient}} {{#isMethod}} + client.runTest( call = { {{> tests/method}} diff --git a/templates/php/snippets/import.mustache b/templates/php/snippets/import.mustache index 81a1b16fc9b..ab6711d3297 100644 --- a/templates/php/snippets/import.mustache +++ b/templates/php/snippets/import.mustache @@ -1 +1 @@ -use Algolia\AlgoliaSearch\Api\{{client}}; \ No newline at end of file +use Algolia\AlgoliaSearch\Api\{{client}}; diff --git a/templates/php/snippets/init.mustache b/templates/php/snippets/init.mustache index c6c84e35156..c71c6d99365 100644 --- a/templates/php/snippets/init.mustache +++ b/templates/php/snippets/init.mustache @@ -1 +1 @@ -$client = {{client}}::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'{{#hasRegionalHost}}, 'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}}); \ No newline at end of file +$client = {{client}}::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY'{{#hasRegionalHost}}, 'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}}); diff --git a/templates/python/snippets/import.mustache b/templates/python/snippets/import.mustache index cd2ce03e59b..1761dd7e06d 100644 --- a/templates/python/snippets/import.mustache +++ b/templates/python/snippets/import.mustache @@ -1,3 +1,3 @@ from algoliasearch.{{{import}}}.client import {{#lambda.pascalcase}}{{{client}}}{{/lambda.pascalcase}} from algoliasearch.{{{import}}}.client import {{#lambda.pascalcase}}{{{client}}}Sync{{/lambda.pascalcase}} -from json import loads \ No newline at end of file +from json import loads diff --git a/templates/python/snippets/init.mustache b/templates/python/snippets/init.mustache index cb62b86274c..ac062972b46 100644 --- a/templates/python/snippets/init.mustache +++ b/templates/python/snippets/init.mustache @@ -1 +1 @@ -client = {{#lambda.pascalcase}}{{{client}}}Sync{{/lambda.pascalcase}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}) \ No newline at end of file +client = {{#lambda.pascalcase}}{{{client}}}Sync{{/lambda.pascalcase}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}) diff --git a/templates/ruby/partial_model_enum_class.mustache b/templates/ruby/partial_model_enum_class.mustache index d2ddbff1977..3880ae8b5da 100644 --- a/templates/ruby/partial_model_enum_class.mustache +++ b/templates/ruby/partial_model_enum_class.mustache @@ -20,4 +20,4 @@ return value if {{classname}}.all_vars.include?(value) raise "Invalid ENUM value #{value} for class #{{{classname}}}" end - end \ No newline at end of file + end diff --git a/templates/ruby/search_helpers.mustache b/templates/ruby/search_helpers.mustache index 298f546b483..8493b920f57 100644 --- a/templates/ruby/search_helpers.mustache +++ b/templates/ruby/search_helpers.mustache @@ -419,4 +419,4 @@ def index_exists?(index_name) end true -end \ No newline at end of file +end diff --git a/templates/ruby/snippets/import.mustache b/templates/ruby/snippets/import.mustache index 3eaf5945aba..3c3092623d9 100644 --- a/templates/ruby/snippets/import.mustache +++ b/templates/ruby/snippets/import.mustache @@ -1 +1 @@ -require 'algolia' \ No newline at end of file +require 'algolia' diff --git a/templates/ruby/snippets/init.mustache b/templates/ruby/snippets/init.mustache index 02f661a3df2..4a8cb8fbe7a 100644 --- a/templates/ruby/snippets/init.mustache +++ b/templates/ruby/snippets/init.mustache @@ -1 +1 @@ -client = Algolia::{{#lambda.pascalcase}}{{{client}}}{{/lambda.pascalcase}}.create('ALGOLIA_APPLICATION_ID','ALGOLIA_API_KEY'{{#hasRegionalHost}},'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}}) \ No newline at end of file +client = Algolia::{{#lambda.pascalcase}}{{{client}}}{{/lambda.pascalcase}}.create('ALGOLIA_APPLICATION_ID','ALGOLIA_API_KEY'{{#hasRegionalHost}},'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}}) diff --git a/templates/scala/snippets/import.mustache b/templates/scala/snippets/import.mustache index c9dbff77da7..23b9b49dfb5 100644 --- a/templates/scala/snippets/import.mustache +++ b/templates/scala/snippets/import.mustache @@ -2,4 +2,4 @@ import algoliasearch.api.{{client}} import algoliasearch.config.* {{#isSearchClient}} import algoliasearch.extension.SearchClientExtensions -{{/isSearchClient}} \ No newline at end of file +{{/isSearchClient}} diff --git a/templates/scala/snippets/init.mustache b/templates/scala/snippets/init.mustache index dfd74e5a214..e41706c11e2 100644 --- a/templates/scala/snippets/init.mustache +++ b/templates/scala/snippets/init.mustache @@ -1 +1 @@ -val client = {{client}}(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY"{{#hasRegionalHost}}, region = {{#fallbackToAliasHost}}Option({{/fallbackToAliasHost}}"ALGOLIA_APPLICATION_REGION"{{#fallbackToAliasHost}}){{/fallbackToAliasHost}}{{/hasRegionalHost}}) \ No newline at end of file +val client = {{client}}(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY"{{#hasRegionalHost}}, region = {{#fallbackToAliasHost}}Option({{/fallbackToAliasHost}}"ALGOLIA_APPLICATION_REGION"{{#fallbackToAliasHost}}){{/fallbackToAliasHost}}{{/hasRegionalHost}}) diff --git a/templates/swift/snippets/import.mustache b/templates/swift/snippets/import.mustache index acac9a41fcd..c5243f51ca9 100644 --- a/templates/swift/snippets/import.mustache +++ b/templates/swift/snippets/import.mustache @@ -1 +1 @@ -import {{import}} \ No newline at end of file +import {{import}} diff --git a/templates/swift/snippets/init.mustache b/templates/swift/snippets/init.mustache index b506931338d..ee282171c94 100644 --- a/templates/swift/snippets/init.mustache +++ b/templates/swift/snippets/init.mustache @@ -1 +1 @@ -let client = try {{client}}(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY"{{#hasRegionalHost}}, region: .{{defaultRegion}}{{/hasRegionalHost}}) \ No newline at end of file +let client = try {{client}}(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY"{{#hasRegionalHost}}, region: .{{defaultRegion}}{{/hasRegionalHost}}) diff --git a/yarn.lock b/yarn.lock index a44e3fc37e8..cb274884ada 100644 --- a/yarn.lock +++ b/yarn.lock @@ -89,7 +89,7 @@ __metadata: version: 0.0.0-use.local resolution: "@algolia/api-client-automation@workspace:." dependencies: - "@openapitools/openapi-generator-cli": "npm:2.22.0" + "@openapitools/openapi-generator-cli": "npm:2.24.0" "@redocly/cli": "npm:1.29.0" eslint: "npm:8.57.1" eslint-plugin-automation-custom: "npm:1.0.0" @@ -1816,21 +1816,21 @@ __metadata: languageName: node linkType: hard -"@openapitools/openapi-generator-cli@npm:2.22.0": - version: 2.22.0 - resolution: "@openapitools/openapi-generator-cli@npm:2.22.0" +"@openapitools/openapi-generator-cli@npm:2.24.0": + version: 2.24.0 + resolution: "@openapitools/openapi-generator-cli@npm:2.24.0" dependencies: "@nestjs/axios": "npm:4.0.1" "@nestjs/common": "npm:11.1.6" "@nestjs/core": "npm:11.1.6" "@nuxtjs/opencollective": "npm:0.3.2" - axios: "npm:1.11.0" + axios: "npm:1.12.2" chalk: "npm:4.1.2" commander: "npm:8.3.0" - compare-versions: "npm:4.1.4" - concurrently: "npm:9.2.0" + compare-versions: "npm:6.1.1" + concurrently: "npm:9.2.1" console.table: "npm:0.10.0" - fs-extra: "npm:11.3.1" + fs-extra: "npm:11.3.2" glob: "npm:11.0.3" inquirer: "npm:8.2.7" proxy-agent: "npm:6.5.0" @@ -1839,7 +1839,7 @@ __metadata: tslib: "npm:2.8.1" bin: openapi-generator-cli: main.js - checksum: 10/11bad66d4ad8a65503d1b07795aa48895e12bc8eab349ded15bd54b2fbf92b0ebf362a16fda8c625a75661dfb5df0caa28c5b9b9f5750404d173c02043ced8e4 + checksum: 10/8ed80521926fe1ffd15f8e002f9e3b23f4327aedfd85c63e99decfbe515e4ef4a6e2e432afcc0e14c087a8a69a62d27c146faf2a6a59f025949bb1783a559e20 languageName: node linkType: hard @@ -3352,14 +3352,14 @@ __metadata: languageName: node linkType: hard -"axios@npm:1.11.0": - version: 1.11.0 - resolution: "axios@npm:1.11.0" +"axios@npm:1.12.2": + version: 1.12.2 + resolution: "axios@npm:1.12.2" dependencies: follow-redirects: "npm:^1.15.6" form-data: "npm:^4.0.4" proxy-from-env: "npm:^1.1.0" - checksum: 10/232df4af7a4e4e07baa84621b9cc4b0c518a757b4eacc7f635c0eb3642cb98dff347326739f24b891b3b4481b7b838c79a3a0c4819c9fbc1fc40232431b9c5dc + checksum: 10/886a79770594eaad76493fecf90344b567bd956240609b5dcd09bd0afe8d3e6f1ad6d3257a93a483b6192b409d4b673d9515a34619e3e3ed1b2c0ec2a83b20ba languageName: node linkType: hard @@ -3908,10 +3908,10 @@ __metadata: languageName: node linkType: hard -"compare-versions@npm:4.1.4": - version: 4.1.4 - resolution: "compare-versions@npm:4.1.4" - checksum: 10/0c4f0d943477b824234f5c6600ea7404a86ef506c696b9d91ee67979bd32c08371a8b6532cc17e6e17cf2916e46ef16d499dce70245a4f6786c3c055afcea697 +"compare-versions@npm:6.1.1": + version: 6.1.1 + resolution: "compare-versions@npm:6.1.1" + checksum: 10/9325c0fadfba81afa0ec17e6fc2ef823ba785c693089698b8d9374e5460509f1916a88591644d4cb4045c9a58e47fafbcc0724fe8bf446d2a875a3d6eeddf165 languageName: node linkType: hard @@ -3935,21 +3935,20 @@ __metadata: languageName: node linkType: hard -"concurrently@npm:9.2.0": - version: 9.2.0 - resolution: "concurrently@npm:9.2.0" +"concurrently@npm:9.2.1": + version: 9.2.1 + resolution: "concurrently@npm:9.2.1" dependencies: - chalk: "npm:^4.1.2" - lodash: "npm:^4.17.21" - rxjs: "npm:^7.8.1" - shell-quote: "npm:^1.8.1" - supports-color: "npm:^8.1.1" - tree-kill: "npm:^1.2.2" - yargs: "npm:^17.7.2" + chalk: "npm:4.1.2" + rxjs: "npm:7.8.2" + shell-quote: "npm:1.8.3" + supports-color: "npm:8.1.1" + tree-kill: "npm:1.2.2" + yargs: "npm:17.7.2" bin: conc: dist/bin/concurrently.js concurrently: dist/bin/concurrently.js - checksum: 10/fdf5d3b583640b11ef84fab3ffdf77ed9c6878fa0a56f6787b6cd46b7011305c71d9e0067a814ca4fa52bea6f20ddb466bb97a13d61999628e43e550ddad7c93 + checksum: 10/2a6b1acbcdbeb478926b80fd81d0b7e075fa16d78a76ceb43f0478b8aeea1c70781379be2f7d6a2528e51fac48ce4ebb686ae2328e4b35e0b1d17234f121c700 languageName: node linkType: hard @@ -5351,17 +5350,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:11.3.1": - version: 11.3.1 - resolution: "fs-extra@npm:11.3.1" - dependencies: - graceful-fs: "npm:^4.2.0" - jsonfile: "npm:^6.0.1" - universalify: "npm:^2.0.0" - checksum: 10/2b893213411b1da11f9b061ccb0bcff4d6dd66fe90aa8f5b1616219a5e7ca659da869f454ebd8e94aa21c58342730fb43a2e5c98b5c6c5124f0c54a4633f64b0 - languageName: node - linkType: hard - "fs-extra@npm:11.3.2": version: 11.3.2 resolution: "fs-extra@npm:11.3.2" @@ -8090,7 +8078,7 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:7.8.2, rxjs@npm:^7.5.5, rxjs@npm:^7.8.1": +"rxjs@npm:7.8.2, rxjs@npm:^7.5.5": version: 7.8.2 resolution: "rxjs@npm:7.8.2" dependencies: @@ -8250,7 +8238,7 @@ __metadata: languageName: node linkType: hard -"shell-quote@npm:^1.8.1": +"shell-quote@npm:1.8.3": version: 1.8.3 resolution: "shell-quote@npm:1.8.3" checksum: 10/5473e354637c2bd698911224129c9a8961697486cff1fb221f234d71c153fc377674029b0223d1d3c953a68d451d79366abfe53d1a0b46ee1f28eb9ade928f4c @@ -8742,6 +8730,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:8.1.1": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: "npm:^4.0.0" + checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 + languageName: node + linkType: hard + "supports-color@npm:^5.3.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -8760,15 +8757,6 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^8.1.1": - version: 8.1.1 - resolution: "supports-color@npm:8.1.1" - dependencies: - has-flag: "npm:^4.0.0" - checksum: 10/157b534df88e39c5518c5e78c35580c1eca848d7dbaf31bbe06cdfc048e22c7ff1a9d046ae17b25691128f631a51d9ec373c1b740c12ae4f0de6e292037e4282 - languageName: node - linkType: hard - "swagger2openapi@npm:^7.0.8": version: 7.0.8 resolution: "swagger2openapi@npm:7.0.8" @@ -8935,7 +8923,7 @@ __metadata: languageName: node linkType: hard -"tree-kill@npm:^1.2.2": +"tree-kill@npm:1.2.2": version: 1.2.2 resolution: "tree-kill@npm:1.2.2" bin: @@ -9741,7 +9729,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^17.0.1, yargs@npm:^17.4.0, yargs@npm:^17.7.2": +"yargs@npm:17.7.2, yargs@npm:^17.0.1, yargs@npm:^17.4.0": version: 17.7.2 resolution: "yargs@npm:17.7.2" dependencies: