Files
cloud-code/claude-code-source/node_modules/@aws-sdk/credential-providers/dist-cjs/createCredentialChain.js
janlaywss a192e187e8 fix: keep only source-map extracted node_modules, exclude pnpm artifacts
Restore node_modules to exact state from cli.js.map extraction:
- Move .ignored/ and .ignored_* files back to original package paths
- Remove pnpm symlinks (replaced by real source-map directories)
- Update .gitignore: only exclude /dist/, .pnpm/, .bin/, .ignored* dirs
- All package dist/ folders are now preserved as part of source-map files

After clone, run `pnpm install` to get pnpm-managed symlinks for building.
The committed node_modules contains the original TypeScript/JS source files
as bundled in cli.js.
2026-03-31 21:09:32 +08:00

46 lines
1.7 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.propertyProviderChain = exports.createCredentialChain = void 0;
const property_provider_1 = require("@smithy/property-provider");
const createCredentialChain = (...credentialProviders) => {
let expireAfter = -1;
const baseFunction = async (awsIdentityProperties) => {
const credentials = await (0, exports.propertyProviderChain)(...credentialProviders)(awsIdentityProperties);
if (!credentials.expiration && expireAfter !== -1) {
credentials.expiration = new Date(Date.now() + expireAfter);
}
return credentials;
};
const withOptions = Object.assign(baseFunction, {
expireAfter(milliseconds) {
if (milliseconds < 5 * 60_000) {
throw new Error("@aws-sdk/credential-providers - createCredentialChain(...).expireAfter(ms) may not be called with a duration lower than five minutes.");
}
expireAfter = milliseconds;
return withOptions;
},
});
return withOptions;
};
exports.createCredentialChain = createCredentialChain;
const propertyProviderChain = (...providers) => async (awsIdentityProperties) => {
if (providers.length === 0) {
throw new property_provider_1.ProviderError("No providers in chain", { tryNextLink: false });
}
let lastProviderError;
for (const provider of providers) {
try {
return await provider(awsIdentityProperties);
}
catch (err) {
lastProviderError = err;
if (err?.tryNextLink) {
continue;
}
throw err;
}
}
throw lastProviderError;
};
exports.propertyProviderChain = propertyProviderChain;