Files
personal_site/frontend/node_modules/@aws-sdk/client-secrets-manager/dist-cjs/index.js
T

507 lines
19 KiB
JavaScript

'use strict';
var client$1 = require('@aws-sdk/core/client');
var core = require('@smithy/core');
var client = require('@smithy/core/client');
var config = require('@smithy/core/config');
var endpoints = require('@smithy/core/endpoints');
var protocols = require('@smithy/core/protocols');
var retry = require('@smithy/core/retry');
var schema = require('@smithy/core/schema');
var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
var runtimeConfig = require('./runtimeConfig');
var schemas_0 = require('./schemas/schemas_0');
var errors = require('./models/errors');
var SecretsManagerServiceException = require('./models/SecretsManagerServiceException');
const resolveClientEndpointParameters = (options) => {
return Object.assign(options, {
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
useFipsEndpoint: options.useFipsEndpoint ?? false,
defaultSigningName: "secretsmanager",
});
};
const commonParams = {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
let _credentials = runtimeConfig.credentials;
return {
setHttpAuthScheme(httpAuthScheme) {
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
if (index === -1) {
_httpAuthSchemes.push(httpAuthScheme);
}
else {
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
}
},
httpAuthSchemes() {
return _httpAuthSchemes;
},
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
_httpAuthSchemeProvider = httpAuthSchemeProvider;
},
httpAuthSchemeProvider() {
return _httpAuthSchemeProvider;
},
setCredentials(credentials) {
_credentials = credentials;
},
credentials() {
return _credentials;
},
};
};
const resolveHttpAuthRuntimeConfig = (config) => {
return {
httpAuthSchemes: config.httpAuthSchemes(),
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
credentials: config.credentials(),
};
};
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
const extensionConfiguration = Object.assign(client$1.getAwsRegionExtensionConfiguration(runtimeConfig), client.getDefaultExtensionConfiguration(runtimeConfig), protocols.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
extensions.forEach((extension) => extension.configure(extensionConfiguration));
return Object.assign(runtimeConfig, client$1.resolveAwsRegionExtensionConfiguration(extensionConfiguration), client.resolveDefaultRuntimeConfig(extensionConfiguration), protocols.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
};
class SecretsManagerClient extends client.Client {
config;
constructor(...[configuration]) {
const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
super(_config_0);
this.initConfig = _config_0;
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = client$1.resolveUserAgentConfig(_config_1);
const _config_3 = retry.resolveRetryConfig(_config_2);
const _config_4 = config.resolveRegionConfig(_config_3);
const _config_5 = client$1.resolveHostHeaderConfig(_config_4);
const _config_6 = endpoints.resolveEndpointConfig(_config_5);
const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
this.config = _config_8;
this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
this.middlewareStack.use(client$1.getUserAgentPlugin(this.config));
this.middlewareStack.use(retry.getRetryPlugin(this.config));
this.middlewareStack.use(protocols.getContentLengthPlugin(this.config));
this.middlewareStack.use(client$1.getHostHeaderPlugin(this.config));
this.middlewareStack.use(client$1.getLoggerPlugin(this.config));
this.middlewareStack.use(client$1.getRecursionDetectionPlugin(this.config));
this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSecretsManagerHttpAuthSchemeParametersProvider,
identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
"aws.auth#sigv4": config.credentials,
}),
}));
this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
}
destroy() {
super.destroy();
}
}
class BatchGetSecretValueCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "BatchGetSecretValue", {})
.n("SecretsManagerClient", "BatchGetSecretValueCommand")
.sc(schemas_0.BatchGetSecretValue$)
.build() {
}
class CancelRotateSecretCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "CancelRotateSecret", {})
.n("SecretsManagerClient", "CancelRotateSecretCommand")
.sc(schemas_0.CancelRotateSecret$)
.build() {
}
class CreateSecretCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "CreateSecret", {})
.n("SecretsManagerClient", "CreateSecretCommand")
.sc(schemas_0.CreateSecret$)
.build() {
}
class DeleteResourcePolicyCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "DeleteResourcePolicy", {})
.n("SecretsManagerClient", "DeleteResourcePolicyCommand")
.sc(schemas_0.DeleteResourcePolicy$)
.build() {
}
class DeleteSecretCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "DeleteSecret", {})
.n("SecretsManagerClient", "DeleteSecretCommand")
.sc(schemas_0.DeleteSecret$)
.build() {
}
class DescribeSecretCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "DescribeSecret", {})
.n("SecretsManagerClient", "DescribeSecretCommand")
.sc(schemas_0.DescribeSecret$)
.build() {
}
class GetRandomPasswordCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "GetRandomPassword", {})
.n("SecretsManagerClient", "GetRandomPasswordCommand")
.sc(schemas_0.GetRandomPassword$)
.build() {
}
class GetResourcePolicyCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "GetResourcePolicy", {})
.n("SecretsManagerClient", "GetResourcePolicyCommand")
.sc(schemas_0.GetResourcePolicy$)
.build() {
}
class GetSecretValueCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "GetSecretValue", {})
.n("SecretsManagerClient", "GetSecretValueCommand")
.sc(schemas_0.GetSecretValue$)
.build() {
}
class ListSecretsCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "ListSecrets", {})
.n("SecretsManagerClient", "ListSecretsCommand")
.sc(schemas_0.ListSecrets$)
.build() {
}
class ListSecretVersionIdsCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "ListSecretVersionIds", {})
.n("SecretsManagerClient", "ListSecretVersionIdsCommand")
.sc(schemas_0.ListSecretVersionIds$)
.build() {
}
class PutResourcePolicyCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "PutResourcePolicy", {})
.n("SecretsManagerClient", "PutResourcePolicyCommand")
.sc(schemas_0.PutResourcePolicy$)
.build() {
}
class PutSecretValueCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "PutSecretValue", {})
.n("SecretsManagerClient", "PutSecretValueCommand")
.sc(schemas_0.PutSecretValue$)
.build() {
}
class RemoveRegionsFromReplicationCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "RemoveRegionsFromReplication", {})
.n("SecretsManagerClient", "RemoveRegionsFromReplicationCommand")
.sc(schemas_0.RemoveRegionsFromReplication$)
.build() {
}
class ReplicateSecretToRegionsCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "ReplicateSecretToRegions", {})
.n("SecretsManagerClient", "ReplicateSecretToRegionsCommand")
.sc(schemas_0.ReplicateSecretToRegions$)
.build() {
}
class RestoreSecretCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "RestoreSecret", {})
.n("SecretsManagerClient", "RestoreSecretCommand")
.sc(schemas_0.RestoreSecret$)
.build() {
}
class RotateSecretCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "RotateSecret", {})
.n("SecretsManagerClient", "RotateSecretCommand")
.sc(schemas_0.RotateSecret$)
.build() {
}
class StopReplicationToReplicaCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "StopReplicationToReplica", {})
.n("SecretsManagerClient", "StopReplicationToReplicaCommand")
.sc(schemas_0.StopReplicationToReplica$)
.build() {
}
class TagResourceCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "TagResource", {})
.n("SecretsManagerClient", "TagResourceCommand")
.sc(schemas_0.TagResource$)
.build() {
}
class UntagResourceCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "UntagResource", {})
.n("SecretsManagerClient", "UntagResourceCommand")
.sc(schemas_0.UntagResource$)
.build() {
}
class UpdateSecretCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "UpdateSecret", {})
.n("SecretsManagerClient", "UpdateSecretCommand")
.sc(schemas_0.UpdateSecret$)
.build() {
}
class UpdateSecretVersionStageCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "UpdateSecretVersionStage", {})
.n("SecretsManagerClient", "UpdateSecretVersionStageCommand")
.sc(schemas_0.UpdateSecretVersionStage$)
.build() {
}
class ValidateResourcePolicyCommand extends client.Command
.classBuilder()
.ep(commonParams)
.m(function (Command, cs, config, o) {
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
})
.s("secretsmanager", "ValidateResourcePolicy", {})
.n("SecretsManagerClient", "ValidateResourcePolicyCommand")
.sc(schemas_0.ValidateResourcePolicy$)
.build() {
}
const paginateBatchGetSecretValue = core.createPaginator(SecretsManagerClient, BatchGetSecretValueCommand, "NextToken", "NextToken", "MaxResults");
const paginateListSecrets = core.createPaginator(SecretsManagerClient, ListSecretsCommand, "NextToken", "NextToken", "MaxResults");
const paginateListSecretVersionIds = core.createPaginator(SecretsManagerClient, ListSecretVersionIdsCommand, "NextToken", "NextToken", "MaxResults");
const commands = {
BatchGetSecretValueCommand,
CancelRotateSecretCommand,
CreateSecretCommand,
DeleteResourcePolicyCommand,
DeleteSecretCommand,
DescribeSecretCommand,
GetRandomPasswordCommand,
GetResourcePolicyCommand,
GetSecretValueCommand,
ListSecretsCommand,
ListSecretVersionIdsCommand,
PutResourcePolicyCommand,
PutSecretValueCommand,
RemoveRegionsFromReplicationCommand,
ReplicateSecretToRegionsCommand,
RestoreSecretCommand,
RotateSecretCommand,
StopReplicationToReplicaCommand,
TagResourceCommand,
UntagResourceCommand,
UpdateSecretCommand,
UpdateSecretVersionStageCommand,
ValidateResourcePolicyCommand,
};
const paginators = {
paginateBatchGetSecretValue,
paginateListSecrets,
paginateListSecretVersionIds,
};
class SecretsManager extends SecretsManagerClient {
}
client.createAggregatedClient(commands, SecretsManager, { paginators });
const FilterNameStringType = {
all: "all",
description: "description",
name: "name",
owning_service: "owning-service",
primary_region: "primary-region",
tag_key: "tag-key",
tag_value: "tag-value",
};
const StatusType = {
Failed: "Failed",
InProgress: "InProgress",
InSync: "InSync",
};
const SortByType = {
created_date: "created-date",
last_accessed_date: "last-accessed-date",
last_changed_date: "last-changed-date",
name: "name",
};
const SortOrderType = {
asc: "asc",
desc: "desc",
};
exports.$Command = client.Command;
exports.__Client = client.Client;
exports.SecretsManagerServiceException = SecretsManagerServiceException.SecretsManagerServiceException;
exports.BatchGetSecretValueCommand = BatchGetSecretValueCommand;
exports.CancelRotateSecretCommand = CancelRotateSecretCommand;
exports.CreateSecretCommand = CreateSecretCommand;
exports.DeleteResourcePolicyCommand = DeleteResourcePolicyCommand;
exports.DeleteSecretCommand = DeleteSecretCommand;
exports.DescribeSecretCommand = DescribeSecretCommand;
exports.FilterNameStringType = FilterNameStringType;
exports.GetRandomPasswordCommand = GetRandomPasswordCommand;
exports.GetResourcePolicyCommand = GetResourcePolicyCommand;
exports.GetSecretValueCommand = GetSecretValueCommand;
exports.ListSecretVersionIdsCommand = ListSecretVersionIdsCommand;
exports.ListSecretsCommand = ListSecretsCommand;
exports.PutResourcePolicyCommand = PutResourcePolicyCommand;
exports.PutSecretValueCommand = PutSecretValueCommand;
exports.RemoveRegionsFromReplicationCommand = RemoveRegionsFromReplicationCommand;
exports.ReplicateSecretToRegionsCommand = ReplicateSecretToRegionsCommand;
exports.RestoreSecretCommand = RestoreSecretCommand;
exports.RotateSecretCommand = RotateSecretCommand;
exports.SecretsManager = SecretsManager;
exports.SecretsManagerClient = SecretsManagerClient;
exports.SortByType = SortByType;
exports.SortOrderType = SortOrderType;
exports.StatusType = StatusType;
exports.StopReplicationToReplicaCommand = StopReplicationToReplicaCommand;
exports.TagResourceCommand = TagResourceCommand;
exports.UntagResourceCommand = UntagResourceCommand;
exports.UpdateSecretCommand = UpdateSecretCommand;
exports.UpdateSecretVersionStageCommand = UpdateSecretVersionStageCommand;
exports.ValidateResourcePolicyCommand = ValidateResourcePolicyCommand;
exports.paginateBatchGetSecretValue = paginateBatchGetSecretValue;
exports.paginateListSecretVersionIds = paginateListSecretVersionIds;
exports.paginateListSecrets = paginateListSecrets;
Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
Object.defineProperty(exports, '__proto__', {
enumerable: true,
value: schemas_0['__proto__']
});
Object.keys(schemas_0).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];
});
Object.prototype.hasOwnProperty.call(errors, '__proto__') &&
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
Object.defineProperty(exports, '__proto__', {
enumerable: true,
value: errors['__proto__']
});
Object.keys(errors).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];
});