mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 07:01:09 +02:00
* updates api client vars to snake_case for custom messages * updates api client vars to snake_case for tools * updates api client vars to snake_case for sync * updates api client vars to snake_case for secrets engine * updates api client vars to snake_case for auth * updates api client vars to snake_case for usage * updates api client dep to point to gh repo * fixes custom-messages service unit tests * fixes configure-ssh test * fixes configure-ssh test...again
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Form from 'vault/forms/form';
|
|
import FormField from 'vault/utils/forms/field';
|
|
import FormFieldGroup from 'vault/utils/forms/field-group';
|
|
import { commonFields, getPayload } from './shared';
|
|
|
|
import type { SystemWriteSyncDestinationsVercelProjectNameRequest } from '@hashicorp/vault-client-typescript';
|
|
|
|
type VercelProjectFormData = SystemWriteSyncDestinationsVercelProjectNameRequest & {
|
|
name: string;
|
|
};
|
|
|
|
export default class VercelProjectForm extends Form<VercelProjectFormData> {
|
|
formFieldGroups = [
|
|
new FormFieldGroup('default', [
|
|
commonFields.name,
|
|
new FormField('project_id', 'string', {
|
|
label: 'Project ID',
|
|
subText: 'Project ID where to manage environment variables.',
|
|
editDisabled: true,
|
|
}),
|
|
new FormField('team_id', 'string', {
|
|
label: 'Team ID',
|
|
subText: 'Team ID the project belongs to. Optional.',
|
|
}),
|
|
new FormField('deployment_environments', 'string', {
|
|
subText: 'Deployment environments where the environment variables are available.',
|
|
editType: 'checkboxList',
|
|
possibleValues: ['development', 'preview', 'production'],
|
|
}),
|
|
]),
|
|
new FormFieldGroup('Credentials', [
|
|
new FormField('access_token', 'string', {
|
|
subText: 'Vercel API access token with the permissions to manage environment variables.',
|
|
sensitive: true,
|
|
noCopy: true,
|
|
}),
|
|
]),
|
|
new FormFieldGroup('Advanced configuration', [commonFields.granularity, commonFields.secretNameTemplate]),
|
|
];
|
|
|
|
toJSON() {
|
|
const formState = super.toJSON();
|
|
const data = getPayload<VercelProjectFormData>('vercel-project', this.data, this.isNew);
|
|
return { ...formState, data };
|
|
}
|
|
}
|