@@ -59,7 +59,7 @@ const {{ service.name | caseLower }} = new Command("{{ service.name | caseLower
59
59
/**
60
60
* @param {{ " {" }}{{ service .name | caseUcfirst }}{{ method .name | caseUcfirst }}RequestParams{{ " }" }} params
61
61
*/
62
- {%~ block decleration - %}
62
+ {% block decleration %}
63
63
const {{ service .name | caseLower }}{{ method .name | caseUcfirst }} = async ({
64
64
{%- for parameter in method .parameters .all -%}
65
65
{{ parameter .name | caseCamel | escapeKeyword }},
@@ -72,7 +72,9 @@ const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({
72
72
{%- if method .type == ' location' -%}, destination{%- endif -%}
73
73
{% if hasConsolePreview(method .name ,service .name ) %}, console{%- endif -%}
74
74
}) => {
75
- {%~ endblock %}
75
+ {% if method .deprecated %}
76
+ console.warn('Warning: This command is deprecated.{% if method .replaceWith %} Please use "{{ method .replaceWith | replace({' .' : ' ' }) }}" instead.{% endif %}');
77
+ {% endif %}
76
78
let client = !sdk ? await {% if service .name == " projects" %}sdkForConsole(){% else %}sdkForProject(){% endif %} :
77
79
sdk;
78
80
let apiPath = '{{ method .path }}'{% for parameter in method .parameters .path %}.replace('{{ ' {' }}{{ parameter .name | caseCamel }}{{ ' }' }}', {{ parameter .name | caseCamel | escapeKeyword }}){% endfor %};
@@ -82,13 +84,14 @@ const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({
82
84
{{ include (' cli/base/requests/api.twig' ) }}
83
85
{% endif %}
84
86
}
87
+ {% endblock %}
85
88
86
89
{% endfor %}
87
90
{% for method in service .methods %}
88
91
{{service .name | caseLower }}
89
92
.command(`{{ method .name | caseKebab }}`)
90
93
{% autoescape false %}
91
- .description(`{{ method .description | replace({' `' :' \'' }) | replace({' \n' :' ' }) | replace({' \n \n' :' ' }) }}`)
94
+ .description(`{% if method . deprecated %}[DEPRECATED] This command is deprecated.{% if method . replaceWith %} Please use '{{ method . replaceWith | replace({ ' . ' : ' ' }) }}' instead.{% endif %} {% endif %}{ { method .description | replace({' `' :' \'' }) | replace({' \n' :' ' }) | replace({' \n \n' :' ' }) }}`)
92
95
{% for parameter in method .parameters .all %}
93
96
.{% if parameter .required and not parameter .nullable %}requiredOption{% else %}option{% endif %}(`--{{ parameter .name | escapeKeyword | caseKebab }}{% if parameter | typeName == ' boolean' %} [value]{% else %} {% if parameter .array .type | length > 0 %}[{% else %}< {% endif %}{{ parameter .name | escapeKeyword | caseKebab }}{% if parameter .array .type | length > 0 %}...{% endif %}{% if parameter .array .type | length > 0 %}]{% else %}>{% endif %}{% endif %}`, `{{ parameter .description | replace({' `' :' \'' }) | replace({' \n' :' ' }) | replace({' \n \n' :' ' }) }}`{% if parameter | typeName == ' boolean' %}, (value) => value === undefined ? true : parseBool(value){% elseif parameter | typeName == ' number' %}, parseInteger{% endif %})
94
97
{% endfor %}
0 commit comments