Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/node-config-provider

Package Overview
Dependencies
Maintainers
5
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/node-config-provider - npm Package Compare versions

Comparing version 1.0.0-gamma.4 to 1.0.0-rc.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [1.0.0-rc.1](https://github.com/aws/aws-sdk-js-v3/compare/v1.0.0-gamma.11...v1.0.0-rc.1) (2020-10-19)
### Features
* ready for release candidate ([#1578](https://github.com/aws/aws-sdk-js-v3/issues/1578)) ([519f66c](https://github.com/aws/aws-sdk-js-v3/commit/519f66c6388b91d0bd750a511e6d1af56196835e))
# [1.0.0-gamma.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/node-config-provider@1.0.0-gamma.3...@aws-sdk/node-config-provider@1.0.0-gamma.4) (2020-10-07)

@@ -8,0 +19,0 @@

16

dist/cjs/configLoader.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadConfig = void 0;
var property_provider_1 = require("@aws-sdk/property-provider");
var fromEnv_1 = require("./fromEnv");
var fromSharedConfigFiles_1 = require("./fromSharedConfigFiles");
var fromStatic_1 = require("./fromStatic");
exports.loadConfig = function (_a, configuration) {
var environmentVariableSelector = _a.environmentVariableSelector, configFileSelector = _a.configFileSelector, defaultValue = _a.default;
if (configuration === void 0) { configuration = {}; }
return property_provider_1.memoize(property_provider_1.chain(fromEnv_1.fromEnv(environmentVariableSelector), fromSharedConfigFiles_1.fromSharedConfigFiles(configFileSelector, configuration), fromStatic_1.fromStatic(defaultValue)));
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnTG9hZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbmZpZ0xvYWRlci50cyJdLCJu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property_provider_1 = require("@aws-sdk/property-provider");
const fromEnv_1 = require("./fromEnv");
const fromSharedConfigFiles_1 = require("./fromSharedConfigFiles");
const fromStatic_1 = require("./fromStatic");
exports.loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => property_provider_1.memoize(property_provider_1.chain(fromEnv_1.fromEnv(environmentVariableSelector), fromSharedConfigFiles_1.fromSharedConfigFiles(configFileSelector, configuration), fromStatic_1.fromStatic(defaultValue)));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnTG9hZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbmZpZ0xvYWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxrRUFBNEQ7QUFHNUQsdUNBQW1EO0FBQ25ELG1FQUFvRztBQUNwRyw2Q0FBNEQ7QUFxQi9DLFFBQUEsVUFBVSxHQUFHLENBQ3hCLEVBQUUsMkJBQTJCLEVBQUUsa0JBQWtCLEVBQUUsT0FBTyxFQUFFLFlBQVksRUFBNEIsRUFDcEcsZ0JBQW9DLEVBQUUsRUFDekIsRUFBRSxDQUNmLDJCQUFPLENBQ0wseUJBQUssQ0FDSCxpQkFBTyxDQUFDLDJCQUEyQixDQUFDLEVBQ3BDLDZDQUFxQixDQUFDLGtCQUFrQixFQUFFLGFBQWEsQ0FBQyxFQUN4RCx1QkFBVSxDQUFDLFlBQVksQ0FBQyxDQUN6QixDQUNGLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjaGFpbiwgbWVtb2l6ZSB9IGZyb20gXCJAYXdzLXNkay9wcm9wZXJ0eS1wcm92aWRlclwiO1xuaW1wb3J0IHsgUHJvdmlkZXIgfSBmcm9tIFwiQGF3cy1zZGsvdHlwZXNcIjtcblxuaW1wb3J0IHsgZnJvbUVudiwgR2V0dGVyRnJvbUVudiB9IGZyb20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hbHVlIH06IExvYWRlZENvbmZpZ1NlbGVjdG9yczxUPixcbiAgY29uZmlndXJhdGlvbjogTG9jYWxDb25maWdPcHRpb25zID0ge31cbik6IFByb3ZpZGVyPFQ+ID0+XG4gIG1lbW9pemUoXG4gICAgY2hhaW4oXG4gICAgICBmcm9tRW52KGVudmlyb25tZW50VmFyaWFibGVTZWxlY3RvciksXG4gICAgICBmcm9tU2hhcmVkQ29uZmlnRmlsZXMoY29uZmlnRmlsZVNlbGVjdG9yLCBjb25maWd1cmF0aW9uKSxcbiAgICAgIGZyb21TdGF0aWMoZGVmYXVsdFZhbHVlKVxuICAgIClcbiAgKTtcbiJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var property_provider_1 = require("@aws-sdk/property-provider");
var configLoader_1 = require("./configLoader");
var fromEnv_1 = require("./fromEnv");
var fromSharedConfigFiles_1 = require("./fromSharedConfigFiles");
const property_provider_1 = require("@aws-sdk/property-provider");
const configLoader_1 = require("./configLoader");
const fromEnv_1 = require("./fromEnv");
const fromSharedConfigFiles_1 = require("./fromSharedConfigFiles");
jest.mock("./fromEnv");
jest.mock("./fromSharedConfigFiles");
jest.mock("@aws-sdk/property-provider");
describe("loadConfig", function () {
var configuration = {
describe("loadConfig", () => {
const configuration = {
profile: "profile",
};
afterEach(function () {
afterEach(() => {
jest.clearAllMocks();
});
it("passes fromEnv(), fromSharedConfigFiles() and fromStatic() to chain", function () {
var mockFromEnvReturn = "mockFromEnvReturn";
it("passes fromEnv(), fromSharedConfigFiles() and fromStatic() to chain", () => {
const mockFromEnvReturn = "mockFromEnvReturn";
fromEnv_1.fromEnv.mockReturnValueOnce(mockFromEnvReturn);
var mockFromSharedConfigFilesReturn = "mockFromSharedConfigFilesReturn";
const mockFromSharedConfigFilesReturn = "mockFromSharedConfigFilesReturn";
fromSharedConfigFiles_1.fromSharedConfigFiles.mockReturnValueOnce(mockFromSharedConfigFilesReturn);
var mockFromStatic = "mockFromStatic";
const mockFromStatic = "mockFromStatic";
property_provider_1.fromStatic.mockReturnValueOnce(mockFromStatic);
var envVarSelector = function (env) { return env["AWS_CONFIG_FOO"]; };
var configKey = function (profile) { return profile["aws_config_foo"]; };
var defaultValue = "foo-value";
const envVarSelector = (env) => env["AWS_CONFIG_FOO"];
const configKey = (profile) => profile["aws_config_foo"];
const defaultValue = "foo-value";
configLoader_1.loadConfig({

@@ -41,4 +41,4 @@ environmentVariableSelector: envVarSelector,

});
it("passes output of chain to memoize", function () {
var mockChainReturn = "mockChainReturn";
it("passes output of chain to memoize", () => {
const mockChainReturn = "mockChainReturn";
property_provider_1.chain.mockReturnValueOnce(mockChainReturn);

@@ -50,4 +50,4 @@ configLoader_1.loadConfig({});

});
it("returns output memoize", function () {
var mockMemoizeReturn = "mockMemoizeReturn";
it("returns output memoize", () => {
const mockMemoizeReturn = "mockMemoizeReturn";
property_provider_1.memoize.mockReturnValueOnce(mockMemoizeReturn);

@@ -57,2 +57,2 @@ expect(configLoader_1.loadConfig({})).toEqual(mockMemoizeReturn);

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnTG9hZGVyLnNwZWMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlnTG9hZGVyLnNwZWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxnRUFBd0U7QUFHeEUsK0NBQTRDO0FBQzVDLHFDQUFvQztBQUNwQyxpRUFBa0Y7QUFFbEYsSUFBSSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztBQUN2QixJQUFJLENBQUMsSUFBSSxDQUFDLHlCQUF5QixDQUFDLENBQUM7QUFDckMsSUFBSSxDQUFDLElBQUksQ0FBQyw0QkFBNEIsQ0FBQyxDQUFDO0FBRXhDLFFBQVEsQ0FBQyxZQUFZLEVBQUU7SUFDckIsSUFBTSxhQUFhLEdBQXFCO1FBQ3RDLE9BQU8sRUFB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O1xuICAgIGV4cGVjdChtZW1vaXplKS50b0hhdmVCZWVuQ2FsbGVkVGltZXMoMSk7XG4gICAgZXhwZWN0KG1lbW9pemUpLnRvSGF2ZUJlZW5DYWxsZWRXaXRoKG1vY2tDaGFpblJldHVybik7XG4gIH0pO1xuXG4gIGl0KFwicmV0dXJucyBvdXRwdXQgbWVtb2l6ZVwiLCAoKSA9PiB7XG4gICAgY29uc3QgbW9ja01lbW9pemVSZXR1cm4gPSBcIm1vY2tNZW1vaXplUmV0dXJuXCI7XG4gICAgKG1lbW9pemUgYXMgamVzdC5Nb2NrKS5tb2NrUmV0dXJuVmFsdWVPbmNlKG1vY2tNZW1vaXplUmV0dXJuKTtcbiAgICBleHBlY3QobG9hZENvbmZpZyh7fSBhcyBhbnkpKS50b0VxdWFsKG1vY2tNZW1vaXplUmV0dXJuKTtcbiAgfSk7XG59KTtcbiJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromEnv = void 0;
var tslib_1 = require("tslib");
var property_provider_1 = require("@aws-sdk/property-provider");
const property_provider_1 = require("@aws-sdk/property-provider");
/**

@@ -10,18 +9,14 @@ * Get config value given the environment variable name or getter from

*/
exports.fromEnv = function (envVarSelector) { return function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var config;
return tslib_1.__generator(this, function (_a) {
try {
config = envVarSelector(process.env);
if (config === undefined) {
throw new Error();
}
return [2 /*return*/, config];
exports.fromEnv = (envVarSelector) => async () => {
try {
const config = envVarSelector(process.env);
if (config === undefined) {
throw new Error();
}
catch (e) {
throw new property_provider_1.ProviderError(e.message || "Cannot load config from environment variables with getter: " + envVarSelector);
}
return [2 /*return*/];
});
}); }; };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUVudi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mcm9tRW52LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3Mi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WcgPSBlbnZWYXJTZWxlY3Rvcihwcm9jZXNzLmVudik7XG4gICAgaWYgKGNvbmZpZyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoKTtcbiAgICB9XG4gICAgcmV0dXJuIGNvbmZpZyBhcyBUO1xuICB9IGNhdGNoIChlKSB7XG4gICAgdGhyb3cgbmV3IFByb3ZpZGVyRXJyb3IoXG4gICAgICBlLm1lc3NhZ2UgfHwgYENhbm5vdCBsb2FkIGNvbmZpZyBmcm9tIGVudmlyb25tZW50IHZhcmlhYmxlcyB3aXRoIGdldHRlcjogJHtlbnZWYXJTZWxlY3Rvcn1gXG4gICAgKTtcbiAgfVxufTtcbiJdfQ==
return config;
}
catch (e) {
throw new property_provider_1.ProviderError(e.message || `Cannot load config from environment variables with getter: ${envVarSelector}`);
}
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUVudi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mcm9tRW52LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGtFQUEyRDtBQUszRDs7O0dBR0c7QUFDVSxRQUFBLE9BQU8sR0FBRyxDQUFhLGNBQWdDLEVBQWUsRUFBRSxDQUFDLEtBQUssSUFBSSxFQUFFO0lBQy9GLElBQUk7UUFDRixNQUFNLE1BQU0sR0FBRyxjQUFjLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQzNDLElBQUksTUFBTSxLQUFLLFNBQVMsRUFBRTtZQUN4QixNQUFNLElBQUksS0FBSyxFQUFFLENBQUM7U0FDbkI7UUFDRCxPQUFPLE1BQVcsQ0FBQztLQUNwQjtJQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ1YsTUFBTSxJQUFJLGlDQUFhLENBQ3JCLENBQUMsQ0FBQyxPQUFPLElBQUksOERBQThELGNBQWMsRUFBRSxDQUM1RixDQUFDO0tBQ0g7QUFDSCxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm92aWRlckVycm9yIH0gZnJvbSBcIkBhd3Mtc2RrL3Byb3BlcnR5LXByb3ZpZGVyXCI7XG5pbXBvcnQgeyBQcm92aWRlciB9IGZyb20gXCJAYXdzLXNkay90eXBlc1wiO1xuXG5leHBvcnQgdHlwZSBHZXR0ZXJGcm9tRW52PFQ+ID0gKGVudjogTm9kZUpTLlByb2Nlc3NFbnYpID0+IFQgfCB1bmRlZmluZWQ7XG5cbi8qKlxuICogR2V0IGNvbmZpZyB2YWx1ZSBnaXZlbiB0aGUgZW52aXJvbm1lbnQgdmFyaWFibGUgbmFtZSBvciBnZXR0ZXIgZnJvbVxuICogZW52aXJvbm1lbnQgdmFyaWFibGUuXG4gKi9cbmV4cG9ydCBjb25zdCBmcm9tRW52ID0gPFQgPSBzdHJpbmc+KGVudlZhclNlbGVjdG9yOiBHZXR0ZXJGcm9tRW52PFQ+KTogUHJvdmlkZXI8VD4gPT4gYXN5bmMgKCkgPT4ge1xuICB0cnkge1xuICAgIGNvbnN0IGNvbmZpZyA9IGVudlZhclNlbGVjdG9yKHByb2Nlc3MuZW52KTtcbiAgICBpZiAoY29uZmlnID09PSB1bmRlZmluZWQpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcigpO1xuICAgIH1cbiAgICByZXR1cm4gY29uZmlnIGFzIFQ7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICB0aHJvdyBuZXcgUHJvdmlkZXJFcnJvcihcbiAgICAgIGUubWVzc2FnZSB8fCBgQ2Fubm90IGxvYWQgY29uZmlnIGZyb20gZW52aXJvbm1lbnQgdmFyaWFibGVzIHdpdGggZ2V0dGVyOiAke2VudlZhclNlbGVjdG9yfWBcbiAgICApO1xuICB9XG59O1xuIl19
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var property_provider_1 = require("@aws-sdk/property-provider");
var fromEnv_1 = require("./fromEnv");
describe("fromEnv", function () {
describe("with env var getter", function () {
var envVarName = "ENV_VAR_NAME";
var envVarGetter = function (env) { return env[envVarName]; };
var envVarValue = process.env[envVarName];
var mockEnvVarValue = "mockEnvVarValue";
var getProviderError = function (getter) {
return new property_provider_1.ProviderError("Cannot load config from environment variables with getter: " + getter);
};
beforeEach(function () {
const property_provider_1 = require("@aws-sdk/property-provider");
const fromEnv_1 = require("./fromEnv");
describe("fromEnv", () => {
describe("with env var getter", () => {
const envVarName = "ENV_VAR_NAME";
const envVarGetter = (env) => env[envVarName];
const envVarValue = process.env[envVarName];
const mockEnvVarValue = "mockEnvVarValue";
const getProviderError = (getter) => new property_provider_1.ProviderError(`Cannot load config from environment variables with getter: ${getter}`);
beforeEach(() => {
delete process.env[envVarName];
});
afterAll(function () {
afterAll(() => {
process.env[envVarName] = envVarValue;
});
it("returns string value in '" + envVarName + "' env var when set", function () {
it(`returns string value in '${envVarName}' env var when set`, () => {
process.env[envVarName] = mockEnvVarValue;
return expect(fromEnv_1.fromEnv(envVarGetter)()).resolves.toBe(mockEnvVarValue);
});
it("return complex value from the getter", function () {
var value = { Foo: "bar" };
var getter = jest.fn().mockReturnValue(value);
it("return complex value from the getter", () => {
const value = { Foo: "bar" };
const getter = jest.fn().mockReturnValue(value);
// Validate the generic type works
return expect(fromEnv_1.fromEnv(getter)()).resolves.toEqual(value);
});
it("throws when '" + envVarName + "' env var is not set", function () {
it(`throws when '${envVarName}' env var is not set`, () => {
expect.assertions(1);
return expect(fromEnv_1.fromEnv(envVarGetter)()).rejects.toMatchObject(getProviderError(envVarGetter));
});
it("throws when the getter function throws", function () {
var exception = new Error("Exception when getting the config");
var getter = jest.fn().mockRejectedValue(exception);
it("throws when the getter function throws", () => {
const exception = new Error("Exception when getting the config");
const getter = jest.fn().mockRejectedValue(exception);
return expect(fromEnv_1.fromEnv(getter)()).rejects.toEqual(exception);

@@ -41,2 +39,2 @@ });

});
//# sourceMappingURL=data:application/json;base64,e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hbnkpID0+IFZhbHVlID0gamVzdC5mbigpLm1vY2tSZXR1cm5WYWx1ZSh2YWx1ZSk7XG4gICAgICAvLyBWYWxpZGF0ZSB0aGUgZ2VuZXJpYyB0eXBlIHdvcmtzXG4gICAgICByZXR1cm4gZXhwZWN0KGZyb21FbnYoZ2V0dGVyKSgpKS5yZXNvbHZlcy50b0VxdWFsKHZhbHVlKTtcbiAgICB9KTtcblxuICAgIGl0KGB0aHJvd3Mgd2hlbiAnJHtlbnZWYXJOYW1lfScgZW52IHZhciBpcyBub3Qgc2V0YCwgKCkgPT4ge1xuICAgICAgZXhwZWN0LmFzc2VydGlvbnMoMSk7XG4gICAgICByZXR1cm4gZXhwZWN0KGZyb21FbnYoZW52VmFyR2V0dGVyKSgpKS5yZWplY3RzLnRvTWF0Y2hPYmplY3QoZ2V0UHJvdmlkZXJFcnJvcihlbnZWYXJHZXR0ZXIpKTtcbiAgICB9KTtcblxuICAgIGl0KFwidGhyb3dzIHdoZW4gdGhlIGdldHRlciBmdW5jdGlvbiB0aHJvd3NcIiwgKCkgPT4ge1xuICAgICAgY29uc3QgZXhjZXB0aW9uID0gbmV3IEVycm9yKFwiRXhjZXB0aW9uIHdoZW4gZ2V0dGluZyB0aGUgY29uZmlnXCIpO1xuICAgICAgY29uc3QgZ2V0dGVyOiAoZW52OiBhbnkpID0+IGFueSA9IGplc3QuZm4oKS5tb2NrUmVqZWN0ZWRWYWx1ZShleGNlcHRpb24pO1xuICAgICAgcmV0dXJuIGV4cGVjdChmcm9tRW52KGdldHRlcikoKSkucmVqZWN0cy50b0VxdWFsKGV4Y2VwdGlvbik7XG4gICAgfSk7XG4gIH0pO1xufSk7XG4iXX0=
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromSharedConfigFiles = exports.ENV_PROFILE = void 0;
var tslib_1 = require("tslib");
var property_provider_1 = require("@aws-sdk/property-provider");
var shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");
var DEFAULT_PROFILE = "default";
const property_provider_1 = require("@aws-sdk/property-provider");
const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");
const DEFAULT_PROFILE = "default";
exports.ENV_PROFILE = "AWS_PROFILE";

@@ -12,33 +11,21 @@ /**

*/
exports.fromSharedConfigFiles = function (configSelector, _a) {
if (_a === void 0) { _a = {}; }
var _b = _a.preferredFile, preferredFile = _b === void 0 ? "config" : _b, init = tslib_1.__rest(_a, ["preferredFile"]);
return function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var _a, loadedConfig, _b, profile, _c, configFile, credentialsFile, profileFromCredentials, profileFromConfig, mergedProfile, configValue;
return tslib_1.__generator(this, function (_d) {
switch (_d.label) {
case 0:
_a = init.loadedConfig, loadedConfig = _a === void 0 ? shared_ini_file_loader_1.loadSharedConfigFiles(init) : _a, _b = init.profile, profile = _b === void 0 ? process.env[exports.ENV_PROFILE] || DEFAULT_PROFILE : _b;
return [4 /*yield*/, loadedConfig];
case 1:
_c = _d.sent(), configFile = _c.configFile, credentialsFile = _c.credentialsFile;
profileFromCredentials = credentialsFile[profile] || {};
profileFromConfig = configFile[profile] || {};
mergedProfile = preferredFile === "config"
? tslib_1.__assign(tslib_1.__assign({}, profileFromCredentials), profileFromConfig) : tslib_1.__assign(tslib_1.__assign({}, profileFromConfig), profileFromCredentials);
try {
configValue = configSelector(mergedProfile);
if (configValue === undefined) {
throw new Error();
}
return [2 /*return*/, configValue];
}
catch (e) {
throw new property_provider_1.ProviderError(e.message || "Cannot load config for profile " + profile + " in SDK configuration files with getter: " + configSelector);
}
return [2 /*return*/];
}
});
}); };
exports.fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => {
const { loadedConfig = shared_ini_file_loader_1.loadSharedConfigFiles(init), profile = process.env[exports.ENV_PROFILE] || DEFAULT_PROFILE } = init;
const { configFile, credentialsFile } = await loadedConfig;
const profileFromCredentials = credentialsFile[profile] || {};
const profileFromConfig = configFile[profile] || {};
const mergedProfile = preferredFile === "config"
? { ...profileFromCredentials, ...profileFromConfig }
: { ...profileFromConfig, ...profileFromCredentials };
try {
const configValue = configSelector(mergedProfile);
if (configValue === undefined) {
throw new Error();
}
return configValue;
}
catch (e) {
throw new property_provider_1.ProviderError(e.message || `Cannot load config for profile ${profile} in SDK configuration files with getter: ${configSelector}`);
}
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbVNoYXJlZENvbmZpZ0ZpbGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Zyb21TaGFyZWRDb25maWdGaWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsZ0VBQTJEO0FBQzNELDBFQUt5QztBQUd6QyxJQUFNLGVBQWUsR0FBRyxTQUFTLENBQUM7QUFDckIsUUFBQSxXQUFXLEdBQUcsYUFBYSxDQUFDO0FBd0J6Qzs7R0FFRztBQUNVLFFBQUEscUJBQXFCLEdBQUcsVUFDbkMsY0FBbUMsRUFDbkMsRUFBNEQ7SUFBNUQsbUJBQUEsRUFBQSxPQUE0RDtJQUExRCxJQUFBLHFCQUF3QixFQUF4QixhQUFhLG1CQUFHLFFBQVEsS0FBQSxFQUFLLElBQUksc0JBQW5DLGlCQUFxQyxDQUFGO0lBQ25CLE9BQUE7Ozs7O29CQUNSLEtBQXNHLElBQUksYUFBaEUsRUFBMUMsWUFBWSxtQkFBRyw4Q0FBcUIsQ0FBQyxJQUFJLENBQUMsS0FBQSxFQUFFLEtBQTBELElBQUksUUFBVCxFQUFyRCxPQUFPLG1CQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsbUJBQVcsQ0FBQyxJQUFJLGVBQWUsS0FBQSxDQUFVO29CQUUzRSxxQkFBTSxZQUFZLEVBQUE7O29CQUFwRCxLQUFrQyxTQUFrQixFQUFsRCxVQUFVLGdCQUFBLEVBQUUsZUFBZSxxQkFBQTtvQkFFN0Isc0JBQXNCLE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yb21DcmVkZW50aWFscywgLi4ucHJvZmlsZUZyb21Db25maWcgfVxuICAgICAgOiB7IC4uLnByb2ZpbGVGcm9tQ29uZmlnLCAuLi5wcm9maWxlRnJvbUNyZWRlbnRpYWxzIH07XG5cbiAgdHJ5IHtcbiAgICBjb25zdCBjb25maWdWYWx1ZSA9IGNvbmZpZ1NlbGVjdG9yKG1lcmdlZFByb2ZpbGUpO1xuICAgIGlmIChjb25maWdWYWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoKTtcbiAgICB9XG4gICAgcmV0dXJuIGNvbmZpZ1ZhbHVlO1xuICB9IGNhdGNoIChlKSB7XG4gICAgdGhyb3cgbmV3IFByb3ZpZGVyRXJyb3IoXG4gICAgICBlLm1lc3NhZ2UgfHwgYENhbm5vdCBsb2FkIGNvbmZpZyBmb3IgcHJvZmlsZSAke3Byb2ZpbGV9IGluIFNESyBjb25maWd1cmF0aW9uIGZpbGVzIHdpdGggZ2V0dGVyOiAke2NvbmZpZ1NlbGVjdG9yfWBcbiAgICApO1xuICB9XG59O1xuIl19
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var property_provider_1 = require("@aws-sdk/property-provider");
var shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");
var fromSharedConfigFiles_1 = require("./fromSharedConfigFiles");
jest.mock("@aws-sdk/shared-ini-file-loader", function () { return ({
const property_provider_1 = require("@aws-sdk/property-provider");
const shared_ini_file_loader_1 = require("@aws-sdk/shared-ini-file-loader");
const fromSharedConfigFiles_1 = require("./fromSharedConfigFiles");
jest.mock("@aws-sdk/shared-ini-file-loader", () => ({
loadSharedConfigFiles: jest.fn(),
}); });
describe("fromSharedConfigFiles", function () {
var envProfile = process.env[fromSharedConfigFiles_1.ENV_PROFILE];
var configKey = "config_key";
var configGetter = function (profile) { return profile[configKey]; };
beforeEach(function () {
}));
describe("fromSharedConfigFiles", () => {
const envProfile = process.env[fromSharedConfigFiles_1.ENV_PROFILE];
const configKey = "config_key";
const configGetter = (profile) => profile[configKey];
beforeEach(() => {
delete process.env[fromSharedConfigFiles_1.ENV_PROFILE];
});
afterAll(function () {
afterAll(() => {
process.env[fromSharedConfigFiles_1.ENV_PROFILE] = envProfile;
});
var getProviderError = function (profile, getter) {
return new property_provider_1.ProviderError("Cannot load config for profile " + profile + " in SDK configuration files with getter: " + getter);
};
describe("loadedConfig", function () {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
var mockConfigAnswer = "mockConfigAnswer";
var mockConfigNotAnswer = "mockConfigNotAnswer";
var mockCredentialsAnswer = "mockCredentialsAnswer";
var mockCredentialsNotAnswer = "mockCredentialsNotAnswer";
var loadedConfigResolves = [
const getProviderError = (profile, getter) => new property_provider_1.ProviderError(`Cannot load config for profile ${profile} in SDK configuration files with getter: ${getter}`);
describe("loadedConfig", () => {
const mockConfigAnswer = "mockConfigAnswer";
const mockConfigNotAnswer = "mockConfigNotAnswer";
const mockCredentialsAnswer = "mockCredentialsAnswer";
const mockCredentialsNotAnswer = "mockCredentialsNotAnswer";
const loadedConfigResolves = [
{
message: "returns configValue from default profile",
iniDataInConfig: {
default: (_a = {}, _a[configKey] = mockConfigAnswer, _a),
default: { [configKey]: mockConfigAnswer },
},
iniDataInCredentials: {
default: (_b = {}, _b[configKey] = mockCredentialsNotAnswer, _b),
default: { [configKey]: mockCredentialsNotAnswer },
},

@@ -42,7 +39,7 @@ configValueToVerify: mockConfigAnswer,

iniDataInConfig: {
default: (_c = {}, _c[configKey] = mockConfigNotAnswer, _c),
foo: (_d = {}, _d[configKey] = mockConfigAnswer, _d),
default: { [configKey]: mockConfigNotAnswer },
foo: { [configKey]: mockConfigAnswer },
},
iniDataInCredentials: {
foo: (_e = {}, _e[configKey] = mockCredentialsNotAnswer, _e),
foo: { [configKey]: mockCredentialsNotAnswer },
},

@@ -55,7 +52,7 @@ profile: "foo",

iniDataInConfig: {
default: (_f = {}, _f[configKey] = mockConfigNotAnswer, _f),
foo: (_g = {}, _g[configKey] = mockConfigNotAnswer, _g),
default: { [configKey]: mockConfigNotAnswer },
foo: { [configKey]: mockConfigNotAnswer },
},
iniDataInCredentials: {
foo: (_h = {}, _h[configKey] = mockCredentialsAnswer, _h),
foo: { [configKey]: mockCredentialsAnswer },
},

@@ -69,3 +66,3 @@ profile: "foo",

iniDataInConfig: {
foo: (_j = {}, _j[configKey] = mockConfigAnswer, _j),
foo: { [configKey]: mockConfigAnswer },
},

@@ -81,3 +78,3 @@ iniDataInCredentials: {},

iniDataInCredentials: {
foo: (_k = {}, _k[configKey] = mockCredentialsAnswer, _k),
foo: { [configKey]: mockCredentialsAnswer },
},

@@ -88,7 +85,7 @@ configValueToVerify: mockCredentialsAnswer,

];
var loadedConfigRejects = [
const loadedConfigRejects = [
{
message: "rejects if default profile is not present and profile value is not passed",
iniDataInConfig: {
foo: (_l = {}, _l[configKey] = mockConfigNotAnswer, _l),
foo: { [configKey]: mockConfigNotAnswer },
},

@@ -100,3 +97,3 @@ iniDataInCredentials: {},

iniDataInConfig: {
default: (_m = {}, _m[configKey] = mockConfigNotAnswer, _m),
default: { [configKey]: mockConfigNotAnswer },
},

@@ -107,6 +104,5 @@ iniDataInCredentials: {},

];
describe("uses the shared ini file loader if pre-loaded config is not supplied", function () {
loadedConfigResolves.forEach(function (_a) {
var message = _a.message, iniDataInConfig = _a.iniDataInConfig, iniDataInCredentials = _a.iniDataInCredentials, configValueToVerify = _a.configValueToVerify, profile = _a.profile, preferredFile = _a.preferredFile;
it(message, function () {
describe("uses the shared ini file loader if pre-loaded config is not supplied", () => {
loadedConfigResolves.forEach(({ message, iniDataInConfig, iniDataInCredentials, configValueToVerify, profile, preferredFile }) => {
it(message, () => {
shared_ini_file_loader_1.loadSharedConfigFiles.mockResolvedValueOnce({

@@ -116,8 +112,7 @@ configFile: iniDataInConfig,

});
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { profile: profile, preferredFile: preferredFile })()).resolves.toBe(configValueToVerify);
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { profile, preferredFile })()).resolves.toBe(configValueToVerify);
});
});
loadedConfigRejects.forEach(function (_a) {
var message = _a.message, iniDataInConfig = _a.iniDataInConfig, iniDataInCredentials = _a.iniDataInCredentials, profile = _a.profile, preferredFile = _a.preferredFile;
it(message, function () {
loadedConfigRejects.forEach(({ message, iniDataInConfig, iniDataInCredentials, profile, preferredFile }) => {
it(message, () => {
shared_ini_file_loader_1.loadSharedConfigFiles.mockResolvedValueOnce({

@@ -127,31 +122,29 @@ configFile: iniDataInConfig,

});
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { profile: profile, preferredFile: preferredFile })()).rejects.toMatchObject(getProviderError(profile !== null && profile !== void 0 ? profile : "default", configGetter));
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { profile, preferredFile })()).rejects.toMatchObject(getProviderError(profile !== null && profile !== void 0 ? profile : "default", configGetter));
});
});
});
describe("uses pre-loaded config if supplied", function () {
loadedConfigResolves.forEach(function (_a) {
var message = _a.message, iniDataInConfig = _a.iniDataInConfig, iniDataInCredentials = _a.iniDataInCredentials, configValueToVerify = _a.configValueToVerify, profile = _a.profile, preferredFile = _a.preferredFile;
it(message + " from config file", function () {
var loadedConfig = Promise.resolve({
describe("uses pre-loaded config if supplied", () => {
loadedConfigResolves.forEach(({ message, iniDataInConfig, iniDataInCredentials, configValueToVerify, profile, preferredFile }) => {
it(`${message} from config file`, () => {
const loadedConfig = Promise.resolve({
configFile: iniDataInConfig,
credentialsFile: iniDataInCredentials,
});
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig: loadedConfig, profile: profile, preferredFile: preferredFile })()).resolves.toBe(configValueToVerify);
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig, profile, preferredFile })()).resolves.toBe(configValueToVerify);
});
});
loadedConfigRejects.forEach(function (_a) {
var message = _a.message, iniDataInConfig = _a.iniDataInConfig, iniDataInCredentials = _a.iniDataInCredentials, profile = _a.profile, preferredFile = _a.preferredFile;
it(message, function () {
var loadedConfig = Promise.resolve({
loadedConfigRejects.forEach(({ message, iniDataInConfig, iniDataInCredentials, profile, preferredFile }) => {
it(message, () => {
const loadedConfig = Promise.resolve({
configFile: iniDataInConfig,
credentialsFile: iniDataInCredentials,
});
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig: loadedConfig, profile: profile, preferredFile: preferredFile })()).rejects.toMatchObject(getProviderError(profile !== null && profile !== void 0 ? profile : "default", configGetter));
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig, profile, preferredFile })()).rejects.toMatchObject(getProviderError(profile !== null && profile !== void 0 ? profile : "default", configGetter));
});
});
});
it("rejects if getter throws", function () {
var message = "Cannot load config";
var failGetter = function () {
it("rejects if getter throws", () => {
const message = "Cannot load config";
const failGetter = () => {
throw new Error(message);

@@ -166,22 +159,21 @@ };

});
describe("profile", function () {
var _a, _b, _c;
var loadedConfigData = {
describe("profile", () => {
const loadedConfigData = {
configFile: {
default: (_a = {}, _a[configKey] = "configFileDefault", _a),
foo: (_b = {}, _b[configKey] = "configFileFoo", _b),
default: { [configKey]: "configFileDefault" },
foo: { [configKey]: "configFileFoo" },
},
credentialsFile: {
default: (_c = {}, _c[configKey] = "credentialsFileDefault", _c),
default: { [configKey]: "credentialsFileDefault" },
},
};
var loadedConfig = Promise.resolve(loadedConfigData);
describe("when profile is not defined", function () {
it("returns configValue from value in '" + fromSharedConfigFiles_1.ENV_PROFILE + "' env var if it is set", function () {
var profile = "foo";
const loadedConfig = Promise.resolve(loadedConfigData);
describe("when profile is not defined", () => {
it(`returns configValue from value in '${fromSharedConfigFiles_1.ENV_PROFILE}' env var if it is set`, () => {
const profile = "foo";
process.env[fromSharedConfigFiles_1.ENV_PROFILE] = profile;
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig: loadedConfig })()).resolves.toBe(loadedConfigData.configFile[profile][configKey]);
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig })()).resolves.toBe(loadedConfigData.configFile[profile][configKey]);
});
it("returns configValue from default profile if '" + fromSharedConfigFiles_1.ENV_PROFILE + "' env var is not set", function () {
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig: loadedConfig })()).resolves.toBe(loadedConfigData.configFile.default[configKey]);
it(`returns configValue from default profile if '${fromSharedConfigFiles_1.ENV_PROFILE}' env var is not set`, () => {
return expect(fromSharedConfigFiles_1.fromSharedConfigFiles(configGetter, { loadedConfig })()).resolves.toBe(loadedConfigData.configFile.default[configKey]);
});

@@ -191,2 +183,2 @@ });

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbVNoYXJlZENvbmZpZ0ZpbGVzLnNwZWMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZnJvbVNoYXJlZENvbmZpZ0ZpbGVzLnNwZWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxnRUFBMkQ7QUFDM0QsMEVBQWdHO0FBRWhHLGlFQUFpSDtBQUVqSCxJQUFJLENBQUMsSUFBSSxDQUFDLGlDQUFpQyxFQUFFLGNBQU0sT0FBQSxDQUFDO0lBQ2xELHFCQUFxQixFQUFFLElBQUksQ0FBQyxFQUFFLEVBQUU7Q0FDakMsQ0FBQyxFQUZpRCxDQUVqRCxDQUFDLENBQUM7QUFFSixRQUFRLENBQUMsdUJBQXVCLEVBQUU7SUFDaEMsSUFBTSxVQUFVLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxtQ0FBVyxDQUFDLENBQUM7SUFDNUMsSUFBTSxTQUFTLEdBQUcsWUFBWSxDQUFDO0lBQy9CLElBQU0sWUFBWSxHQUE2QixVQUFDLE9BQWdCLElBQUssT0FBQSxPQUFPLENBQUMs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7IGxvYWRlZENvbmZpZyB9KSgpKS5yZXNvbHZlcy50b0JlKFxuICAgICAgICAgIGxvYWRlZENvbmZpZ0RhdGEuY29uZmlnRmlsZVtwcm9maWxlXVtjb25maWdLZXldXG4gICAgICAgICk7XG4gICAgICB9KTtcblxuICAgICAgaXQoYHJldHVybnMgY29uZmlnVmFsdWUgZnJvbSBkZWZhdWx0IHByb2ZpbGUgaWYgJyR7RU5WX1BST0ZJTEV9JyBlbnYgdmFyIGlzIG5vdCBzZXRgLCAoKSA9PiB7XG4gICAgICAgIHJldHVybiBleHBlY3QoZnJvbVNoYXJlZENvbmZpZ0ZpbGVzKGNvbmZpZ0dldHRlciwgeyBsb2FkZWRDb25maWcgfSkoKSkucmVzb2x2ZXMudG9CZShcbiAgICAgICAgICBsb2FkZWRDb25maWdEYXRhLmNvbmZpZ0ZpbGUuZGVmYXVsdFtjb25maWdLZXldXG4gICAgICAgICk7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfSk7XG59KTtcbiJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromStatic = void 0;
var tslib_1 = require("tslib");
var property_provider_1 = require("@aws-sdk/property-provider");
var isFunction = function (func) { return typeof func === "function"; };
exports.fromStatic = function (defaultValue) {
return isFunction(defaultValue) ? function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
return [2 /*return*/, defaultValue()];
}); }); } : property_provider_1.fromStatic(defaultValue);
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbVN0YXRpYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mcm9tU3RhdGljLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxnRUFBNkU7QUFLN0UsSUFBTSxVQUFVLEdBQUcsVUFBSSxJQUF5QixJQUF3QixPQUFBLE9BQU8sSUFBSSxLQUFLLFVBQVUsRUFBMUIsQ0FBMEIsQ0FBQztBQUV0RixRQUFBLFVBQVUsR0FBRyxVQUFJLFlBQWlDO0lBQzdELE9BQUEsVUFBVSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUFZLHNCQUFBLFlBQVksRUFBRSxFQUFBO2FBQUEsQ0FBQyxDQUFDLENBQUMsOEJBQWlCLENBQUMsWUFBWSxDQUFDO0FBQXZGLENBQXVGLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBmcm9tU3RhdGljIGFzIGNvbnZlcnRUb1Byb3ZpZGVyIH0gZnJvbSBcIkBhd3Mtc2RrL3Byb3BlcnR5LXByb3ZpZGVyXCI7XG5pbXBvcnQgeyBQcm92aWRlciB9IGZyb20gXCJAYXdzLXNkay90eXBlc1wiO1xuXG5leHBvcnQgdHlwZSBGcm9tU3RhdGljQ29uZmlnPFQ+ID0gVCB8ICgoKSA9PiBUKTtcbnR5cGUgR2V0dGVyPFQ+ID0gKCkgPT4gVDtcbmNvbnN0IGlzRnVuY3Rpb24gPSA8VD4oZnVuYzogRnJvbVN0YXRpY0NvbmZpZzxUPik6IGZ1bmMgaXMgR2V0dGVyPFQ+ID0+IHR5cGVvZiBmdW5jID09PSBcImZ1bmN0aW9uXCI7XG5cbmV4cG9ydCBjb25zdCBmcm9tU3RhdGljID0gPFQ+KGRlZmF1bHRWYWx1ZTogRnJvbVN0YXRpY0NvbmZpZzxUPik6IFByb3ZpZGVyPFQ+ID0+XG4gIGlzRnVuY3Rpb24oZGVmYXVsdFZhbHVlKSA/IGFzeW5jICgpID0+IGRlZmF1bHRWYWx1ZSgpIDogY29udmVydFRvUHJvdmlkZXIoZGVmYXVsdFZhbHVlKTtcbiJdfQ==
const property_provider_1 = require("@aws-sdk/property-provider");
const isFunction = (func) => typeof func === "function";
exports.fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => defaultValue() : property_provider_1.fromStatic(defaultValue);
//# sourceMappingURL=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ihkZWZhdWx0VmFsdWUpID8gYXN5bmMgKCkgPT4gZGVmYXVsdFZhbHVlKCkgOiBjb252ZXJ0VG9Qcm92aWRlcihkZWZhdWx0VmFsdWUpO1xuIl19
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var property_provider_1 = require("@aws-sdk/property-provider");
var fromStatic_1 = require("./fromStatic");
jest.mock("@aws-sdk/property-provider", function () { return ({
const property_provider_1 = require("@aws-sdk/property-provider");
const fromStatic_1 = require("./fromStatic");
jest.mock("@aws-sdk/property-provider", () => ({
fromStatic: jest.fn(),
}); });
describe("fromStatic", function () {
var value = "default";
it("should convert static values to provider", function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
property_provider_1.fromStatic.mockReturnValue(value);
fromStatic_1.fromStatic(value);
expect(property_provider_1.fromStatic).toHaveBeenCalledWith(value);
return [2 /*return*/];
});
}); });
it("should call the getter function", function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var getter, config, _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
getter = jest.fn().mockReturnValue(value);
config = fromStatic_1.fromStatic(getter);
_a = expect;
return [4 /*yield*/, config()];
case 1:
_a.apply(void 0, [_b.sent()]).toBe(value);
expect(getter).toHaveBeenCalled();
return [2 /*return*/];
}
});
}); });
}));
describe("fromStatic", () => {
const value = "default";
it("should convert static values to provider", async () => {
property_provider_1.fromStatic.mockReturnValue(value);
fromStatic_1.fromStatic(value);
expect(property_provider_1.fromStatic).toHaveBeenCalledWith(value);
});
it("should call the getter function", async () => {
const getter = jest.fn().mockReturnValue(value);
const config = fromStatic_1.fromStatic(getter);
expect(await config()).toBe(value);
expect(getter).toHaveBeenCalled();
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbVN0YXRpYy5zcGVjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc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xsZWQoKTtcbiAgfSk7XG59KTtcbiJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./configLoader"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseURBQStCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vY29uZmlnTG9hZGVyXCI7XG4iXX0=
{
"name": "@aws-sdk/node-config-provider",
"version": "1.0.0-gamma.4",
"version": "1.0.0-rc.1",
"description": "Load config default values from ini config files and environmental variable",

@@ -23,5 +23,5 @@ "scripts": {

"dependencies": {
"@aws-sdk/property-provider": "1.0.0-gamma.8",
"@aws-sdk/shared-ini-file-loader": "1.0.0-gamma.8",
"@aws-sdk/types": "1.0.0-gamma.7",
"@aws-sdk/property-provider": "1.0.0-rc.1",
"@aws-sdk/shared-ini-file-loader": "1.0.0-rc.1",
"@aws-sdk/types": "1.0.0-rc.1",
"tslib": "^1.8.0"

@@ -34,3 +34,6 @@ },

"typescript": "~4.0.2"
},
"engines": {
"node": ">= 10.0.0"
}
}
{
"compilerOptions": {
"declaration": true,
"strict": true,
"sourceMap": false,
"downlevelIteration": true,
"noEmitHelpers": true,
"importHelpers": true,
"lib": ["es5", "es2015.promise", "es2015.iterable"],
"rootDir": "./src",
"outDir": "./dist/cjs",
"inlineSourceMap": true,
"inlineSources": true,
"baseUrl": "."

@@ -15,0 +6,0 @@ },

{
"compilerOptions": {
"declaration": true,
"strict": true,
"sourceMap": false,
"downlevelIteration": true,
"noEmitHelpers": true,
"importHelpers": true,
"lib": ["es5", "es2015.promise", "es2015.iterable"],
"rootDir": "./src",
"outDir": "./dist/es",
"inlineSourceMap": true,
"inlineSources": true,
"baseUrl": "."

@@ -15,0 +7,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc