Skip to content

Commit d4469f0

Browse files
cleanup tests
1 parent 00e4389 commit d4469f0

22 files changed

+659
-691
lines changed

LICENCE renamed to LICENSE

File renamed without changes.

build/smithy/source/model/model.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/smithy/source/sources/cloudserver.smithy

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/smithy/source/sources/deleteBucketIndexes.smithy

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/smithy/source/typescript-codegen/yarn.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { CloudserverClient as GeneratedCloudserverClient, CloudserverClientConfig } from '../build/smithy/source/typescript-codegen';
22
export * from '../build/smithy/source/typescript-codegen';
3+
export * from './utils';
34
export declare class CloudserverClient extends GeneratedCloudserverClient {
45
constructor(config: CloudserverClientConfig);
56
private createCustomErrorMiddleware;

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ exports.CloudserverClient = void 0;
1818
const fast_xml_parser_1 = require("fast-xml-parser");
1919
const typescript_codegen_1 = require("../build/smithy/source/typescript-codegen");
2020
__exportStar(require("../build/smithy/source/typescript-codegen"), exports);
21+
__exportStar(require("./utils"), exports);
2122
class CloudserverClient extends typescript_codegen_1.CloudserverClient {
2223
constructor(config) {
2324
super(config);

dist/utils.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Adds middleware to manually set the Content-Length header on a command.
3+
*
4+
* This is useful when streaming data where the SDK cannot automatically determine
5+
* the content length, preventing it from falling back to chunked transfer encoding.
6+
*
7+
* @param command - The command to add middleware to
8+
* @param contentLength - The content length value (number or string)
9+
* @returns The command with middleware added
10+
*/
11+
export declare function addContentLengthMiddleware<TCommand>(command: TCommand, contentLength: number | string | undefined): TCommand;

dist/utils.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.addContentLengthMiddleware = addContentLengthMiddleware;
4+
/**
5+
* Adds middleware to manually set the Content-Length header on a command.
6+
*
7+
* This is useful when streaming data where the SDK cannot automatically determine
8+
* the content length, preventing it from falling back to chunked transfer encoding.
9+
*
10+
* @param command - The command to add middleware to
11+
* @param contentLength - The content length value (number or string)
12+
* @returns The command with middleware added
13+
*/
14+
function addContentLengthMiddleware(command, contentLength) {
15+
if (!contentLength) {
16+
return;
17+
}
18+
const commandWithMiddleware = command;
19+
if (!commandWithMiddleware.middlewareStack) {
20+
throw new Error('Command does not have a middleware stack');
21+
}
22+
commandWithMiddleware.middlewareStack.add((next) => async (args) => {
23+
const request = args.request;
24+
if (request && request.headers) {
25+
request.headers['content-length'] = String(contentLength);
26+
}
27+
return next(args);
28+
}, { step: 'build', priority: 'high' });
29+
return;
30+
}

models/deleteBucketIndexes.smithy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ $version: "2.0"
22
namespace cloudserver.client
33

44
@http(method: "POST", uri: "/_/backbeat/index/{Bucket}?operation=delete")
5+
@idempotent
56
operation DeleteBucketIndexes {
67
input: DeleteBucketIndexesInput,
78
output: DeleteBucketIndexesOutput

0 commit comments

Comments
 (0)