vault/ui/app/models/transform/alphabet.js
Angel Garbarino 72cf813cbd
🥐Transform-edit-base: remove use in transform-template-edit and alphabet-edit (#29803)
* remove transform-edit-base from alaphabet and transform edit components

* cleanup documentation

* move hbs file to be next to js

* update this.displayErrors to this.errorMessage

---------

Co-authored-by: Shannon Roberts <shannon.roberts@hashicorp.com>
2025-03-04 08:35:34 -08:00

40 lines
1013 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Model, { attr } from '@ember-data/model';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
export default class Alphabet extends Model {
idPrefix = 'alphabet/';
@attr('string', {
readOnly: true,
subText: 'The alphabet name. Keep in mind that spaces are not allowed and this cannot be edited later.',
})
name;
@attr('string', {
label: 'Alphabet',
subText:
'Provide the set of valid UTF-8 characters contained within both the input and transformed value.',
docLink: '/vault/api-docs/secret/transform#create-update-alphabet',
})
alphabet;
get attrs() {
const keys = ['name', 'alphabet'];
return expandAttributeMeta(this, keys);
}
@attr('string', {
readOnly: true,
})
backend;
@lazyCapabilities(apiPath`${'backend'}/alphabet/${'id'}`, 'backend', 'id')
updatePath;
}