Update secrets.ts
This commit is contained in:
@@ -21,6 +21,7 @@ type ListSecretsOptions = {
|
|||||||
recursive?: boolean;
|
recursive?: boolean;
|
||||||
secretPath?: string;
|
secretPath?: string;
|
||||||
tagSlugs?: string[];
|
tagSlugs?: string[];
|
||||||
|
viewSecretValue?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type GetSecretOptions = {
|
type GetSecretOptions = {
|
||||||
@@ -32,6 +33,7 @@ type GetSecretOptions = {
|
|||||||
type?: SecretType;
|
type?: SecretType;
|
||||||
version?: number;
|
version?: number;
|
||||||
projectId: string;
|
projectId: string;
|
||||||
|
viewSecretValue?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UpdateSecretOptions = Omit<DefaultApiApiV3SecretsRawSecretNamePatchRequest["apiV3SecretsRawSecretNamePatchRequest"], "workspaceId"> & {
|
export type UpdateSecretOptions = Omit<DefaultApiApiV3SecretsRawSecretNamePatchRequest["apiV3SecretsRawSecretNamePatchRequest"], "workspaceId"> & {
|
||||||
@@ -66,6 +68,7 @@ export default class SecretsClient {
|
|||||||
try {
|
try {
|
||||||
const res = await this.#apiInstance.apiV3SecretsRawGet(
|
const res = await this.#apiInstance.apiV3SecretsRawGet(
|
||||||
{
|
{
|
||||||
|
viewSecretValue: convertBool(options.viewSecretValue),
|
||||||
environment: options.environment,
|
environment: options.environment,
|
||||||
workspaceId: options.projectId,
|
workspaceId: options.projectId,
|
||||||
expandSecretReferences: convertBool(options.expandSecretReferences),
|
expandSecretReferences: convertBool(options.expandSecretReferences),
|
||||||
@@ -104,6 +107,7 @@ export default class SecretsClient {
|
|||||||
if (!secrets.find(s => s.secretKey === importedSecret.secretKey)) {
|
if (!secrets.find(s => s.secretKey === importedSecret.secretKey)) {
|
||||||
secrets.push({
|
secrets.push({
|
||||||
...importedSecret,
|
...importedSecret,
|
||||||
|
secretValueHidden: false,
|
||||||
secretPath: imp.secretPath,
|
secretPath: imp.secretPath,
|
||||||
// These fields are not returned by the API
|
// These fields are not returned by the API
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
@@ -122,6 +126,7 @@ export default class SecretsClient {
|
|||||||
try {
|
try {
|
||||||
const res = await this.#apiInstance.apiV3SecretsRawSecretNameGet(
|
const res = await this.#apiInstance.apiV3SecretsRawSecretNameGet(
|
||||||
{
|
{
|
||||||
|
viewSecretValue: convertBool(options.viewSecretValue),
|
||||||
environment: options.environment,
|
environment: options.environment,
|
||||||
secretName: options.secretName,
|
secretName: options.secretName,
|
||||||
workspaceId: options.projectId,
|
workspaceId: options.projectId,
|
||||||
|
|||||||
Reference in New Issue
Block a user