//#region ../../node_modules/.pnpm/@smithy+types@4.16.1/node_modules/@smithy/types/dist-types/identity/identity.d.ts /** * @public */ interface Identity { /** * A `Date` when the identity or credential will no longer be accepted. */ readonly expiration?: Date; } /** * @public */ interface IdentityProvider { (identityProperties?: Record): Promise; } //#endregion //#region ../../node_modules/.pnpm/@smithy+types@4.16.1/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts declare global { /** * interface merging stub. */ interface RequestInit {} } //#endregion //#region ../../node_modules/.pnpm/@smithy+types@4.16.1/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts /** * @public */ interface AwsCredentialIdentity extends Identity { /** * AWS access key ID */ readonly accessKeyId: string; /** * AWS secret access key */ readonly secretAccessKey: string; /** * A security or session token to use with these credentials. Usually * present for temporary credentials. */ readonly sessionToken?: string; /** * AWS credential scope for this set of credentials. */ readonly credentialScope?: string; /** * AWS accountId. */ readonly accountId?: string; } /** * @public */ type AwsCredentialIdentityProvider = IdentityProvider; //#endregion //#region ../../node_modules/.pnpm/@aws-sdk+types@3.974.0/node_modules/@aws-sdk/types/dist-types/serde.d.ts /** * @public * * Declare DOM interfaces in case dom.d.ts is not added to the tsconfig lib, causing * interfaces to not be defined. For developers with dom.d.ts added, the interfaces will * be merged correctly. * * This is also required for any clients with streaming interfaces where the corresponding * types are also referred. The type is only declared here once since this `@aws-sdk/types` * is depended by all `@aws-sdk` packages. */ declare global { /** * @public */ export interface ReadableStream {} /** * @public */ export interface Blob {} } //#endregion //#region src/credential-provider.d.ts /** * Returns the default credential provider based on the environment. * In Node.js, it uses the default provider from @aws-sdk/credential-provider-node. * In a browser environment, it throws an error as credentials must be provided explicitly. * * The provider is constructed once and reused for the lifetime of the process. * The AWS SDK caches resolved credentials per provider instance and refreshes * them before they expire, so reusing one instance avoids re-resolving * credentials (and leaking the HTTP resources used to fetch them) on every call. */ declare function getDefaultCredentialProvider(): Promise; //#endregion //#region src/parse-request.d.ts interface ParsedRequest { url: URL; method: string; headers: Record; body?: ArrayBuffer; } /** * Extract the URL, method, body, and headers from a request. * Input can be a `string`, `URL`, or `Request` object. * Init is an optional `RequestInit` object. If provided, it will override the values in the `Request` object. */ declare const parseRequest: (input: string | Request | URL, init?: RequestInit) => Promise; //#endregion //#region src/sign-request.d.ts type SignRequestOptions = { /** * The AWS service to sign requests for, e.g. `execute-api` for AWS API Gateway or `lambda` for Lambda Function URLs. */ service: string; /** * The AWS region to sign requests for, e.g. `us-east-1` or `eu-west-2`. * Defaults to `us-east-1` if not provided. */ region?: string; /** * The AWS credentials to use when signing requests. * Optional in Node.js environments where they will be retrieved from the environment using [`@aws-sdk/credential-provider-node`](https://www.npmjs.com/package/@aws-sdk/credential-provider-node). * In browser environments, credentials are **required** and must be provided explicitly. * * When omitted, the default provider is constructed once and reused for the lifetime of the * process, so environment changes are not picked up after the first signed request. Pass this * option explicitly to control credential resolution yourself. * * @see {@link https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-types/Interface/AwsCredentialIdentity/ | AwsCredentialIdentity} * @see {@link https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-types/Interface/AwsCredentialIdentityProvider/ | AwsCredentialIdentityProvider} */ credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider; }; /** * Signs a request using AWS Signature V4 and returns a `Request` object. * * @example * ```ts * const signedRequest = await signRequest('https://mylambda.lambda-url.eu-west-1.on.aws/', { * service: 'lambda', * region: 'eu-west-1' * }); * * const response = await fetch(signedRequest); * ``` */ declare function signRequest(input: string | Request | URL, options: SignRequestOptions): Promise; /** * Signs a request using AWS Signature V4 and returns a `Request` object. * * @example * ```ts * const signedRequest = await signRequest('https://mylambda.lambda-url.eu-west-1.on.aws/', * { * method: 'POST', * body: JSON.stringify({ a: 1 }), * headers: { 'Content-Type': 'application/json' } * }, * { * service: 'lambda', * region: 'eu-west-1' * } * ); * * const response = await fetch(signedRequest); * ``` */ declare function signRequest(input: string | Request | URL, init: RequestInit, options: SignRequestOptions): Promise; //#endregion export { type SignRequestOptions, getDefaultCredentialProvider, parseRequest, signRequest };