Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdks/node/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8-dev
1.8.1-dev
2 changes: 1 addition & 1 deletion sdks/node/api/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const queryParamsSerializer = (params) => {
return Qs.stringify(params, { arrayFormat: "brackets" });
};

export const USER_AGENT = "OpenAPI-Generator/1.8-dev/node";
export const USER_AGENT = "OpenAPI-Generator/1.8.1-dev/node";

/**
* Generates an object containing form data.
Expand Down
64 changes: 64 additions & 0 deletions sdks/node/bin/copy-constants.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env php
<?php

require_once __DIR__ . '/../vendor/autoload.php';

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

set_error_handler(function ($level, $msg) {
echo "Error: {$msg}";
exit(1);
});

/**
* Between openapi-generator v7.8.0 and v7.12.0 a change was made to the way
* a few generators create constant names from values. The original way was
* actually broken. For example "change-field-visibility" would generate a
* constant name of "TYPE_FIELD_VISIBILITY", dropping the "change" part.
*
* The fix now generates the correct name, "TYPE_CHANGE_FIELD_VISIBILITY".
* However, the fix also gets rid of the previous (incorrect) constant names,
* making the fix a BC break.
*
* This simple script just adds the old constant names back, alongside the new
* ones.
*/
class CopyConstants
{
public function run(): void
{
$file = __DIR__ . '/../model/subFormFieldRuleAction.ts';
$contents = file_get_contents($file);

$constant_1 = ' ChangeFieldVisibility = "change-field-visibility",';
$replace_1 = implode("\n", [
$constant_1,
' FieldVisibility = "change-field-visibility",',
]);

$constant_2 = ' ChangeGroupVisibility = "change-group-visibility",';
$replace_2 = implode("\n", [
$constant_2,
' GroupVisibility = "change-group-visibility",',
]);

$contents = str_replace(
$constant_1,
$replace_1,
$contents,
);

$contents = str_replace(
$constant_2,
$replace_2,
$contents,
);

file_put_contents($file, $contents);
}
}

$copier = new CopyConstants();
$copier->run();
Loading