mirror of
https://github.com/hashicorp/vault.git
synced 2025-12-25 19:31:14 +01:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
38 lines
985 B
JavaScript
38 lines
985 B
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
normalizeResponse(store, primaryModelClass, payload, id, requestType) {
|
|
if (payload.data?.masking_character) {
|
|
payload.data.masking_character = String.fromCharCode(payload.data.masking_character);
|
|
}
|
|
return this._super(store, primaryModelClass, payload, id, requestType);
|
|
},
|
|
|
|
serialize() {
|
|
const json = this._super(...arguments);
|
|
if (json.template && Array.isArray(json.template)) {
|
|
// Transformations should only ever have one template
|
|
json.template = json.template[0];
|
|
}
|
|
return json;
|
|
},
|
|
|
|
extractLazyPaginatedData(payload) {
|
|
return payload.data.keys.map((key) => {
|
|
const model = {
|
|
id: key,
|
|
name: key,
|
|
};
|
|
if (payload.backend) {
|
|
model.backend = payload.backend;
|
|
}
|
|
return model;
|
|
});
|
|
},
|
|
});
|