Skip to content

Commit 25ad3e1

Browse files
rename cloudserver client
1 parent 53f6217 commit 25ad3e1

10 files changed

+60
-60
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
22
CloudserverClient as GeneratedCloudserverClient,
33
CloudserverClientConfig
4-
} from '../../build/smithy/cloudserver/typescript-codegen';
4+
} from '../../build/smithy/cloudserver/typescript-codegen/dist-types';
55
import { createCustomErrorMiddleware } from '../utils';
66

7-
export * from '../../build/smithy/cloudserver/typescript-codegen';
8-
export class CloudserverClient extends GeneratedCloudserverClient {
7+
export * from '../../build/smithy/cloudserver/typescript-codegen/dist-types';
8+
export class BackbeatRoutesClient extends GeneratedCloudserverClient {
99
constructor(config: CloudserverClientConfig) {
1010
super(config);
1111

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export * from './clients/cloudserver';
1+
export * from './clients/backbeatRoutes';
22
export { BucketQuotaClient } from './clients/bucketQuota';
33
export * from './utils';

tests/testApis.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
CloudserverClient,
2+
BackbeatRoutesClient,
33
PutDataCommandInput,
44
PutDataCommand,
55
GetObjectInput,
@@ -16,11 +16,11 @@ import { createTestClient, testConfig } from './testSetup';
1616
import assert from 'assert';
1717

1818
describe('CloudServer API Tests', () => {
19-
let client: CloudserverClient;
19+
let backbeatRoutesClient: BackbeatRoutesClient;
2020
let s3client: S3Client;
2121

2222
beforeAll(() => {
23-
({client, s3client} = createTestClient());
23+
({backbeatRoutesClient, s3client} = createTestClient());
2424
});
2525

2626
it('should test PutData', async () => {
@@ -44,7 +44,7 @@ describe('CloudServer API Tests', () => {
4444
command2,
4545
getData.ContentLength
4646
);
47-
const data = await client.send(command2);
47+
const data = await backbeatRoutesClient.send(command2);
4848
const locationAny: any = data.Location as any;
4949
assert.ok(locationAny[0].key !== undefined);
5050
});
@@ -56,7 +56,7 @@ describe('CloudServer API Tests', () => {
5656
RequestUids: '123',
5757
};
5858
const getCommand = new GetObjectCommand(getInput);
59-
const getData = await client.send(getCommand);
59+
const getData = await backbeatRoutesClient.send(getCommand);
6060
const bodyStr = await getData.Body.transformToString();
6161
assert.strictEqual(bodyStr, testConfig.objectData);
6262
});
@@ -67,7 +67,7 @@ describe('CloudServer API Tests', () => {
6767
Bucket: testConfig.bucketName,
6868
};
6969
const getCommand = new GetObjectListCommand(getInput);
70-
const getData = await client.send(getCommand);
70+
const getData = await backbeatRoutesClient.send(getCommand);
7171
const contents = getData.Contents || [];
7272
assert.strictEqual(Array.isArray(contents), true);
7373
const found = contents.some(c => c?.key === testConfig.objectKey);
@@ -94,7 +94,7 @@ describe('CloudServer API Tests', () => {
9494
};
9595

9696
const batchDeleteCommand = new BatchDeleteCommand(batchDeleteInput);
97-
const result = await client.send(batchDeleteCommand);
97+
const result = await backbeatRoutesClient.send(batchDeleteCommand);
9898
assert.strictEqual(result.$metadata.httpStatusCode, 200);
9999
});
100100
});

tests/testErrorHandling.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
CloudserverClient,
2+
BackbeatRoutesClient,
33
MultipleBackendDeleteObjectInput,
44
MultipleBackendDeleteObjectCommand,
55
GetObjectInput,
@@ -9,10 +9,10 @@ import assert from 'assert';
99
import { createTestClient, testConfig } from './testSetup';
1010

1111
describe('CloudServer test error handling', () => {
12-
let client: CloudserverClient;
12+
let backbeatRoutesClient: BackbeatRoutesClient;
1313

1414
beforeAll(() => {
15-
({client} = createTestClient());
15+
({backbeatRoutesClient} = createTestClient());
1616
});
1717

1818
it('should test xml parsing', async () => {
@@ -22,7 +22,7 @@ describe('CloudServer test error handling', () => {
2222
Key: 'notAKey',
2323
};
2424
const getCommand = new GetObjectCommand(getInput);
25-
await client.send(getCommand);
25+
await backbeatRoutesClient.send(getCommand);
2626
assert.fail('Expected an error but none was thrown');
2727
} catch (err: any) {
2828
assert.strictEqual(err.name, 'NoSuchKey');
@@ -42,7 +42,7 @@ describe('CloudServer test error handling', () => {
4242
StorageType: 'file'
4343
};
4444
const commandDelete = new MultipleBackendDeleteObjectCommand(deleteInput);
45-
await client.send(commandDelete);
45+
await backbeatRoutesClient.send(commandDelete);
4646
} catch (err: any) {
4747
assert.strictEqual(err.name, 'NoSuchKey');
4848
assert.strictEqual(err.$metadata?.httpStatusCode, 404);

tests/testIndexesApis.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
CloudserverClient,
2+
BackbeatRoutesClient,
33
GetBucketIndexesInput,
44
GetBucketIndexesCommand,
55
PutBucketIndexesInput,
@@ -11,10 +11,10 @@ import assert from 'assert';
1111
import { createTestClient, testConfig } from './testSetup';
1212

1313
describe('CloudServer Indexes API Tests', () => {
14-
let client: CloudserverClient;
14+
let backbeatRoutesClient: BackbeatRoutesClient;
1515

1616
beforeAll(() => {
17-
({client} = createTestClient());
17+
({backbeatRoutesClient} = createTestClient());
1818
});
1919

2020
it('should test PutBucketIndexes', async () => {
@@ -32,7 +32,7 @@ describe('CloudServer Indexes API Tests', () => {
3232
Body: new TextEncoder().encode(indexData),
3333
};
3434
const putBucketIndexesCommand = new PutBucketIndexesCommand(putBucketIndexesInput);
35-
const result = await client.send(putBucketIndexesCommand);
35+
const result = await backbeatRoutesClient.send(putBucketIndexesCommand);
3636
assert.strictEqual(result.$metadata.httpStatusCode, 200);
3737
});
3838

@@ -41,7 +41,7 @@ describe('CloudServer Indexes API Tests', () => {
4141
Bucket: testConfig.bucketName,
4242
};
4343
const getBucketIndexesCommand = new GetBucketIndexesCommand(getBucketIndexesInput);
44-
const indexesData = await client.send(getBucketIndexesCommand);
44+
const indexesData = await backbeatRoutesClient.send(getBucketIndexesCommand);
4545
assert.ok(indexesData.Indexes && indexesData.Indexes.length >= 1);
4646
});
4747

@@ -60,7 +60,7 @@ describe('CloudServer Indexes API Tests', () => {
6060
Body: new TextEncoder().encode(indexesToDelete),
6161
};
6262
const deleteBucketIndexesCommand = new DeleteBucketIndexesCommand(deleteBucketIndexesInput);
63-
const result = await client.send(deleteBucketIndexesCommand);
63+
const result = await backbeatRoutesClient.send(deleteBucketIndexesCommand);
6464
assert.strictEqual(result.$metadata.httpStatusCode, 200);
6565
});
6666
});

tests/testLifecycleApis.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
CloudserverClient,
2+
BackbeatRoutesClient,
33
ListLifecycleCurrentsInput,
44
ListLifecycleCurrentsCommand,
55
ListLifecycleNonCurrentsInput,
@@ -13,10 +13,10 @@ import assert from 'assert';
1313
import { createTestClient, testConfig } from './testSetup';
1414

1515
describe('CloudServer Lifecycle API Tests', () => {
16-
let client: CloudserverClient;
16+
let backbeatRoutesClient: BackbeatRoutesClient;
1717

1818
beforeAll(() => {
19-
({client} = createTestClient());
19+
({backbeatRoutesClient} = createTestClient());
2020
});
2121

2222
it('should test ListLifecycleCurrents', async () => {
@@ -25,7 +25,7 @@ describe('CloudServer Lifecycle API Tests', () => {
2525
MaxKeys: 1,
2626
};
2727
const command = new ListLifecycleCurrentsCommand(listInput);
28-
const result = await client.send(command);
28+
const result = await backbeatRoutesClient.send(command);
2929
assert.strictEqual(result.Contents?.[0].Key, testConfig.objectKey);
3030
});
3131

@@ -35,7 +35,7 @@ describe('CloudServer Lifecycle API Tests', () => {
3535
MaxKeys: 5,
3636
};
3737
const command = new ListLifecycleNonCurrentsCommand(listInput);
38-
const result = await client.send(command);
38+
const result = await backbeatRoutesClient.send(command);
3939
assert.strictEqual(result.$metadata.httpStatusCode, 200);
4040
});
4141

@@ -45,7 +45,7 @@ describe('CloudServer Lifecycle API Tests', () => {
4545
MaxKeys: 5,
4646
};
4747
const command = new ListLifecycleOrphansCommand(listInput);
48-
const result = await client.send(command);
48+
const result = await backbeatRoutesClient.send(command);
4949
assert.strictEqual(result.$metadata.httpStatusCode, 200);
5050
});
5151

@@ -55,7 +55,7 @@ describe('CloudServer Lifecycle API Tests', () => {
5555
Key: testConfig.objectKey,
5656
};
5757
const command = new DeleteObjectFromExpirationCommand(deleteInput);
58-
const result = await client.send(command);
58+
const result = await backbeatRoutesClient.send(command);
5959
assert.strictEqual(result.$metadata.httpStatusCode, 200);
6060
});
6161
});

tests/testMetadataApis.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
CloudserverClient,
2+
BackbeatRoutesClient,
33
GetMetadataInput,
44
GetMetadataCommand,
55
PutMetadataInput,
@@ -11,10 +11,10 @@ import assert from 'assert';
1111
import { createTestClient, testConfig } from './testSetup';
1212

1313
describe('CloudServer Metadata API Tests', () => {
14-
let client: CloudserverClient;
14+
let backbeatRoutesClient: BackbeatRoutesClient;
1515

1616
beforeAll(() => {
17-
({client} = createTestClient());
17+
({backbeatRoutesClient} = createTestClient());
1818
});
1919

2020
it('should test GetMetadata API', async () => {
@@ -23,7 +23,7 @@ describe('CloudServer Metadata API Tests', () => {
2323
Key: testConfig.objectKey,
2424
};
2525
const getMetadataCommand = new GetMetadataCommand(getMetadataInput);
26-
const metadataData = await client.send(getMetadataCommand);
26+
const metadataData = await backbeatRoutesClient.send(getMetadataCommand);
2727
assert.ok(metadataData.Body?.includes(testConfig.objectKey));
2828
});
2929

@@ -48,7 +48,7 @@ describe('CloudServer Metadata API Tests', () => {
4848
};
4949

5050
const command = new PutMetadataCommand(putInput);
51-
const result = await client.send(command);
51+
const result = await backbeatRoutesClient.send(command);
5252
assert.strictEqual(result.$metadata.httpStatusCode, 200);
5353
});
5454

@@ -58,7 +58,7 @@ describe('CloudServer Metadata API Tests', () => {
5858
Bucket: testConfig.bucketName,
5959
};
6060
const getBucketMetadataCommand = new GetBucketMetadataCommand(getBucketMetadataInput);
61-
const bucketMetadata = await client.send(getBucketMetadataCommand);
61+
const bucketMetadata = await backbeatRoutesClient.send(getBucketMetadataCommand);
6262
assert.strictEqual(bucketMetadata.name, testConfig.bucketName);
6363
});
6464
});

tests/testMultipleBackendApis.test.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
CloudserverClient,
2+
BackbeatRoutesClient,
33
MultipleBackendPutObjectInput,
44
MultipleBackendPutObjectCommand,
55
MultipleBackendDeleteObjectInput,
@@ -25,10 +25,10 @@ import assert from 'assert';
2525
import crypto from 'crypto';
2626

2727
describe('CloudServer Multiple Backend API Tests', () => {
28-
let client: CloudserverClient;
28+
let backbeatRoutesClient: BackbeatRoutesClient;
2929

3030
beforeAll(() => {
31-
({client} = createTestClient());
31+
({backbeatRoutesClient} = createTestClient());
3232
});
3333

3434
it('should test MultipleBackendPutObject and delete API', async () => {
@@ -39,7 +39,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
3939
RequestUids: '123',
4040
};
4141
const getCommand = new GetObjectCommand(getInput);
42-
const getData = await client.send(getCommand);
42+
const getData = await backbeatRoutesClient.send(getCommand);
4343
const etag = getData.ETag?.replace(/"/g, '') || '';
4444

4545
const incomingMsg = getData.Body as any;
@@ -69,7 +69,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
6969
command,
7070
contentLength
7171
);
72-
const result = await client.send(command);
72+
const result = await backbeatRoutesClient.send(command);
7373

7474
assert.ok(result.location && result.location.length > 0, 'Location should not be empty');
7575
const location = result.location[0];
@@ -87,7 +87,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
8787
StorageType: 'file'
8888
};
8989
const commandDelete = new MultipleBackendDeleteObjectCommand(deleteInput);
90-
const deleteResult = await client.send(commandDelete);
90+
const deleteResult = await backbeatRoutesClient.send(commandDelete);
9191
assert.strictEqual(deleteResult.$metadata.httpStatusCode, 200);
9292
});
9393

@@ -97,7 +97,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
9797
Key: testConfig.objectKey,
9898
};
9999
const getCommand = new GetObjectCommand(getInput);
100-
const getData = await client.send(getCommand);
100+
const getData = await backbeatRoutesClient.send(getCommand);
101101
const dataBody = await getData.Body.transformToString();
102102
const bodyBuffer = Buffer.from(dataBody);
103103
const contentMD5 = crypto.createHash('md5').update(bodyBuffer).digest('hex');
@@ -121,7 +121,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
121121
};
122122

123123
const command = new MultipleBackendPutObjectCommand(putInput as any);
124-
const result = await client.send(command);
124+
const result = await backbeatRoutesClient.send(command);
125125
const locationKey = result.location?.[0]?.key || '';
126126

127127
const headInput: MultipleBackendHeadObjectInput = {
@@ -133,7 +133,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
133133
}])
134134
};
135135
const headCommand = new MultipleBackendHeadObjectCommand(headInput);
136-
const headResult = await client.send(headCommand);
136+
const headResult = await backbeatRoutesClient.send(headCommand);
137137
assert.strictEqual(headResult.$metadata.httpStatusCode, 200);
138138
});
139139

@@ -162,7 +162,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
162162
ReplicationEndpointSite: 'aVal'
163163
};
164164
const putTaggingCommand = new MultipleBackendPutObjectTaggingCommand(putTaggingInput);
165-
const putTaggingResult = await client.send(putTaggingCommand);
165+
const putTaggingResult = await backbeatRoutesClient.send(putTaggingCommand);
166166
assert.strictEqual(putTaggingResult.$metadata.httpStatusCode, 200);
167167
});
168168

@@ -179,7 +179,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
179179
};
180180

181181
const deleteTaggingCommand = new MultipleBackendDeleteObjectTaggingCommand(deleteTaggingInput);
182-
const deleteTaggingResult = await client.send(deleteTaggingCommand);
182+
const deleteTaggingResult = await backbeatRoutesClient.send(deleteTaggingCommand);
183183
assert.strictEqual(deleteTaggingResult.$metadata.httpStatusCode, 200);
184184
});
185185

@@ -198,7 +198,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
198198
};
199199

200200
const initiateMPUCommand = new MultipleBackendInitiateMPUCommand(initiateMPUInput);
201-
const initiateMPUResult = await client.send(initiateMPUCommand);
201+
const initiateMPUResult = await backbeatRoutesClient.send(initiateMPUCommand);
202202
const uploadId = initiateMPUResult.uploadId;
203203
assert.strictEqual(initiateMPUResult.$metadata.httpStatusCode, 200);
204204

@@ -208,7 +208,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
208208
Key: testConfig.objectKey,
209209
};
210210
const getCommand = new GetObjectCommand(getInput);
211-
const getData = await client.send(getCommand);
211+
const getData = await backbeatRoutesClient.send(getCommand);
212212
const putPartInput: MultipleBackendPutMPUPartInput = {
213213
Bucket: testConfig.bucketName,
214214
Key: `${testConfig.objectKey}-mpu`,
@@ -220,7 +220,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
220220
};
221221

222222
const putPartCommand = new MultipleBackendPutMPUPartCommand(putPartInput as any);
223-
const putPartResult = await client.send(putPartCommand);
223+
const putPartResult = await backbeatRoutesClient.send(putPartCommand);
224224
assert.strictEqual(putPartResult.$metadata.httpStatusCode, 200);
225225

226226
const completeMPUInput: MultipleBackendCompleteMPUInput = {
@@ -238,7 +238,7 @@ describe('CloudServer Multiple Backend API Tests', () => {
238238
}))
239239
};
240240
const completeMPUCommand = new MultipleBackendCompleteMPUCommand(completeMPUInput);
241-
const completeMPUResult = await client.send(completeMPUCommand);
241+
const completeMPUResult = await backbeatRoutesClient.send(completeMPUCommand);
242242
assert.strictEqual(completeMPUResult.$metadata.httpStatusCode, 200);
243243
});
244244
});

0 commit comments

Comments
 (0)